|
ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization 00005 // Copyright (2003) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 // @HEADER 00028 00029 #ifndef MATRIX_GEN_BANDED_H 00030 #define MATRIX_GEN_BANDED_H 00031 00032 #include "ConstrainedOptPack_Types.hpp" 00033 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_MatrixOp.hpp" 00034 #include "DenseLinAlgPack_DMatrixClass.hpp" 00035 #include "Miref_count_ptr.h" 00036 #include "MiReleaseResource.h" 00037 00038 namespace ConstrainedOptPack { 00059 class MatrixGenBanded : public MatrixOp 00060 { 00061 public: 00062 00064 typedef Teuchos::RCP< 00065 MemMngPack::ReleaseResource> release_resource_ptr_t; 00066 00067 // ////////////// 00068 // Constructors 00069 00074 MatrixGenBanded( 00075 size_type m = 0 00076 ,size_type n = 0 00077 ,size_type kl = 0 00078 ,size_type ku = 0 00079 ,DMatrixSlice *MB = NULL 00080 ,const release_resource_ptr_t& MB_release_resource_ptr = NULL 00081 ); 00082 00083 // /////////////////////////// 00084 // Access representation 00085 00104 void initialize( 00105 size_type m = 0 00106 ,size_type n = 0 00107 ,size_type kl = 0 00108 ,size_type ku = 0 00109 ,DMatrixSlice *MB = NULL 00110 ,const release_resource_ptr_t& MB_release_resource_ptr = NULL 00111 ); 00112 00114 size_type kl() const; 00116 size_type ku() const; 00119 DMatrixSlice& MB(); 00121 const DMatrixSlice& MB() const; 00122 00123 // ///////////////////////////// 00124 // Overridden from MatrixOp 00125 00127 size_type rows() const; 00129 size_type cols() const; 00131 size_type nz() const; 00133 std::ostream& output(std::ostream& out) const; 00135 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00136 , const DVectorSlice& vs_rhs2, value_type beta) const; 00138 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00139 , const SpVectorSlice& sv_rhs2, value_type beta) const; 00141 void Vp_StPtMtV(DVectorSlice* vs_lhs, value_type alpha 00142 , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00143 , BLAS_Cpp::Transp M_rhs2_trans 00144 , const DVectorSlice& vs_rhs3, value_type beta) const; 00146 void Vp_StPtMtV(DVectorSlice* vs_lhs, value_type alpha 00147 , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00148 , BLAS_Cpp::Transp M_rhs2_trans 00149 , const SpVectorSlice& sv_rhs3, value_type beta) const; 00150 00151 private: 00152 00153 // ///////////////////////////// 00154 // Private data members 00155 00156 size_type m_; 00157 size_type n_; 00158 size_type kl_; 00159 size_type ku_; 00160 DMatrixSlice MB_; 00161 release_resource_ptr_t MB_release_resource_ptr_; 00162 00163 // ///////////////////////////// 00164 // Private member functions 00165 00166 void assert_initialized() const; 00167 00168 }; // end class MatrixGenBanded 00169 00170 // /////////////////////////////////////////////////////// 00171 // Inline members for MatrixGenBanded 00172 00173 inline 00174 size_type MatrixGenBanded::kl() const 00175 { 00176 return kl_; 00177 } 00178 00179 inline 00180 size_type MatrixGenBanded::ku() const 00181 { 00182 return ku_; 00183 } 00184 00185 inline 00186 DMatrixSlice& MatrixGenBanded::MB() 00187 { 00188 return MB_; 00189 } 00190 00191 inline 00192 const DMatrixSlice& MatrixGenBanded::MB() const 00193 { 00194 return MB_; 00195 } 00196 00197 } // end namespace ConstrainedOptPack 00198 00199 #endif // MATRIX_GEN_BANDED_H
1.7.4