Amesos Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
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
39class Epetra_Comm;
40class Epetra_BlockMap;
41class Epetra_MultiVector;
42class Epetra_RowMatrix;
43#include "Epetra_LinearProblem.h"
44#include "Epetra_LinearProblemRedistor.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 //
255 const Epetra_LinearProblem * Problem_;
256 Epetra_LinearProblemRedistor *redistor;
257 Epetra_LinearProblem *redistProblem;
258 //
259 // Here are the values returned by ExtractHbData
260 //
261 int M,N,nz;
262 int *ptr, *ind;
263 double *val, *rhs, *lhs;
265
266
270 //
271 // Here are the SuperLU data structures for A, L and U:
272 //
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: An object-oriented wrapper for Xiaoye Li's Superludist.
void SetTrans(bool trans)
Setting the transpose flag to true causes Solve() to compute A^t x = b.
vector< int > Ap
virtual ~SuperludistOO(void)
SuperludistOO Destructor.
vector< int > Ai
int Solve(bool Factor)
All computation is performed during the call to Solve()
bool GetTrans() const
Return the transpose flag.
SuperMatrix A
bool FirstCallToSolve_
LUstruct_t LUstruct
ScalePermstruct_t ScalePermstruct
gridinfo_t grid
Epetra_LinearProblem * redistProblem
const Epetra_LinearProblem * Problem_
Epetra_LinearProblemRedistor * redistor
double Condest() const
Returns the condition number estimate for the current problem, if one exists, returns -1....
SuperLUStat_t stat
int CheckInput() const
Prints a summary of solver parameters, performs simple sanity checks.
vector< double > Aval
superlu_options_t options