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 #if defined(Amesos_SHOW_DEPRECATED_WARNINGS)
40 #ifdef __GNUC__
41 #warning "The Amesos package is deprecated"
42 #endif
43 #endif
44 
45 class Epetra_Comm;
46 class Epetra_BlockMap;
47 class Epetra_MultiVector;
48 class Epetra_RowMatrix;
49 #include "Epetra_LinearProblem.h"
51 #include "Epetra_Object.h"
53 
161 
162  public:
164 
176  SuperludistOO(const Epetra_LinearProblem& LinearProblem);
177 
179 
181  virtual ~SuperludistOO(void);
183 
185 
187  void SetTrans( bool trans ) { Transpose_ = trans ;} ;
188 
189 
191 
192 
194  bool GetTrans( ) const { return Transpose_ ;} ;
195 
197 
200  int CheckInput() const ;
201 
203 
205 
237 
239 
241 
243  double Condest() const;
244 
246 
247 
249 
253  int Solve(bool Factor) ;
254 
256  protected:
257 
258  //
259  // These are not used in release 0.1
260  //
264  //
265  // Here are the values returned by ExtractHbData
266  //
267  int M,N,nz;
268  int *ptr, *ind;
269  double *val, *rhs, *lhs;
270  int Nrhs, ldrhs, ldlhs;
271 
272 
273  bool Transpose_ ;
274  bool Factored_;
276  //
277  // Here are the SuperLU data structures for A, L and U:
278  //
279  int numprocs;
280  int nprow;
281  int npcol;
282  gridinfo_t grid; // SuperLU's grid information
283  superlu_options_t options;
284  SuperMatrix A;
285  ScalePermstruct_t ScalePermstruct;
286  SuperLUStat_t stat;
287  LUstruct_t LUstruct;
288  double *berr;
289  vector <int> Ap;
290  vector <int> Ai;
291  vector <double> Aval;
292  bool A_and_LU_built ; // Tells us whether to free them
293 
294 
295  // This is needed by the old SuperludistOO.cpp
296  int numrows ;
297 
298 };
299 
300 
301 #endif /* _SUPERLUDISTOO_H_ */
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