AbstractLinAlgPack_MatrixZero.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 ALAP_MATRIX_ZERO_H
00030 #define ALAP_MATRIX_ZERO_H
00031 
00032 #include "AbstractLinAlgPack_MatrixOp.hpp"
00033 #include "AbstractLinAlgPack_VectorSpace.hpp"
00034 
00035 namespace AbstractLinAlgPack {
00036 
00043 class MatrixZero : public MatrixOp {
00044 public:
00045 
00048 
00050   MatrixZero(
00051     const VectorSpace::space_ptr_t&     space_cols = Teuchos::null
00052     ,const VectorSpace::space_ptr_t&    space_rows = Teuchos::null
00053     );
00054 
00069   void initialize(
00070     const VectorSpace::space_ptr_t&    space_cols
00071     ,const VectorSpace::space_ptr_t&   space_rows
00072     );
00073 
00075 
00079   size_type rows() const;
00081   size_type cols() const;
00083   size_type nz() const;
00085 
00088 
00090   const VectorSpace& space_cols() const;
00092   const VectorSpace& space_rows() const;
00094   void zero_out();
00096   void Mt_S(value_type alpha);
00098   MatrixOp& operator=(const MatrixOp& M);
00100   std::ostream& output(std::ostream& out) const;
00102   bool Mp_StM(
00103     MatrixOp* mwo_lhs, value_type alpha
00104     ,BLAS_Cpp::Transp trans_rhs
00105     ) const;
00107   bool Mp_StMtP(
00108     MatrixOp* mwo_lhs, value_type alpha
00109     ,BLAS_Cpp::Transp M_trans
00110     ,const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans
00111     ) const;
00113   bool Mp_StPtM(
00114     MatrixOp* mwo_lhs, value_type alpha
00115     ,const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans
00116     ,BLAS_Cpp::Transp M_trans
00117     ) const;
00119   bool Mp_StPtMtP(
00120     MatrixOp* mwo_lhs, value_type alpha
00121     ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00122     ,BLAS_Cpp::Transp M_trans
00123     ,const GenPermMatrixSlice& P_rhs2, BLAS_Cpp::Transp P_rhs2_trans
00124     ) const;
00126   void Vp_StMtV(
00127     VectorMutable* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00128     ,const Vector& v_rhs2, value_type beta) const;
00130   void Vp_StMtV(
00131     VectorMutable* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00132     ,const SpVectorSlice& sv_rhs2, value_type beta) const;
00134   void Vp_StPtMtV(
00135     VectorMutable* vs_lhs, value_type alpha
00136     ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00137     ,BLAS_Cpp::Transp M_rhs2_trans
00138     ,const Vector& v_rhs3, value_type beta) const;
00140   void Vp_StPtMtV(
00141     VectorMutable* vs_lhs, value_type alpha
00142     ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00143     ,BLAS_Cpp::Transp M_rhs2_trans
00144     ,const SpVectorSlice& sv_rhs3, value_type beta) const;
00146   value_type transVtMtV(
00147     const Vector& v_rhs1, BLAS_Cpp::Transp trans_rhs2
00148     ,const Vector& v_rhs3) const;
00150   value_type transVtMtV(
00151     const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2
00152     , const SpVectorSlice& sv_rhs3) const;
00154   void syr2k(
00155      BLAS_Cpp::Transp M_trans, value_type alpha
00156     ,const GenPermMatrixSlice& P1, BLAS_Cpp::Transp P1_trans
00157     ,const GenPermMatrixSlice& P2, BLAS_Cpp::Transp P2_trans
00158     ,value_type beta, MatrixSymOp* symwo_lhs ) const;
00160   bool Mp_StMtM(
00161     MatrixOp* mwo_lhs, value_type alpha
00162     ,BLAS_Cpp::Transp trans_rhs1
00163     ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00164     ,value_type beta ) const;
00166   bool Mp_StMtM(
00167     MatrixOp* mwo_lhs, value_type alpha
00168     ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
00169     ,BLAS_Cpp::Transp trans_rhs2
00170     ,value_type beta ) const;
00172   bool syrk(
00173      BLAS_Cpp::Transp M_trans, value_type alpha
00174     ,value_type beta, MatrixSymOp* sym_lhs ) const;
00175 
00177 
00178 private:
00179 
00180   VectorSpace::space_ptr_t  space_cols_;
00181   VectorSpace::space_ptr_t  space_rows_;
00182 
00183   //
00184   void assert_initialized() const;
00185 
00186 }; // end class MatrixZero
00187 
00188 } // end namespace AbstractLinAlgPack
00189 
00190 #endif // ALAP_MATRIX_ZERO_H

Generated on Wed May 12 21:50:43 2010 for AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects by  doxygen 1.4.7