|
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 // 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 DECOMPOSITION_SYSTEM_H 00030 #define DECOMPOSITION_SYSTEM_H 00031 00032 #include <stdexcept> 00033 00034 #include "ConstrainedOptPack_Types.hpp" 00035 #include "AbstractLinAlgPack_VectorSpace.hpp" 00036 00037 namespace ConstrainedOptPack { 00038 00076 class DecompositionSystem { 00077 public: 00078 00081 00083 typedef Teuchos::RCP< 00084 const Teuchos::AbstractFactory<MatrixOpNonsing> > mat_nonsing_fcty_ptr_t; 00086 typedef Teuchos::RCP< 00087 const Teuchos::AbstractFactory<MatrixOp> > mat_fcty_ptr_t; 00089 class SingularDecomposition : public std::logic_error 00090 {public: SingularDecomposition(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00092 class InvalidMatrixType : public std::logic_error 00093 {public: InvalidMatrixType(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00095 class TestFailed : public std::runtime_error 00096 {public: TestFailed(const std::string& what_arg) : std::runtime_error(what_arg) {}}; 00098 enum EOutputLevel { 00099 PRINT_NONE = 0, 00100 PRINT_BASIC_INFO = 1, 00101 PRINT_MORE_INFO = 2, 00102 PRINT_VECTORS = 3, 00103 PRINT_EVERY_THING = 4 00104 }; 00106 enum ERunTests { RUN_TESTS, NO_TESTS }; 00108 enum EMatRelations { MATRICES_INDEP_IMPS, MATRICES_ALLOW_DEP_IMPS }; 00109 00111 00113 virtual ~DecompositionSystem() {} 00114 00117 00127 virtual size_type n() const; 00128 00135 virtual size_type m() const = 0; 00136 00146 virtual size_type r() const; 00147 00152 virtual Range1D equ_decomp() const; 00153 00159 virtual Range1D equ_undecomp() const; 00160 00162 00165 00173 virtual const VectorSpace::space_ptr_t space_range() const = 0; 00174 00182 virtual const VectorSpace::space_ptr_t space_null() const = 0; 00183 00185 00188 00191 virtual const mat_fcty_ptr_t factory_Z() const = 0; 00192 00195 virtual const mat_fcty_ptr_t factory_Y() const = 0; 00196 00199 virtual const mat_nonsing_fcty_ptr_t factory_R() const = 0; 00200 00203 virtual const mat_fcty_ptr_t factory_Uz() const = 0; 00204 00207 virtual const mat_fcty_ptr_t factory_Uy() const = 0; 00208 00210 00213 00338 virtual void update_decomp( 00339 std::ostream *out 00340 ,EOutputLevel olevel 00341 ,ERunTests test_what 00342 ,const MatrixOp &Gc 00343 ,MatrixOp *Z 00344 ,MatrixOp *Y 00345 ,MatrixOpNonsing *R 00346 ,MatrixOp *Uz 00347 ,MatrixOp *Vy 00348 ,EMatRelations mat_rel = MATRICES_INDEP_IMPS 00349 ) const = 0; 00350 00354 virtual void print_update_decomp( 00355 std::ostream& out, const std::string& leading_str ) const = 0; 00356 00358 00359 }; // end class DecompositionSystem 00360 00361 } // end namespace ConstrainedOptPack 00362 00363 #endif // DECOMPOSITION_SYSTEM_H
1.7.4