Amesos2 - Direct Sparse Solver Interfaces Version of the Day
Amesos2_Status.hpp
Go to the documentation of this file.
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_STATUS_HPP
00053 #define AMESOS2_STATUS_HPP
00054 
00055 #include <Teuchos_ParameterList.hpp>
00056 #include <Teuchos_RCP.hpp>
00057 #include <Teuchos_Comm.hpp>
00058 
00059 #include "Amesos2_TypeDecl.hpp"
00060 
00061 namespace Amesos2 {
00062 
00063   template < template <class,class> class ConcreteSolver, class Matrix, class Vector > class SolverCore;
00064 
00073   class Status {
00074   public:
00075     template < template <class,class> class ConcreteSolver, class Matrix, class Vector >
00076     friend class SolverCore;
00077 
00078     Status()
00079       : numPreOrder_(0)
00080       , numSymbolicFact_(0)
00081       , numNumericFact_(0)
00082       , numSolve_(0)
00083 
00084       , last_phase_(CLEAN)
00085 
00086       , lu_nnz_(0)
00087     { }
00088 
00089 
00091     ~Status() { };
00092 
00094     inline int getNumPreOrder() const
00095     { return( numPreOrder_ ); }
00096 
00098     inline int getNumSymbolicFact() const
00099     { return( numSymbolicFact_ ); }
00100 
00102     inline int getNumNumericFact() const
00103     { return( numNumericFact_ ); }
00104 
00106     inline int getNumSolve() const
00107     { return( numSolve_ ); }
00108 
00110     inline bool preOrderingDone() const
00111     { return( last_phase_ >= PREORDERING ); }
00112 
00114     inline bool symbolicFactorizationDone() const
00115     { return( last_phase_ >= SYMBFACT ); }
00116 
00118     inline bool numericFactorizationDone() const
00119     { return( last_phase_ >= NUMFACT ); }
00120 
00127     inline size_t getNnzLU() const
00128     { return( lu_nnz_ ); }
00129 
00130 
00131   private:
00132 
00134     int numPreOrder_;
00135 
00137     int numSymbolicFact_;
00138 
00140     int numNumericFact_;
00141 
00143     int numSolve_;
00144 
00146     EPhase last_phase_;
00147 
00149     size_t lu_nnz_;
00150 
00151   };                              // end class Amesos2::Status
00152 
00153 
00154 } // end namespace Amesos2
00155 
00156 #endif  // AMESOS2_STATUS_HPP