|
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 MATRIX_SYM_DIAGONAL_STD_H 00030 #define MATRIX_SYM_DIAGONAL_STD_H 00031 00032 #include "AbstractLinAlgPack_MatrixSymInitDiag.hpp" 00033 #include "AbstractLinAlgPack_MatrixSymDiag.hpp" 00034 #include "AbstractLinAlgPack_VectorSpace.hpp" 00035 00036 namespace AbstractLinAlgPack { 00037 00044 class MatrixSymDiagStd 00045 : public virtual MatrixSymInitDiag 00046 , public virtual MatrixSymDiag 00047 { 00048 public: 00049 00052 class PostMod { 00053 public: 00054 PostMod(VectorSpace::space_ptr_t vectorSpace) 00055 : vectorSpace_(vectorSpace) {} 00056 00057 void initialize(MatrixSymDiagStd* matrix) const 00058 { matrix->initialize(vectorSpace_->create_member()); } 00059 00060 private: 00061 VectorSpace::space_ptr_t vectorSpace_; 00062 00063 }; // end PostMod 00064 00065 00068 00070 MatrixSymDiagStd( 00071 const VectorSpace::vec_mut_ptr_t& diag = Teuchos::null 00072 ,bool unique = true 00073 ); 00074 00082 void initialize( 00083 const VectorSpace::vec_mut_ptr_t& diag 00084 ,bool unique = true 00085 ); 00086 00088 00091 00100 VectorMutable& diag(); 00102 const VectorSpace::vec_mut_ptr_t& diag_ptr() const; 00104 bool unique() const; 00105 00107 00110 00112 size_type rows() const; 00114 size_type nz() const; 00115 00117 00120 00122 const VectorSpace& space_rows() const; 00124 const VectorSpace& space_cols() const; 00126 MatrixOp& operator=(const MatrixOp& mwo_rhs); 00133 bool Mp_StM(MatrixOp* g_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs) const; 00135 void Vp_StMtV(VectorMutable* v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00136 , const Vector& v_rhs2, value_type beta) const; 00138 void Vp_StMtV(VectorMutable* v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00139 , const SpVectorSlice& sv_rhs2, value_type beta) const; 00145 bool syrk( 00146 BLAS_Cpp::Transp M_trans 00147 ,value_type alpha 00148 ,value_type beta 00149 ,MatrixSymOp *sym_lhs 00150 ) const; 00151 00153 00156 00158 void V_InvMtV(VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00159 , const Vector& v_rhs2) const; 00161 void V_InvMtV(VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00162 , const SpVectorSlice& sv_rhs2) const; 00163 00165 00168 00170 void init_identity( const VectorSpace& space_diag, value_type alpha ); 00172 void init_diagonal( const Vector& diag ); 00173 00175 00178 00180 const Vector& diag() const; 00181 00183 00184 private: 00185 00186 VectorSpace::vec_mut_ptr_t diag_; 00187 bool unique_; 00188 00189 void copy_unique(); 00190 00191 }; // end class MatrixSymDiagStd 00192 00193 // //////////////////////////////////////// 00194 // Inline members 00195 00196 inline 00197 bool MatrixSymDiagStd::unique() const 00198 { 00199 return unique_; 00200 } 00201 00202 } // end namespace AbstractLinAlgPack 00203 00204 #endif // MATRIX_SYM_DIAGONAL_STD_H
1.7.4