|
AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects 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 ABSTRACT_LINALG_PACK_MATRIX_NONSINGULAR_H 00030 #define ABSTRACT_LINALG_PACK_MATRIX_NONSINGULAR_H 00031 00032 #include "AbstractLinAlgPack_MatrixBase.hpp" 00033 #include "Teuchos_RCP.hpp" 00034 00035 namespace AbstractLinAlgPack { 00036 00084 class MatrixNonsing : public virtual MatrixBase { 00085 public: 00086 00089 00091 friend 00092 void V_InvMtV( 00093 VectorMutable* v_lhs, const MatrixNonsing& M_rhs1 00094 ,BLAS_Cpp::Transp trans_rhs1, const Vector& v_rhs2); 00096 friend 00097 void V_InvMtV( 00098 VectorMutable* v_lhs, const MatrixNonsing& M_rhs1 00099 ,BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice& sv_rhs2); 00101 friend 00102 value_type transVtInvMtV( 00103 const Vector& v_rhs1, const MatrixNonsing& M_rhs2 00104 ,BLAS_Cpp::Transp trans_rhs2, const Vector& v_rhs3); 00106 friend 00107 value_type transVtInvMtV( 00108 const SpVectorSlice& sv_rhs1, const MatrixNonsing& M_rhs2 00109 ,BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3); 00111 friend 00112 void M_StInvMtM( 00113 MatrixOp* m_lhs, value_type alpha 00114 ,const MatrixNonsing& M_rhs1, BLAS_Cpp::Transp trans_rhs1 00115 ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2 ); 00117 friend 00118 void M_StMtInvM( 00119 MatrixOp* m_lhs, value_type alpha 00120 ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1 00121 ,const MatrixNonsing& M_rhs2, BLAS_Cpp::Transp trans_rhs2 ); 00122 00124 00127 00128 #ifndef DOXYGEN_COMPILE 00129 00130 typedef Teuchos::RCP<const MatrixNonsing> mat_mns_ptr_t; 00132 typedef Teuchos::RCP<MatrixNonsing> mat_mns_mut_ptr_t; 00133 #endif 00134 00138 class SingularMatrix : public std::logic_error 00139 {public: SingularMatrix(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00140 00142 00145 00152 virtual mat_mns_mut_ptr_t clone_mns(); 00153 00162 virtual mat_mns_ptr_t clone_mns() const; 00163 00165 00168 00170 virtual void V_InvMtV( 00171 VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00172 ,const Vector& v_rhs2) const = 0; 00174 virtual void V_InvMtV( 00175 VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00176 , const SpVectorSlice& sv_rhs2) const; 00178 virtual value_type transVtInvMtV( 00179 const Vector& v_rhs1 00180 ,BLAS_Cpp::Transp trans_rhs2, const Vector& v_rhs3) const; 00182 virtual value_type transVtInvMtV( 00183 const SpVectorSlice& sv_rhs1 00184 ,BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3) const; 00185 00186 // end Level-2 BLAS 00188 00191 00200 virtual void M_StInvMtM( 00201 MatrixOp* m_lhs, value_type alpha 00202 ,BLAS_Cpp::Transp trans_rhs1 00203 ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2 00204 ) const; 00213 virtual void M_StMtInvM( 00214 MatrixOp* m_lhs, value_type alpha 00215 ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1 00216 ,BLAS_Cpp::Transp trans_rhs2 00217 ) const; 00218 00219 // end Level-3 BLAS 00221 00222 }; // end class MatrixNonsing 00223 00231 00233 //@ { 00234 00236 inline void V_InvMtV( 00237 VectorMutable* v_lhs, const MatrixNonsing& M_rhs1 00238 ,BLAS_Cpp::Transp trans_rhs1, const Vector& v_rhs2) 00239 { 00240 M_rhs1.V_InvMtV(v_lhs,trans_rhs1,v_rhs2); 00241 } 00242 00244 inline void V_InvMtV( 00245 VectorMutable* v_lhs, const MatrixNonsing& M_rhs1 00246 ,BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice& sv_rhs2) 00247 { 00248 M_rhs1.V_InvMtV(v_lhs,trans_rhs1,sv_rhs2); 00249 } 00250 00252 inline value_type transVtInvMtV( 00253 const Vector& v_rhs1, const MatrixNonsing& M_rhs2 00254 ,BLAS_Cpp::Transp trans_rhs2, const Vector& v_rhs3) 00255 { 00256 return M_rhs2.transVtInvMtV(v_rhs1,trans_rhs2,v_rhs3); 00257 } 00258 00260 inline value_type transVtInvMtV( 00261 const SpVectorSlice& sv_rhs1, const MatrixNonsing& M_rhs2 00262 ,BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3) 00263 { 00264 return M_rhs2.transVtInvMtV(sv_rhs1,trans_rhs2,sv_rhs3); 00265 } 00266 00267 // end Level-2 BLAS 00268 //@ } 00269 00271 //@ { 00272 00274 inline void M_StInvMtM( 00275 MatrixOp* m_lhs, value_type alpha 00276 ,const MatrixNonsing& M_rhs1, BLAS_Cpp::Transp trans_rhs1 00277 ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2 ) 00278 { 00279 M_rhs1.M_StInvMtM(m_lhs,alpha,trans_rhs1,mwo_rhs2,trans_rhs2); 00280 } 00281 00283 inline void M_StMtInvM( 00284 MatrixOp* m_lhs, value_type alpha 00285 ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1 00286 ,const MatrixNonsing& M_rhs2, BLAS_Cpp::Transp trans_rhs2 ) 00287 { 00288 M_rhs2.M_StMtInvM(m_lhs,alpha,mwo_rhs1,trans_rhs1,trans_rhs2); 00289 } 00290 00291 // end Level-3 BLAS 00292 //@ } 00293 00294 // end Inline non-member operation functions 00296 00297 } // end namespace AbstractLinAlgPack 00298 00299 #endif // ABSTRACT_LINALG_PACK_MATRIX_NONSINGULAR_H
1.7.4