|
Amesos2 - Direct Sparse Solver Interfaces
Version of the Day
|
00001 // @HEADER 00002 // 00003 // *********************************************************************** 00004 // 00005 // Amesos2: Templated Direct Sparse Solver Package 00006 // Copyright 2011 Sandia Corporation 00007 // 00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00009 // the U.S. Government retains certain rights in this software. 00010 // 00011 // Redistribution and use in source and binary forms, with or without 00012 // modification, are permitted provided that the following conditions are 00013 // met: 00014 // 00015 // 1. Redistributions of source code must retain the above copyright 00016 // notice, this list of conditions and the following disclaimer. 00017 // 00018 // 2. Redistributions in binary form must reproduce the above copyright 00019 // notice, this list of conditions and the following disclaimer in the 00020 // documentation and/or other materials provided with the distribution. 00021 // 00022 // 3. Neither the name of the Corporation nor the names of the 00023 // contributors may be used to endorse or promote products derived from 00024 // this software without specific prior written permission. 00025 // 00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00037 // 00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00039 // 00040 // *********************************************************************** 00041 // 00042 // @HEADER 00043 00052 #ifndef AMESOS2_SOLVER_DECL_HPP 00053 #define AMESOS2_SOLVER_DECL_HPP 00054 00055 #include <Teuchos_Describable.hpp> 00056 #include <Teuchos_ParameterList.hpp> 00057 #include <Teuchos_RCP.hpp> 00058 #include <Teuchos_Comm.hpp> 00059 00060 #include "Amesos2_TypeDecl.hpp" 00061 #include "Amesos2_Status.hpp" 00062 00063 namespace Amesos2 { 00064 00065 00077 template <class Matrix, class Vector> 00078 class Solver : public Teuchos::Describable { 00079 00080 public: 00081 00082 typedef Solver<Matrix,Vector> type; 00083 00085 00086 00094 virtual type& preOrdering( void ) = 0; 00095 00096 00102 virtual type& symbolicFactorization( void ) = 0; 00103 00104 00117 virtual type& numericFactorization( void ) = 0; 00118 00119 00132 virtual void solve( void ) = 0; 00133 00134 00149 virtual void solve(const Teuchos::Ptr<Vector> X, 00150 const Teuchos::Ptr<const Vector> B) const = 0; 00151 00152 00167 virtual void solve(Vector* X, const Vector* B) const = 0; 00168 00170 00171 00188 virtual type& setParameters( const Teuchos::RCP<Teuchos::ParameterList> & parameterList ) = 0; 00189 00190 00195 virtual Teuchos::RCP<const Teuchos::ParameterList> getValidParameters( void ) const = 0; 00196 00198 00199 00223 virtual void setA( const Teuchos::RCP<const Matrix> a, EPhase keep_phase = CLEAN ) = 0; 00224 00244 virtual void setA( const Matrix* a, EPhase keep_phase = CLEAN ) = 0; 00245 00246 00248 virtual bool matrixShapeOK( void ) = 0; 00249 00250 00252 virtual void setX( const Teuchos::RCP<Vector> x ) = 0; 00253 00254 00256 virtual void setX( Vector* x ) = 0; 00257 00258 00260 virtual const Teuchos::RCP<Vector> getX( void ) = 0; 00261 00262 00264 virtual Vector* getXRaw( void ) = 0; 00265 00266 00268 virtual void setB( const Teuchos::RCP<const Vector> b ) = 0; 00269 00270 00272 virtual void setB( const Vector* b ) = 0; 00273 00274 00276 virtual const Teuchos::RCP<const Vector> getB( void ) = 0; 00277 00278 00280 virtual const Vector* getBRaw( void ) = 0; 00281 00282 00284 virtual Teuchos::RCP<const Teuchos::Comm<int> > getComm( void ) const = 0; 00285 00286 00288 virtual Status& getStatus() const = 0; 00289 00290 00292 virtual std::string name( void ) const = 0; 00293 00295 00296 00301 00302 virtual std::string description( void ) const = 0; 00303 00304 00307 virtual void describe( Teuchos::FancyOStream &out, 00308 const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default ) const = 0; 00309 00311 00312 00317 00318 virtual void printTiming( Teuchos::FancyOStream &out, 00319 const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default ) const = 0; 00320 00321 00330 virtual void getTiming( Teuchos::ParameterList& timingParameterList ) const = 0; 00331 00333 00334 }; // End class Solver 00335 00336 00337 } // end namespace Amesos2 00338 00339 #endif // AMESOS2_SOLVER_BASE_DECL_HPP
1.7.6.1