Amesos Package Browser (Single Doxygen Collection)  Development
SuperludistOO.h
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Amesos: Direct Sparse Solver Package
5 // Copyright (2004) 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 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
25 //
26 // ***********************************************************************
27 // @HEADER
28 
29 #include "Amesos_ConfigDefs.h"
30 
31 #include "superlu_ddefs.h"
32 #include "supermatrix.h"
33 // SuperLU defines Reduce to be a macro in util.h, this conflicts with Reduce() in Epetra_MultiVector.h
34 #undef Reduce
35 
36 #ifndef _SUPERLUDISTOO_H_
37 #define _SUPERLUDISTOO_H_
38 
39 class Epetra_Comm;
40 class Epetra_BlockMap;
41 class Epetra_MultiVector;
42 class Epetra_RowMatrix;
43 #include "Epetra_LinearProblem.h"
45 #include "Epetra_Object.h"
47 
155 
156  public:
158 
170  SuperludistOO(const Epetra_LinearProblem& LinearProblem);
171 
173 
175  virtual ~SuperludistOO(void);
177 
179 
181  void SetTrans( bool trans ) { Transpose_ = trans ;} ;
182 
183 
185 
186 
188  bool GetTrans( ) const { return Transpose_ ;} ;
189 
191 
194  int CheckInput() const ;
195 
197 
199 
231 
233 
235 
237  double Condest() const;
238 
240 
241 
243 
247  int Solve(bool Factor) ;
248 
250  protected:
251 
252  //
253  // These are not used in release 0.1
254  //
258  //
259  // Here are the values returned by ExtractHbData
260  //
261  int M,N,nz;
262  int *ptr, *ind;
263  double *val, *rhs, *lhs;
264  int Nrhs, ldrhs, ldlhs;
265 
266 
267  bool Transpose_ ;
268  bool Factored_;
270  //
271  // Here are the SuperLU data structures for A, L and U:
272  //
273  int numprocs;
274  int nprow;
275  int npcol;
276  gridinfo_t grid; // SuperLU's grid information
277  superlu_options_t options;
278  SuperMatrix A;
279  ScalePermstruct_t ScalePermstruct;
280  SuperLUStat_t stat;
281  LUstruct_t LUstruct;
282  double *berr;
283  vector <int> Ap;
284  vector <int> Ai;
285  vector <double> Aval;
286  bool A_and_LU_built ; // Tells us whether to free them
287 
288 
289  // This is needed by the old SuperludistOO.cpp
290  int numrows ;
291 
292 };
293 
294 
295 #endif /* _SUPERLUDISTOO_H_ */
296 
SuperludistOO::LUstruct
LUstruct_t LUstruct
Definition: SuperludistOO.h:281
SuperludistOO::ptr
int * ptr
Definition: SuperludistOO.h:262
SuperludistOO::redistor
Epetra_LinearProblemRedistor * redistor
Definition: SuperludistOO.h:256
SuperludistOO::SuperludistOO
SuperludistOO(const Epetra_LinearProblem &LinearProblem)
SuperludistOO Constructor.
Definition: SuperludistOO.cpp:84
SuperludistOO::ldrhs
int ldrhs
Definition: SuperludistOO.h:264
SuperludistOO::options
superlu_options_t options
Definition: SuperludistOO.h:277
SuperludistOO::grid
gridinfo_t grid
Definition: SuperludistOO.h:276
SuperludistOO::SetTrans
void SetTrans(bool trans)
Setting the transpose flag to true causes Solve() to compute A^t x = b.
Definition: SuperludistOO.h:181
SuperludistOO::lhs
double * lhs
Definition: SuperludistOO.h:263
SuperludistOO::Condest
double Condest() const
Returns the condition number estimate for the current problem, if one exists, returns -1....
SuperludistOO::berr
double * berr
Definition: SuperludistOO.h:282
Epetra_Comm
SuperludistOO::nprow
int nprow
Definition: SuperludistOO.h:274
SuperludistOO::Nrhs
int Nrhs
Definition: SuperludistOO.h:264
Epetra_LinearProblem.h
SuperludistOO::Solve
int Solve(bool Factor)
All computation is performed during the call to Solve()
Definition: SuperludistOO.cpp:170
SuperludistOO::ind
int * ind
Definition: SuperludistOO.h:262
SuperludistOO::npcol
int npcol
Definition: SuperludistOO.h:275
SuperludistOO::CheckInput
int CheckInput() const
Prints a summary of solver parameters, performs simple sanity checks.
SuperludistOO::FirstCallToSolve_
bool FirstCallToSolve_
Definition: SuperludistOO.h:269
Epetra_RowMatrix
SuperludistOO::ldlhs
int ldlhs
Definition: SuperludistOO.h:264
SuperludistOO::rhs
double * rhs
Definition: SuperludistOO.h:263
SuperludistOO::~SuperludistOO
virtual ~SuperludistOO(void)
SuperludistOO Destructor.
Definition: SuperludistOO.cpp:103
SuperludistOO::ScalePermstruct
ScalePermstruct_t ScalePermstruct
Definition: SuperludistOO.h:279
SuperludistOO::N
int N
Definition: SuperludistOO.h:261
SuperludistOO::Transpose_
bool Transpose_
Definition: SuperludistOO.h:267
Epetra_LinearProblem
SuperludistOO::stat
SuperLUStat_t stat
Definition: SuperludistOO.h:280
SuperludistOO::Factored_
bool Factored_
Definition: SuperludistOO.h:268
SuperludistOO::A
SuperMatrix A
Definition: SuperludistOO.h:278
SuperludistOO
SuperludistOO: An object-oriented wrapper for Xiaoye Li's Superludist.
Definition: SuperludistOO.h:154
Epetra_BlockMap
SuperludistOO::M
int M
Definition: SuperludistOO.h:261
SuperludistOO::val
double * val
Definition: SuperludistOO.h:263
Epetra_LinearProblemRedistor.h
SuperludistOO::nz
int nz
Definition: SuperludistOO.h:261
SuperludistOO::numprocs
int numprocs
Definition: SuperludistOO.h:273
Amesos_ConfigDefs.h
SuperludistOO::Aval
vector< double > Aval
Definition: SuperludistOO.h:285
Epetra_MultiVector
Epetra_LinearProblemRedistor
SuperludistOO::A_and_LU_built
bool A_and_LU_built
Definition: SuperludistOO.h:286
SuperludistOO::Ap
vector< int > Ap
Definition: SuperludistOO.h:283
SuperludistOO::Ai
vector< int > Ai
Definition: SuperludistOO.h:284
Epetra_Object.h
SuperludistOO::redistProblem
Epetra_LinearProblem * redistProblem
Definition: SuperludistOO.h:257
SuperludistOO::GetTrans
bool GetTrans() const
Return the transpose flag.
Definition: SuperludistOO.h:188
SuperludistOO::numrows
int numrows
Definition: SuperludistOO.h:290
SuperludistOO::Problem_
const Epetra_LinearProblem * Problem_
Definition: SuperludistOO.h:255