Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
const Epetra_LinearProblem * Problem_
Epetra_LinearProblem * redistProblem
double Condest() const
Returns the condition number estimate for the current problem, if one exists, returns -1...
SuperludistOO: An object-oriented wrapper for Xiaoye Li&#39;s Superludist.
SuperMatrix A
superlu_options_t options
bool GetTrans() const
Return the transpose flag.
vector< int > Ap
ScalePermstruct_t ScalePermstruct
vector< double > Aval
vector< int > Ai
gridinfo_t grid
SuperludistOO(const Epetra_LinearProblem &LinearProblem)
SuperludistOO Constructor.
virtual ~SuperludistOO(void)
SuperludistOO Destructor.
SuperLUStat_t stat
int CheckInput() const
Prints a summary of solver parameters, performs simple sanity checks.
int Solve(bool Factor)
All computation is performed during the call to Solve()
bool FirstCallToSolve_
Epetra_LinearProblemRedistor * redistor
void SetTrans(bool trans)
Setting the transpose flag to true causes Solve() to compute A^t x = b.
LUstruct_t LUstruct