AbstractLinAlgPack_MatrixOpNonsingAggr.hpp

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_WITH_OP_NONSINGULAR_AGGR_H
00030 #define MATRIX_WITH_OP_NONSINGULAR_AGGR_H
00031 
00032 #include "AbstractLinAlgPack_MatrixOpNonsing.hpp"
00033 
00034 namespace AbstractLinAlgPack {
00035 
00041 class MatrixOpNonsingAggr
00042   : virtual public MatrixOpNonsing
00043 {
00044 public:
00045 
00048 
00050   typedef Teuchos::RefCountPtr<const MatrixOp>        mwo_ptr_t;
00052   typedef Teuchos::RefCountPtr<const MatrixNonsing>   mns_ptr_t;
00053 
00055 
00058 
00060   MatrixOpNonsingAggr();
00061 
00064   MatrixOpNonsingAggr(
00065     const mwo_ptr_t       &mwo
00066     ,BLAS_Cpp::Transp     mwo_trans
00067     ,const mns_ptr_t      &mns
00068     ,BLAS_Cpp::Transp     mns_trans
00069     );
00070 
00075   void initialize(
00076     const mwo_ptr_t       &mwo
00077     ,BLAS_Cpp::Transp     mwo_trans
00078     ,const mns_ptr_t      &mns
00079     ,BLAS_Cpp::Transp     mns_trans
00080     );
00081 
00086   void set_uninitialized();
00087 
00089   
00092 
00094   const mwo_ptr_t& mwo() const;
00096   BLAS_Cpp::Transp mwo_trans() const;
00098   const mns_ptr_t& mns() const;
00100   BLAS_Cpp::Transp mns_trans() const;
00101 
00103 
00106 
00108   size_type rows() const;
00110   size_type cols() const;
00112   size_type nz() const;
00113 
00115 
00118 
00120   const VectorSpace& space_cols() const;
00122   const VectorSpace& space_rows() const;
00124   MatrixOp::mat_ptr_t sub_view(const Range1D& row_rng, const Range1D& col_rng) const;
00126   MatrixOp& operator=(const MatrixOp& M);
00128   std::ostream& output(std::ostream& out) const;
00129 
00130 protected:
00131 
00133   bool Mp_StM(
00134     MatrixOp* mwo_lhs, value_type alpha
00135     , BLAS_Cpp::Transp trans_rhs) const;
00137   bool Mp_StMtP(
00138     MatrixOp* mwo_lhs, value_type alpha
00139     , BLAS_Cpp::Transp M_trans
00140     , const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans
00141     ) const;
00143   bool Mp_StPtM(
00144     MatrixOp* mwo_lhs, value_type alpha
00145     , const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans
00146     , BLAS_Cpp::Transp M_trans
00147     ) const;
00149   bool Mp_StPtMtP(
00150     MatrixOp* mwo_lhs, value_type alpha
00151     ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00152     ,BLAS_Cpp::Transp M_trans
00153     ,const GenPermMatrixSlice& P_rhs2, BLAS_Cpp::Transp P_rhs2_trans
00154     ) const;
00156   void Vp_StMtV(
00157     VectorMutable* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00158     , const Vector& v_rhs2, value_type beta) const;
00160   void Vp_StMtV(
00161     VectorMutable* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00162     , const SpVectorSlice& sv_rhs2, value_type beta) const;
00164   void Vp_StPtMtV(
00165     VectorMutable* vs_lhs, value_type alpha
00166     , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00167     , BLAS_Cpp::Transp M_rhs2_trans
00168     , const Vector& v_rhs3, value_type beta) const;
00170   void Vp_StPtMtV(
00171     VectorMutable* vs_lhs, value_type alpha
00172     , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00173     , BLAS_Cpp::Transp M_rhs2_trans
00174     , const SpVectorSlice& sv_rhs3, value_type beta) const;
00176   value_type transVtMtV(
00177     const Vector& v_rhs1, BLAS_Cpp::Transp trans_rhs2
00178     , const Vector& v_rhs3) const;
00180   value_type transVtMtV(
00181     const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2
00182     , const SpVectorSlice& sv_rhs3) const;
00184   void syr2k(
00185      BLAS_Cpp::Transp M_trans, value_type alpha
00186     , const GenPermMatrixSlice& P1, BLAS_Cpp::Transp P1_trans
00187     , const GenPermMatrixSlice& P2, BLAS_Cpp::Transp P2_trans
00188     , value_type beta, MatrixSymOp* symwo_lhs ) const;
00190   bool Mp_StMtM(
00191     MatrixOp* mwo_lhs, value_type alpha
00192     , BLAS_Cpp::Transp trans_rhs1, const MatrixOp& mwo_rhs2
00193     , BLAS_Cpp::Transp trans_rhs2, value_type beta ) const;
00195   bool Mp_StMtM(
00196     MatrixOp* mwo_lhs, value_type alpha
00197     , const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00198     , BLAS_Cpp::Transp trans_rhs2, value_type beta ) const;
00200   bool syrk(
00201      BLAS_Cpp::Transp M_trans, value_type alpha
00202     , value_type beta, MatrixSymOp* sym_lhs ) const;
00203   
00205 
00208 
00210   void V_InvMtV(
00211     VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1
00212     ,const Vector& v_rhs2) const;
00214   void V_InvMtV(
00215     VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1
00216     , const SpVectorSlice& sv_rhs2) const;
00218   value_type transVtInvMtV(
00219     const Vector& v_rhs1
00220     ,BLAS_Cpp::Transp trans_rhs2, const Vector& v_rhs3) const;
00222   value_type transVtInvMtV(
00223     const SpVectorSlice& sv_rhs1
00224     ,BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3) const;
00226   void M_StInvMtM(
00227     MatrixOp* m_lhs, value_type alpha
00228     ,BLAS_Cpp::Transp trans_rhs1
00229     ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00230     ) const;
00232   void M_StMtInvM(
00233     MatrixOp* m_lhs, value_type alpha
00234     ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00235     ,BLAS_Cpp::Transp trans_rhs2
00236     ) const;
00237 
00239 
00240 private:
00241 
00242 #ifdef DOXYGEN_COMPILE
00243   MatrixOp         *mwo;
00244   MatrixNonsing    *mns;
00245 #else
00246   mwo_ptr_t            mwo_;
00247   BLAS_Cpp::Transp     mwo_trans_;
00248   mns_ptr_t            mns_;
00249   BLAS_Cpp::Transp     mns_trans_;
00250 #endif
00251 
00252 }; // end class MatrixOpNonsingAggr
00253 
00254 // ////////////////////////////////////
00255 // Inline members
00256 
00257 inline
00258 const MatrixOpNonsingAggr::mwo_ptr_t&
00259 MatrixOpNonsingAggr::mwo() const
00260 {
00261   return mwo_;
00262 }
00263 
00264 inline
00265 BLAS_Cpp::Transp MatrixOpNonsingAggr::mwo_trans() const
00266 {
00267   return mwo_trans_;
00268 }
00269 
00270 inline
00271 const MatrixOpNonsingAggr::mns_ptr_t&
00272 MatrixOpNonsingAggr::mns() const
00273 {
00274   return mns_;
00275 }
00276 
00277 inline
00278 BLAS_Cpp::Transp MatrixOpNonsingAggr::mns_trans() const
00279 {
00280   return mns_trans_;
00281 }
00282 
00283 } // end namespace AbstractLinAlgPack
00284 
00285 #endif // MATRIX_WITH_OP_NONSINGULAR_AGGR_H

Generated on Thu Sep 18 12:33:51 2008 for AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects by doxygen 1.3.9.1