ConstrainedOptPack_MatrixHessianSuperBasic.hpp

Go to the documentation of this file.
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_HESSIAN_SUPER_BASIC_H
00030 #define MATRIX_HESSIAN_SUPER_BASIC_H
00031 
00032 #include <vector>
00033 
00034 #include "ConstrainedOptPack/src/ConstrainedOptPack_Types.hpp"
00035 #include "AbstractLinAlgPack/src/MatrixSymWithOpFactorized.hpp"
00036 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_GenPermMatrixSlice.hpp"
00037 #include "Miref_count_ptr.h"
00038 
00039 namespace ConstrainedOptPack {
00040 
00074 class MatrixHessianSuperBasic
00075   : public virtual MatrixSymOp
00076 {
00077 public:
00078 
00080   typedef Teuchos::RCP<const MatrixSymWithOpFactorized>
00081     B_RR_ptr_t;
00083   typedef Teuchos::RCP<const MatrixOp>
00084     B_RX_ptr_t;
00086   typedef Teuchos::RCP<const MatrixSymOp>
00087     B_XX_ptr_t;
00089   typedef std::vector<EBounds>
00090     bnd_fixed_t;
00091 
00094   MatrixHessianSuperBasic();
00095 
00159   virtual void initialize(
00160     size_type            n
00161     ,size_type           n_R
00162     ,const size_type     i_x_free[]
00163     ,const size_type     i_x_fixed[]
00164     ,const EBounds       bnd_fixed[]
00165     ,const B_RR_ptr_t&   B_RR_ptr
00166     ,const B_RX_ptr_t&   B_RX_ptr
00167     ,BLAS_Cpp::Transp    B_RX_trans
00168     ,const B_XX_ptr_t&   B_XX_ptr
00169     );
00170 
00173 
00175   const GenPermMatrixSlice& Q_R() const;
00177   const GenPermMatrixSlice& Q_X() const;
00179   const bnd_fixed_t& bnd_fixed() const;
00181   const B_RR_ptr_t& B_RR_ptr() const;
00183   const B_RX_ptr_t& B_RX_ptr() const;
00185   BLAS_Cpp::Transp B_RX_trans() const;
00187   const B_XX_ptr_t& B_XX_ptr() const;
00188 
00190 
00193 
00195   size_type rows() const;
00196 
00198 
00201 
00203   void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00204     , const DVectorSlice& vs_rhs2, value_type beta) const;
00206   void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00207     , const SpVectorSlice& sv_rhs2, value_type beta) const;
00209   void Vp_StPtMtV(DVectorSlice* vs_lhs, value_type alpha
00210     , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
00211     , BLAS_Cpp::Transp M_rhs2_trans
00212     , const DVectorSlice& sv_rhs3, value_type beta) const;
00214   value_type transVtMtV(const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2
00215     , const SpVectorSlice& sv_rhs3) const ;
00216 
00218 
00219 protected:
00220 
00222   void assert_initialized() const;
00223 
00224 private:
00225 
00226   // ///////////////////////////////////
00227   // Private types
00228 
00229   typedef std::vector<size_type>    row_i_t;
00230   typedef std::vector<size_type>    col_j_t;
00231   
00232   // ///////////////////////////////////
00233   // Private data members
00234 
00235   size_type               n_;
00236   size_type               n_R_;
00237   GenPermMatrixSlice    Q_R_;        // Sorted by row
00238   row_i_t         Q_R_row_i_;
00239   col_j_t         Q_R_col_j_;
00240   GenPermMatrixSlice    Q_X_;        // Sorted by row
00241   row_i_t         Q_X_row_i_;
00242   col_j_t         Q_X_col_j_;
00243   bnd_fixed_t             bnd_fixed_;
00244   B_RR_ptr_t              B_RR_ptr_;
00245   B_RX_ptr_t              B_RX_ptr_;
00246   BLAS_Cpp::Transp        B_RX_trans_;
00247   B_XX_ptr_t              B_XX_ptr_;
00248 
00249 }; // end class MatrixHessianSuperBasic
00250 
00251 // ////////////////////////////////////////////
00252 // Inline members for MatrixHessianSuperBasic
00253 
00254 inline
00255 const GenPermMatrixSlice& MatrixHessianSuperBasic::Q_R() const
00256 {
00257   assert_initialized();
00258   return Q_R_;
00259 }
00260 
00261 inline
00262 const GenPermMatrixSlice& MatrixHessianSuperBasic::Q_X() const
00263 {
00264   assert_initialized();
00265   return Q_X_;
00266 }
00267 
00268 inline
00269 const MatrixHessianSuperBasic::bnd_fixed_t&
00270 MatrixHessianSuperBasic::bnd_fixed() const
00271 {
00272   return bnd_fixed_;
00273 }
00274 
00275 inline
00276 const MatrixHessianSuperBasic::B_RR_ptr_t&
00277 MatrixHessianSuperBasic::B_RR_ptr() const
00278 {
00279   assert_initialized();
00280   return B_RR_ptr_;
00281 }
00282 
00283 inline
00284 const MatrixHessianSuperBasic::B_RX_ptr_t&
00285 MatrixHessianSuperBasic::B_RX_ptr() const{
00286   assert_initialized();
00287   return B_RX_ptr_;
00288 }
00289 
00290 inline
00291 BLAS_Cpp::Transp MatrixHessianSuperBasic::B_RX_trans() const
00292 {
00293   assert_initialized();
00294   return B_RX_trans_;
00295 }
00296 
00297 inline
00298 const MatrixHessianSuperBasic::B_XX_ptr_t&
00299 MatrixHessianSuperBasic::B_XX_ptr() const
00300 {
00301   assert_initialized();
00302   return B_XX_ptr_;
00303 }
00304 
00305 } // end namespace ConstrainedOptPack
00306 
00307 #endif // MATRIX_HESSIAN_SUPER_BASIC_H

Generated on Tue Jul 13 09:30:51 2010 for MOOCHO (Single Doxygen Collection) by  doxygen 1.4.7