AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
AbstractLinAlgPack_DirectSparseSolverSuperLU.hpp
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 #ifdef SPARSE_SOLVER_PACK_USE_SUPERLU
00030 
00031 #ifndef DIRECT_SPARSE_SOLVER_SUPERLU_H
00032 #define DIRECT_SPARSE_SOLVER_SUPERLU_H
00033 
00034 #include <valarray>
00035 #include <vector>
00036 #include <string>
00037 
00038 #include "AbstractLinAlgPack_DirectSparseSolverImp.hpp"
00039 #include "AbstractLinAlgPack_SuperLUSolver.hpp"
00040 #include "DenseLinAlgPack_DVectorClass.hpp"
00041 #include "DenseLinAlgPack_IVector.hpp"
00042 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00043 
00044 namespace AbstractLinAlgPack {
00045 
00050 class DirectSparseSolverSuperLU : public DirectSparseSolverImp {
00051 public:
00052 
00055 
00056   // ToDo: Fill these in!
00057 
00059 
00062 
00064   DirectSparseSolverSuperLU();
00065 
00067 
00070 
00072   const basis_matrix_factory_ptr_t basis_matrix_factory() const;
00074   void estimated_fillin_ratio( value_type estimated_fillin_ratio );
00075 
00077 
00078 protected:
00079 
00082 
00085   class BasisMatrixSuperLU : public BasisMatrixImp {
00086   public:
00087 
00090 
00092     Teuchos::RCP<BasisMatrixImp> create_matrix() const;
00094     void V_InvMtV(
00095       VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1
00096       ,const Vector& v_rhs2) const ;
00097     
00099 
00100   }; // end class BasisMatrixSuperLU
00101 
00104   class FactorizationStructureSuperLU : public FactorizationStructure {
00105   public:
00106     friend class DirectSparseSolverSuperLU;
00107     friend class BasisMatrixSuperLU;
00108   private:
00109     Teuchos::RCP<SuperLUPack::SuperLUSolver>
00110       superlu_solver_;
00111     Teuchos::RCP<SuperLUPack::SuperLUSolver::FactorizationStructure>
00112       fact_struct_;
00113     FactorizationStructureSuperLU();
00114   }; // end class FactorizationStructureSuperLU
00115 
00118   class FactorizationNonzerosSuperLU : public FactorizationNonzeros {
00119   public:
00120     friend class DirectSparseSolverSuperLU;
00121     friend class BasisMatrixSuperLU;
00122   private:
00123     Teuchos::RCP<SuperLUPack::SuperLUSolver::FactorizationNonzeros>
00124       fact_nonzeros_;
00125   }; // end class FactorizationNonzerosSuperLU
00126 
00128 
00131 
00133   const Teuchos::RCP<FactorizationStructure> create_fact_struc() const;
00135   const Teuchos::RCP<FactorizationNonzeros> create_fact_nonzeros() const;
00137   void imp_analyze_and_factor(
00138     const AbstractLinAlgPack::MatrixConvertToSparse   &A
00139     ,FactorizationStructure                         *fact_struc
00140     ,FactorizationNonzeros                          *fact_nonzeros
00141     ,DenseLinAlgPack::IVector                            *row_perm
00142     ,DenseLinAlgPack::IVector                            *col_perm
00143     ,size_type                                      *rank
00144     ,std::ostream                                   *out
00145     );
00147   void imp_factor(
00148     const AbstractLinAlgPack::MatrixConvertToSparse   &A
00149     ,const FactorizationStructure                   &fact_struc
00150     ,FactorizationNonzeros                          *fact_nonzeros
00151     ,std::ostream                                   *out
00152     );
00153 
00155 
00156 private:
00157 
00158   // /////////////////////////////////
00159   // Private data members
00160 
00161   // ////////////////////////////////
00162   // Private member functions
00163 
00164 };  // end class DirectSparseSolverSuperLU 
00165 
00166 // ////////////////////////////////////////
00167 // Inline members
00168 
00169 } // end namespace AbstractLinAlgPack 
00170 
00171 #endif  // DIRECT_SPARSE_SOLVER_SUPERLU_H
00172 
00173 #endif // SPARSE_SOLVER_PACK_USE_SUPERLU
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends