AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AbstractLinAlgPack_DirectSparseSolverSuperLU.hpp
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 #ifdef SPARSE_SOLVER_PACK_USE_SUPERLU
43 
44 #ifndef DIRECT_SPARSE_SOLVER_SUPERLU_H
45 #define DIRECT_SPARSE_SOLVER_SUPERLU_H
46 
47 #include <valarray>
48 #include <vector>
49 #include <string>
50 
51 #include "AbstractLinAlgPack_DirectSparseSolverImp.hpp"
52 #include "AbstractLinAlgPack_SuperLUSolver.hpp"
53 #include "DenseLinAlgPack_DVectorClass.hpp"
54 #include "DenseLinAlgPack_IVector.hpp"
56 
57 namespace AbstractLinAlgPack {
58 
63 class DirectSparseSolverSuperLU : public DirectSparseSolverImp {
64 public:
65 
68 
69  // ToDo: Fill these in!
70 
72 
75 
77  DirectSparseSolverSuperLU();
78 
80 
83 
85  const basis_matrix_factory_ptr_t basis_matrix_factory() const;
87  void estimated_fillin_ratio( value_type estimated_fillin_ratio );
88 
90 
91 protected:
92 
95 
98  class BasisMatrixSuperLU : public BasisMatrixImp {
99  public:
100 
103 
105  Teuchos::RCP<BasisMatrixImp> create_matrix() const;
107  void V_InvMtV(
108  VectorMutable* v_lhs, BLAS_Cpp::Transp trans_rhs1
109  ,const Vector& v_rhs2) const ;
110 
112 
113  }; // end class BasisMatrixSuperLU
114 
117  class FactorizationStructureSuperLU : public FactorizationStructure {
118  public:
119  friend class DirectSparseSolverSuperLU;
120  friend class BasisMatrixSuperLU;
121  private:
123  superlu_solver_;
125  fact_struct_;
126  FactorizationStructureSuperLU();
127  }; // end class FactorizationStructureSuperLU
128 
131  class FactorizationNonzerosSuperLU : public FactorizationNonzeros {
132  public:
133  friend class DirectSparseSolverSuperLU;
134  friend class BasisMatrixSuperLU;
135  private:
137  fact_nonzeros_;
138  }; // end class FactorizationNonzerosSuperLU
139 
141 
144 
146  const Teuchos::RCP<FactorizationStructure> create_fact_struc() const;
148  const Teuchos::RCP<FactorizationNonzeros> create_fact_nonzeros() const;
150  void imp_analyze_and_factor(
152  ,FactorizationStructure *fact_struc
153  ,FactorizationNonzeros *fact_nonzeros
154  ,DenseLinAlgPack::IVector *row_perm
155  ,DenseLinAlgPack::IVector *col_perm
156  ,size_type *rank
157  ,std::ostream *out
158  );
160  void imp_factor(
162  ,const FactorizationStructure &fact_struc
163  ,FactorizationNonzeros *fact_nonzeros
164  ,std::ostream *out
165  );
166 
168 
169 private:
170 
171  // /////////////////////////////////
172  // Private data members
173 
174  // ////////////////////////////////
175  // Private member functions
176 
177 }; // end class DirectSparseSolverSuperLU
178 
179 // ////////////////////////////////////////
180 // Inline members
181 
182 } // end namespace AbstractLinAlgPack
183 
184 #endif // DIRECT_SPARSE_SOLVER_SUPERLU_H
185 
186 #endif // SPARSE_SOLVER_PACK_USE_SUPERLU
Mix-in interface for extracing explicit elements from a sparse matrix in one of several Fortran compa...
size_t size_type
void V_InvMtV(VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
v_lhs = inv(op(M_rhs1)) * v_rhs2
Transp