AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
AbstractLinAlgPack_MatrixNonsingSerial.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 // 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 SLAP_MATRIX_NONSINGULAR_SERIAL_H
00043 #define SLAP_MATRIX_NONSINGULAR_SERIAL_H
00044 
00045 #include "AbstractLinAlgPack_Types.hpp"
00046 #include "AbstractLinAlgPack_MatrixNonsing.hpp"
00047 
00048 namespace AbstractLinAlgPack {
00049 
00059 class MatrixNonsingSerial
00060   : virtual public AbstractLinAlgPack::MatrixNonsing // doxygen needs full name
00061 {
00062 public:
00063 
00066 
00068   virtual void V_InvMtV(
00069     DVector* v_lhs, BLAS_Cpp::Transp trans_rhs1
00070     ,const DVectorSlice& vs_rhs2) const;
00072   virtual void V_InvMtV(
00073     DVectorSlice* vs_lhs, BLAS_Cpp::Transp trans_rhs1
00074     ,const DVectorSlice& vs_rhs2) const = 0;
00076   virtual void V_InvMtV(
00077     DVector* v_lhs, BLAS_Cpp::Transp trans_rhs1
00078     ,const SpVectorSlice& sv_rhs2) const;
00080   virtual void V_InvMtV(
00081     DVectorSlice* vs_lhs, BLAS_Cpp::Transp trans_rhs1
00082     ,const SpVectorSlice& sv_rhs2) const;
00084   virtual value_type transVtInvMtV(
00085     const DVectorSlice& vs_rhs1, BLAS_Cpp::Transp trans_rhs2, const DVectorSlice& vs_rhs3) const;
00087   virtual value_type transVtInvMtV(
00088     const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3) const;
00089 
00090   //    end Level-2 BLAS
00092 
00095 
00097   virtual void M_StInvMtM(
00098     DMatrix* gm_lhs, value_type alpha
00099     ,BLAS_Cpp::Transp trans_rhs1
00100     ,const DMatrixSlice& gms_rhs2, BLAS_Cpp::Transp trans_rhs2 ) const;
00102   virtual void M_StInvMtM(
00103     DMatrixSlice* gms_lhs, value_type alpha
00104     ,BLAS_Cpp::Transp trans_rhs1
00105     ,const DMatrixSlice& gms_rhs2, BLAS_Cpp::Transp trans_rhs2 ) const;
00107   virtual void M_StMtInvM(
00108     DMatrix* gm_lhs, value_type alpha
00109     ,const DMatrixSlice& gms_rhs1, BLAS_Cpp::Transp trans_rhs1
00110     ,BLAS_Cpp::Transp trans_rhs2 ) const;
00112   virtual void M_StMtInvM(
00113     DMatrixSlice* gms_lhs, value_type alpha
00114     ,const DMatrixSlice& gms_rhs1, BLAS_Cpp::Transp trans_rhs1
00115     ,BLAS_Cpp::Transp trans_rhs2 ) const;
00117   virtual void M_StInvMtM(
00118     DMatrix* gm_lhs, value_type alpha
00119     ,BLAS_Cpp::Transp trans_rhs1
00120     ,const MatrixOpSerial& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2 ) const;
00122   virtual void M_StInvMtM(
00123     DMatrixSlice* gms_lhs, value_type alpha
00124     ,BLAS_Cpp::Transp trans_rhs1
00125     ,const MatrixOpSerial& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2 ) const;
00127   virtual void M_StMtInvM(
00128     DMatrix* gm_lhs, value_type alpha
00129     ,const MatrixOpSerial& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00130     ,BLAS_Cpp::Transp trans_rhs2 ) const;
00132   virtual void M_StMtInvM(
00133     DMatrixSlice* gms_lhs, value_type alpha
00134     ,const MatrixOpSerial& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00135     ,BLAS_Cpp::Transp trans_rhs2 ) const;
00136 
00137   //    end Level-3 BLAS
00139 
00142 
00144   void V_InvMtV(
00145     VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1
00146     ,const Vector& v_rhs2) const;
00148   void V_InvMtV(
00149     VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1
00150     ,const SpVectorSlice& sv_rhs2) const;
00152   value_type transVtInvMtV(
00153     const Vector& v_rhs1
00154     ,BLAS_Cpp::Transp trans_rhs2
00155     ,const Vector& v_rhs3) const;
00157   void M_StInvMtM(
00158     MatrixOp* m_lhs, value_type alpha
00159     ,BLAS_Cpp::Transp trans_rhs1
00160     ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00161     ) const;
00163   void M_StMtInvM(
00164     MatrixOp* m_lhs, value_type alpha
00165     ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00166     ,BLAS_Cpp::Transp trans_rhs2
00167     ) const;
00168 
00170 
00171 };  // end class MatrixNonsingSerial
00172 
00179 
00182 
00184 inline void V_InvMtV(DVector* v_lhs, const MatrixNonsingSerial& M_rhs1
00185   , BLAS_Cpp::Transp trans_rhs1, const DVectorSlice& vs_rhs2)
00186 {
00187   M_rhs1.V_InvMtV(v_lhs,trans_rhs1,vs_rhs2);
00188 }
00189 
00191 inline void V_InvMtV(DVectorSlice* vs_lhs, const MatrixNonsingSerial& M_rhs1
00192   , BLAS_Cpp::Transp trans_rhs1, const DVectorSlice& vs_rhs2)
00193 {
00194   M_rhs1.V_InvMtV(vs_lhs,trans_rhs1,vs_rhs2);
00195 }
00196 
00198 inline void V_InvMtV(DVector* v_lhs, const MatrixNonsingSerial& M_rhs1
00199   , BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice& sv_rhs2)
00200 {
00201   M_rhs1.V_InvMtV(v_lhs,trans_rhs1,sv_rhs2);
00202 }
00203 
00205 inline void V_InvMtV(DVectorSlice* vs_lhs, const MatrixNonsingSerial& M_rhs1
00206   , BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice& sv_rhs2)
00207 {
00208   M_rhs1.V_InvMtV(vs_lhs,trans_rhs1,sv_rhs2);
00209 }
00210 
00212 inline value_type transVtInvMtV(const DVectorSlice& vs_rhs1, const MatrixNonsingSerial& M_rhs2
00213   , BLAS_Cpp::Transp trans_rhs2, const DVectorSlice& sv_rhs3)
00214 {
00215   return M_rhs2.transVtInvMtV(vs_rhs1,trans_rhs2,sv_rhs3);
00216 }
00217 
00219 inline value_type transVtInvMtV(const SpVectorSlice& sv_rhs1, const MatrixNonsingSerial& M_rhs2
00220   , BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice& sv_rhs3)
00221 {
00222   return M_rhs2.transVtInvMtV(sv_rhs1,trans_rhs2,sv_rhs3);
00223 }
00224 
00225 //    end Level-2 BLAS
00227 
00230 
00232 inline void M_StInvMtM(
00233   DMatrix* gm_lhs, value_type alpha
00234   ,const MatrixNonsingSerial& M_rhs1,   BLAS_Cpp::Transp trans_rhs1
00235   ,const DMatrixSlice&          gms_rhs2, BLAS_Cpp::Transp trans_rhs2
00236   )
00237 {
00238   M_rhs1.M_StInvMtM(gm_lhs,alpha,trans_rhs1,gms_rhs2,trans_rhs2);
00239 }
00240 
00242 inline void M_StInvMtM(
00243   DMatrixSlice* gms_lhs, value_type alpha
00244   ,const MatrixNonsingSerial& M_rhs1,   BLAS_Cpp::Transp trans_rhs1
00245   ,const DMatrixSlice&          gms_rhs2, BLAS_Cpp::Transp trans_rhs2
00246   )
00247 {
00248   M_rhs1.M_StInvMtM(gms_lhs,alpha,trans_rhs1,gms_rhs2,trans_rhs2);
00249 }
00250 
00252 inline void M_StMtInvM(
00253   DMatrix* gm_lhs, value_type alpha
00254   ,const DMatrixSlice&          gms_rhs1, BLAS_Cpp::Transp trans_rhs1
00255   ,const MatrixNonsingSerial& M_rhs2,   BLAS_Cpp::Transp trans_rhs2
00256   )
00257 {
00258   M_rhs2.M_StMtInvM(gm_lhs,alpha,gms_rhs1,trans_rhs1,trans_rhs2);
00259 }
00260 
00262 inline void M_StMtInvM(
00263   DMatrixSlice* gms_lhs, value_type alpha
00264   ,const DMatrixSlice&          gms_rhs1, BLAS_Cpp::Transp trans_rhs1
00265   ,const MatrixNonsingSerial& M_rhs2,   BLAS_Cpp::Transp trans_rhs2
00266   )
00267 {
00268   M_rhs2.M_StMtInvM(gms_lhs,alpha,gms_rhs1,trans_rhs1,trans_rhs2);
00269 }
00270 
00272 inline void M_StInvMtM(
00273   DMatrix* gm_lhs, value_type alpha
00274   ,const MatrixNonsingSerial& M_rhs1,   BLAS_Cpp::Transp trans_rhs1
00275   ,const MatrixOpSerial&      mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00276   )
00277 {
00278   M_rhs1.M_StInvMtM(gm_lhs,alpha,trans_rhs1,mwo_rhs2,trans_rhs2);
00279 }
00280 
00282 inline void M_StInvMtM(
00283   DMatrixSlice* gms_lhs, value_type alpha
00284   ,const MatrixNonsingSerial& M_rhs1,   BLAS_Cpp::Transp trans_rhs1
00285   ,const MatrixOpSerial&      mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00286   )
00287 {
00288   M_rhs1.M_StInvMtM(gms_lhs,alpha,trans_rhs1,mwo_rhs2,trans_rhs2);
00289 }
00290 
00292 inline void M_StMtInvM(
00293   DMatrix* gm_lhs, value_type alpha
00294   ,const MatrixOpSerial&      mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00295   ,const MatrixNonsingSerial& M_rhs2,   BLAS_Cpp::Transp trans_rhs2
00296   )
00297 {
00298   M_rhs2.M_StMtInvM(gm_lhs,alpha,mwo_rhs1,trans_rhs1,trans_rhs2);
00299 }
00300 
00302 inline void M_StMtInvM(
00303   DMatrixSlice* gms_lhs, value_type alpha
00304   ,const MatrixOpSerial&      mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00305   ,const MatrixNonsingSerial& M_rhs2,   BLAS_Cpp::Transp trans_rhs2
00306   )
00307 {
00308   M_rhs2.M_StMtInvM(gms_lhs,alpha,mwo_rhs1,trans_rhs1,trans_rhs2);
00309 }
00310 
00311 //    end Level-3 BLAS
00313 
00314 //    end Inline non-member operation functions
00316 
00317 } // end namespace AbstractLinAlgPack
00318 
00319 #endif  // SLAP_MATRIX_NONSINGULAR_SERIAL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends