|
AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects 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 ALAP_DIRECT_SPARSE_SOLVER_H 00030 #define ALAP_DIRECT_SPARSE_SOLVER_H 00031 00032 #include "AbstractLinAlgPack_Types.hpp" 00033 #include "AbstractLinAlgPack_MatrixConvertToSparse.hpp" 00034 #include "AbstractLinAlgPack_MatrixNonsing.hpp" 00035 #include "Teuchos_RCP.hpp" 00036 #include "Teuchos_AbstractFactory.hpp" 00037 00038 namespace AbstractLinAlgPack { 00039 00226 class DirectSparseSolver { 00227 public: 00228 00231 00238 class FactorizationStructure { 00239 public: 00241 virtual ~FactorizationStructure() {} 00242 }; 00243 00250 class BasisMatrix : public AbstractLinAlgPack::MatrixNonsing { 00251 public: 00253 typedef Teuchos::RCP<FactorizationStructure> fact_struc_ptr_t; 00262 virtual const fact_struc_ptr_t& get_fact_struc() const = 0; 00263 }; 00264 00266 typedef Teuchos::RCP< 00267 const Teuchos::AbstractFactory<BasisMatrix> > basis_matrix_factory_ptr_t; 00268 00270 class UnsymmetricRankDeficientException : public std::logic_error 00271 {public: UnsymmetricRankDeficientException (const std::string& what_arg) 00272 : std::logic_error(what_arg) {}}; 00273 00275 class IncompatibleMatrixStructureException : public std::logic_error 00276 {public: IncompatibleMatrixStructureException (const std::string& what_arg) 00277 : std::logic_error(what_arg) {}}; 00278 00280 class InvalidObjectType : public std::logic_error 00281 {public: InvalidObjectType (const std::string& what_arg) 00282 : std::logic_error(what_arg) {}}; 00283 00285 class NoCurrentBasisException : public std::logic_error 00286 {public: NoCurrentBasisException (const std::string& what_arg) 00287 : std::logic_error(what_arg) {}}; 00288 00290 class FactorizationFailure : public std::logic_error 00291 {public: FactorizationFailure (const std::string& what_arg) 00292 : std::logic_error(what_arg) {}}; 00293 00295 00297 virtual ~DirectSparseSolver() {} 00298 00301 virtual const basis_matrix_factory_ptr_t basis_matrix_factory() const = 0; 00302 00313 virtual void estimated_fillin_ratio( value_type estimated_fillin_ratio ) = 0; 00314 00476 virtual void analyze_and_factor( 00477 const AbstractLinAlgPack::MatrixConvertToSparse &A 00478 ,DenseLinAlgPack::IVector *row_perm 00479 ,DenseLinAlgPack::IVector *col_perm 00480 ,size_type *rank 00481 ,BasisMatrix *basis_matrix 00482 ,std::ostream *out = NULL 00483 ) = 0; 00484 00567 virtual void factor( 00568 const AbstractLinAlgPack::MatrixConvertToSparse &A 00569 ,BasisMatrix *basis_matrix 00570 ,const BasisMatrix::fact_struc_ptr_t &fact_struc = Teuchos::null 00571 ,std::ostream *out = NULL 00572 ) = 0; 00573 00581 virtual const BasisMatrix::fact_struc_ptr_t& get_fact_struc() const = 0; 00582 00589 virtual void set_uninitialized() = 0; 00590 00591 }; // end class DirectSparseSolver 00592 00593 } // end namespace AbstractLinAlgPack 00594 00595 #endif // ALAP_DIRECT_SPARSE_SOLVER_H
1.7.4