Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Superludist2_OO.h
Go to the documentation of this file.
1 
2 // @HEADER
3 // ***********************************************************************
4 //
5 // Amesos: Direct Sparse Solver Package
6 // Copyright (2004) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // This library is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Lesser General Public License as
13 // published by the Free Software Foundation; either version 2.1 of the
14 // License, or (at your option) any later version.
15 //
16 // This library is distributed in the hope that it will be useful, but
17 // WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
24 // USA
25 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
26 //
27 // ***********************************************************************
28 // @HEADER
29 
30 #include "Amesos_ConfigDefs.h"
31 
32 #include "superlu_ddefs.h"
33 #include "supermatrix.h"
34 // SuperLU defines Reduce to be a macro in util.h, this conflicts with Reduce() in Epetra_MultiVector.h
35 #undef Reduce
36 
37 #ifndef _SUPERLUDIST2_OO_H_
38 #define _SUPERLUDIST2_OO_H_
39 
40 class Epetra_Comm;
41 class Epetra_BlockMap;
42 class Epetra_MultiVector;
43 class Epetra_RowMatrix;
44 #include "Epetra_LinearProblem.h"
46 #include "Epetra_Object.h"
48 
156 
157  public:
159 
171  Superludist2_OO(const Epetra_LinearProblem& LinearProblem);
172 
174 
176  virtual ~Superludist2_OO(void);
178 
180 
182 
185  void SetTrans( bool trans ) {
186  assert( trans == false) ;
187  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  SOLVEstruct_t SOLVEstruct;
280  int numprocs;
281  int nprow;
282  int npcol;
283  gridinfo_t grid; // SuperLU's grid information
284  superlu_options_t options;
285  SuperMatrix A;
286  ScalePermstruct_t ScalePermstruct;
287  SuperLUStat_t stat;
288  LUstruct_t LUstruct;
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 Superludist2_OO.cpp
296  int numrows ;
297 
298 };
299 
300 
301 #endif /* _SUPERLUDIST2_OO_H_ */
302 
SOLVEstruct_t SOLVEstruct
Epetra_LinearProblem * redistProblem
vector< double > Aval
bool GetTrans() const
Return the transpose flag.
virtual ~Superludist2_OO(void)
Superludist2_OO Destructor.
void SetTrans(bool trans)
Setting the transpose flag to true causes Solve() to compute A^t x = b.
double Condest() const
Returns the condition number estimate for the current problem, if one exists, returns -1...
vector< int > Ai
superlu_options_t options
ScalePermstruct_t ScalePermstruct
vector< int > Ap
Superludist2_OO(const Epetra_LinearProblem &LinearProblem)
Superludist2_OO Constructor.
const Epetra_LinearProblem * Problem_
LUstruct_t LUstruct
int Solve(bool Factor)
All computation is performed during the call to Solve()
Superludist2_OO: An object-oriented wrapper for Superludist.
SuperLUStat_t stat
int CheckInput() const
Prints a summary of solver parameters, performs simple sanity checks.
Epetra_LinearProblemRedistor * redistor