|
ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization
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_SYM_HESSIAN_RELAX_NON_SING_H 00043 #define MATRIX_SYM_HESSIAN_RELAX_NON_SING_H 00044 00045 #include "ConstrainedOptPack_Types.hpp" 00046 #include "AbstractLinAlgPack_MatrixSymDiagStd.hpp" 00047 #include "Teuchos_RCP.hpp" 00048 00049 namespace ConstrainedOptPack { 00050 00062 class MatrixSymHessianRelaxNonSing 00063 : public AbstractLinAlgPack::MatrixSymOpNonsing 00064 { 00065 public: 00066 00068 typedef Teuchos::RCP<const MatrixSymOpNonsing> G_ptr_t; 00070 typedef Teuchos::RCP<VectorMutable> vec_mut_ptr_t; 00072 typedef Teuchos::RCP<const VectorSpace> space_ptr_t; 00073 00076 00086 MatrixSymHessianRelaxNonSing(); 00087 00090 MatrixSymHessianRelaxNonSing( 00091 const G_ptr_t &G_ptr 00092 ,const vec_mut_ptr_t &M_diag_ptr 00093 ,const space_ptr_t &space = Teuchos::null 00094 ); 00095 00124 void initialize( 00125 const G_ptr_t &G_ptr 00126 ,const vec_mut_ptr_t &M_diag_ptr 00127 ,const space_ptr_t &space = Teuchos::null 00128 ); 00129 00133 void set_uninitialized(); 00134 00136 const G_ptr_t& G_ptr() const; 00137 00139 const vec_mut_ptr_t& M_diag_ptr() const; 00140 00142 const MatrixSymOpNonsing& G() const; 00143 00145 const AbstractLinAlgPack::MatrixSymDiagStd& M() const; 00146 00148 00151 00153 const VectorSpace& space_cols() const; 00155 bool Mp_StM( 00156 MatrixOp* mwo_lhs, value_type alpha 00157 , BLAS_Cpp::Transp trans_rhs) const; 00159 void Vp_StMtV( 00160 VectorMutable* v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00161 ,const Vector& v_rhs2, value_type beta) const; 00163 void Vp_StMtV( 00164 VectorMutable* v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1 00165 ,const SpVectorSlice& sv_rhs2, value_type beta) const; 00167 void Vp_StPtMtV( 00168 VectorMutable* v_lhs, value_type alpha 00169 ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00170 ,BLAS_Cpp::Transp M_rhs2_trans 00171 ,const Vector& v_rhs3, value_type beta) const; 00173 void Vp_StPtMtV( 00174 VectorMutable* v_lhs, value_type alpha 00175 ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans 00176 ,BLAS_Cpp::Transp M_rhs2_trans 00177 ,const SpVectorSlice& sv_rhs3, value_type beta) const; 00178 00180 00183 00185 void Mp_StPtMtP( 00186 MatrixSymOp* sym_lhs, value_type alpha 00187 ,EMatRhsPlaceHolder dummy_place_holder 00188 ,const GenPermMatrixSlice& gpms_rhs, BLAS_Cpp::Transp gpms_rhs_trans 00189 ,value_type beta 00190 ) const; 00191 00193 00196 00198 void V_InvMtV( 00199 VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00200 ,const Vector& v_rhs2) const; 00202 void V_InvMtV( 00203 VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1 00204 ,const SpVectorSlice& sv_rhs2) const; 00205 00207 00208 private: 00209 00210 // /////////////////////////////// 00211 // Private data members 00212 00213 space_ptr_t vec_space_; 00214 G_ptr_t G_ptr_; 00215 MatrixSymDiagStd M_; 00216 00217 // /////////////////////////////// 00218 // Private member functions 00219 00220 void assert_initialized() const; 00221 00222 }; 00223 00224 // //////////////////////////////////// 00225 // Inline members 00226 00227 inline 00228 const MatrixSymHessianRelaxNonSing::G_ptr_t& 00229 MatrixSymHessianRelaxNonSing::G_ptr() const 00230 { 00231 return G_ptr_; 00232 } 00233 00234 inline 00235 const MatrixSymHessianRelaxNonSing::vec_mut_ptr_t& 00236 MatrixSymHessianRelaxNonSing::M_diag_ptr() const 00237 { 00238 return M_.diag_ptr(); 00239 } 00240 00241 inline 00242 const MatrixSymOpNonsing& 00243 MatrixSymHessianRelaxNonSing::G() const 00244 { 00245 assert_initialized(); 00246 return *G_ptr_; 00247 } 00248 00249 inline 00250 const MatrixSymDiagStd& 00251 MatrixSymHessianRelaxNonSing::M() const 00252 { 00253 assert_initialized(); 00254 return M_; 00255 } 00256 00257 } // end namespace ConstrainedOptPack 00258 00259 #endif // MATRIX_SYM_HESSIAN_RELAX_NON_SING_H
1.7.6.1