MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractLinAlgPack_DirectSparseSolver.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef ALAP_DIRECT_SPARSE_SOLVER_H
43 #define ALAP_DIRECT_SPARSE_SOLVER_H
44 
48 #include "Teuchos_RCP.hpp"
50 
51 namespace AbstractLinAlgPack {
52 
240 public:
241 
244 
252  public:
255  };
256 
264  public:
275  virtual const fact_struc_ptr_t& get_fact_struc() const = 0;
276  };
277 
279  typedef Teuchos::RCP<
281 
283  class UnsymmetricRankDeficientException : public std::logic_error
284  {public: UnsymmetricRankDeficientException (const std::string& what_arg)
285  : std::logic_error(what_arg) {}};
286 
288  class IncompatibleMatrixStructureException : public std::logic_error
289  {public: IncompatibleMatrixStructureException (const std::string& what_arg)
290  : std::logic_error(what_arg) {}};
291 
293  class InvalidObjectType : public std::logic_error
294  {public: InvalidObjectType (const std::string& what_arg)
295  : std::logic_error(what_arg) {}};
296 
298  class NoCurrentBasisException : public std::logic_error
299  {public: NoCurrentBasisException (const std::string& what_arg)
300  : std::logic_error(what_arg) {}};
301 
303  class FactorizationFailure : public std::logic_error
304  {public: FactorizationFailure (const std::string& what_arg)
305  : std::logic_error(what_arg) {}};
306 
308 
310  virtual ~DirectSparseSolver() {}
311 
314  virtual const basis_matrix_factory_ptr_t basis_matrix_factory() const = 0;
315 
327 
489  virtual void analyze_and_factor(
491  ,DenseLinAlgPack::IVector *row_perm
492  ,DenseLinAlgPack::IVector *col_perm
493  ,size_type *rank
494  ,BasisMatrix *basis_matrix
495  ,std::ostream *out = NULL
496  ) = 0;
497 
580  virtual void factor(
582  ,BasisMatrix *basis_matrix
583  ,const BasisMatrix::fact_struc_ptr_t &fact_struc = Teuchos::null
584  ,std::ostream *out = NULL
585  ) = 0;
586 
594  virtual const BasisMatrix::fact_struc_ptr_t& get_fact_struc() const = 0;
595 
602  virtual void set_uninitialized() = 0;
603 
604 }; // end class DirectSparseSolver
605 
606 } // end namespace AbstractLinAlgPack
607 
608 #endif // ALAP_DIRECT_SPARSE_SOLVER_H
Teuchos::RCP< const Teuchos::AbstractFactory< BasisMatrix > > basis_matrix_factory_ptr_t
virtual const fact_struc_ptr_t & get_fact_struc() const =0
Return a reference to a smart pointer to the object that represents the factorization structure...
Abstract class for objects that represent the factorized matrix and can be used to solve for differen...
virtual void set_uninitialized()=0
Release all allocated memory.
virtual void estimated_fillin_ratio(value_type estimated_fillin_ratio)=0
Set the estimate of the fill-in ratio of the factorization.
virtual const basis_matrix_factory_ptr_t basis_matrix_factory() const =0
Return a factory object that can create the basis matrix.
Mix-in interface for extracing explicit elements from a sparse matrix in one of several Fortran compa...
virtual void factor(const AbstractLinAlgPack::MatrixConvertToSparse &A, BasisMatrix *basis_matrix, const BasisMatrix::fact_struc_ptr_t &fact_struc=Teuchos::null, std::ostream *out=NULL)=0
Factor a matrix given its factorization structure.
std::ostream * out
virtual const BasisMatrix::fact_struc_ptr_t & get_fact_struc() const =0
Get a smart pointer object to the current factorization structure.
Abstract class for objects that represent the factorization structure of a particular matrix...
virtual void analyze_and_factor(const AbstractLinAlgPack::MatrixConvertToSparse &A, DenseLinAlgPack::IVector *row_perm, DenseLinAlgPack::IVector *col_perm, size_type *rank, BasisMatrix *basis_matrix, std::ostream *out=NULL)=0
Analyze and factor a matrix.
Abstract base class for all nonsingular polymorphic matrices that can solve for linear system with bu...
Abstract interface to serial direct sparse linear solvers.