|
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 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 00038 // 00039 // *********************************************************************** 00040 // @HEADER 00041 00042 #ifndef MATRIX_WITH_OP_NONSINGULAR_AGGR_H 00043 #define MATRIX_WITH_OP_NONSINGULAR_AGGR_H 00044 00045 #include "AbstractLinAlgPack_MatrixOpNonsing.hpp" 00046 00047 namespace AbstractLinAlgPack { 00048 00054 class MatrixOpNonsingAggr 00055 : virtual public MatrixOpNonsing 00056 { 00057 public: 00058 00061 00063 typedef Teuchos::RCP<const MatrixOp> mwo_ptr_t; 00065 typedef Teuchos::RCP<const MatrixNonsing> mns_ptr_t; 00066 00068 00071 00073 MatrixOpNonsingAggr(); 00074 00077 MatrixOpNonsingAggr( 00078 const mwo_ptr_t &mwo 00079 ,BLAS_Cpp::Transp mwo_trans 00080 ,const mns_ptr_t &mns 00081 ,BLAS_Cpp::Transp mns_trans 00082 ); 00083 00088 void initialize( 00089 const mwo_ptr_t &mwo 00090 ,BLAS_Cpp::Transp mwo_trans 00091 ,const mns_ptr_t &mns 00092 ,BLAS_Cpp::Transp mns_trans 00093 ); 00094 00099 void set_uninitialized(); 00100 00102 00105 00107 const mwo_ptr_t& mwo() const; 00109 BLAS_Cpp::Transp mwo_trans() const; 00111 const mns_ptr_t& mns() const; 00113 BLAS_Cpp::Transp mns_trans() const; 00114 00116 00119 00121 size_type rows() const; 00123 size_type cols() const; 00125 size_type nz() const; 00126 00128 00131 00133 const VectorSpace& space_cols() const; 00135 const VectorSpace& space_rows() const; 00137 MatrixOp::mat_ptr_t sub_view(const Range1D& row_rng, const Range1D& col_rng) const; 00139 MatrixOp& operator=(const MatrixOp& M); 00141 std::ostream& output(std::ostream& out) const; 00142 00143 protected: 00144 00146 bool Mp_StM( 00147 MatrixOp* mwo_lhs, value_type alpha 00148 , BLAS_Cpp::Transp trans_rhs) const; 00150 bool Mp_StMtP( 00151 MatrixOp* mwo_lhs, value_type alpha 00152 , BLAS_Cpp::Transp M_trans 00153 , const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans 00154 ) const; 00156 bool Mp_StPtM( 00157 MatrixOp* mwo_lhs, value_type alpha 00158 , const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans 00159 , BLAS_Cpp::Transp M_trans 00160 ) const; 00162 bool Mp_StPtMtP( 00163 MatrixOp* mwo_lhs, value_type alpha 00164 ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00165 ,BLAS_Cpp::Transp M_trans 00166 ,const GenPermMatrixSlice& P_rhs2, BLAS_Cpp::Transp P_rhs2_trans 00167 ) const; 00169 void Vp_StMtV( 00170 VectorMutable* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00171 , const Vector& v_rhs2, value_type beta) const; 00173 void Vp_StMtV( 00174 VectorMutable* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00175 , const SpVectorSlice& sv_rhs2, value_type beta) const; 00177 void Vp_StPtMtV( 00178 VectorMutable* vs_lhs, value_type alpha 00179 , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00180 , BLAS_Cpp::Transp M_rhs2_trans 00181 , const Vector& v_rhs3, value_type beta) const; 00183 void Vp_StPtMtV( 00184 VectorMutable* vs_lhs, value_type alpha 00185 , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00186 , BLAS_Cpp::Transp M_rhs2_trans 00187 , const SpVectorSlice& sv_rhs3, value_type beta) const; 00189 value_type transVtMtV( 00190 const Vector& v_rhs1, BLAS_Cpp::Transp trans_rhs2 00191 , const Vector& v_rhs3) const; 00193 value_type transVtMtV( 00194 const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2 00195 , const SpVectorSlice& sv_rhs3) const; 00197 void syr2k( 00198 BLAS_Cpp::Transp M_trans, value_type alpha 00199 , const GenPermMatrixSlice& P1, BLAS_Cpp::Transp P1_trans 00200 , const GenPermMatrixSlice& P2, BLAS_Cpp::Transp P2_trans 00201 , value_type beta, MatrixSymOp* symwo_lhs ) const; 00203 bool Mp_StMtM( 00204 MatrixOp* mwo_lhs, value_type alpha 00205 , BLAS_Cpp::Transp trans_rhs1, const MatrixOp& mwo_rhs2 00206 , BLAS_Cpp::Transp trans_rhs2, value_type beta ) const; 00208 bool Mp_StMtM( 00209 MatrixOp* mwo_lhs, value_type alpha 00210 , const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1 00211 , BLAS_Cpp::Transp trans_rhs2, value_type beta ) const; 00213 bool syrk( 00214 BLAS_Cpp::Transp M_trans, value_type alpha 00215 , value_type beta, MatrixSymOp* sym_lhs ) const; 00216 00218 00221 00223 void V_InvMtV( 00224 VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00225 ,const Vector& v_rhs2) const; 00227 void V_InvMtV( 00228 VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00229 , const SpVectorSlice& sv_rhs2) const; 00231 value_type transVtInvMtV( 00232 const Vector& v_rhs1 00233 ,BLAS_Cpp::Transp trans_rhs2, const Vector& v_rhs3) const; 00235 value_type transVtInvMtV( 00236 const SpVectorSlice& sv_rhs1 00237 ,BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3) const; 00239 void M_StInvMtM( 00240 MatrixOp* m_lhs, value_type alpha 00241 ,BLAS_Cpp::Transp trans_rhs1 00242 ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2 00243 ) const; 00245 void M_StMtInvM( 00246 MatrixOp* m_lhs, value_type alpha 00247 ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1 00248 ,BLAS_Cpp::Transp trans_rhs2 00249 ) const; 00250 00252 00253 private: 00254 00255 #ifdef DOXYGEN_COMPILE 00256 MatrixOp *mwo; 00257 MatrixNonsing *mns; 00258 #else 00259 mwo_ptr_t mwo_; 00260 BLAS_Cpp::Transp mwo_trans_; 00261 mns_ptr_t mns_; 00262 BLAS_Cpp::Transp mns_trans_; 00263 #endif 00264 00265 }; // end class MatrixOpNonsingAggr 00266 00267 // //////////////////////////////////// 00268 // Inline members 00269 00270 inline 00271 const MatrixOpNonsingAggr::mwo_ptr_t& 00272 MatrixOpNonsingAggr::mwo() const 00273 { 00274 return mwo_; 00275 } 00276 00277 inline 00278 BLAS_Cpp::Transp MatrixOpNonsingAggr::mwo_trans() const 00279 { 00280 return mwo_trans_; 00281 } 00282 00283 inline 00284 const MatrixOpNonsingAggr::mns_ptr_t& 00285 MatrixOpNonsingAggr::mns() const 00286 { 00287 return mns_; 00288 } 00289 00290 inline 00291 BLAS_Cpp::Transp MatrixOpNonsingAggr::mns_trans() const 00292 { 00293 return mns_trans_; 00294 } 00295 00296 } // end namespace AbstractLinAlgPack 00297 00298 #endif // MATRIX_WITH_OP_NONSINGULAR_AGGR_H
1.7.6.1