Amesos Package Browser (Single Doxygen Collection) Development
SuperludistOO.h
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                Amesos: Direct Sparse Solver Package
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #include "Amesos_ConfigDefs.h"
00030 
00031 #include "superlu_ddefs.h"
00032 #include "supermatrix.h"
00033 //  SuperLU defines Reduce to be a macro in util.h, this conflicts with Reduce() in Epetra_MultiVector.h
00034 #undef Reduce
00035 
00036 #ifndef _SUPERLUDISTOO_H_
00037 #define _SUPERLUDISTOO_H_
00038 
00039 class Epetra_Comm;
00040 class Epetra_BlockMap;
00041 class Epetra_MultiVector;
00042 class Epetra_RowMatrix;
00043 #include "Epetra_LinearProblem.h"
00044 #include "Epetra_LinearProblemRedistor.h"
00045 #include "Epetra_Object.h"
00047 
00154 class SuperludistOO {
00155     
00156   public:
00158 
00159 
00170   SuperludistOO(const Epetra_LinearProblem& LinearProblem);
00171 
00173 
00175   virtual ~SuperludistOO(void);
00177 
00179 
00181   void SetTrans( bool trans ) { Transpose_ = trans ;} ; 
00182 
00183 
00185 
00186     
00188   bool GetTrans( ) const { return Transpose_ ;} ;
00189 
00191 
00194   int CheckInput() const ;
00195 
00197 
00199 
00231 
00233 
00235 
00237   double Condest() const;
00238 
00240 
00241 
00243 
00244 
00247   int Solve(bool Factor) ;
00248 
00250  protected:
00251 
00252   //
00253   //  These are not used in release 0.1
00254   //
00255   const Epetra_LinearProblem * Problem_;
00256   Epetra_LinearProblemRedistor *redistor;
00257   Epetra_LinearProblem *redistProblem;
00258   //
00259   //  Here are the values returned by ExtractHbData
00260   //
00261   int M,N,nz;
00262   int *ptr, *ind;
00263   double *val, *rhs, *lhs;
00264   int Nrhs, ldrhs, ldlhs;
00265   
00266 
00267   bool Transpose_ ;
00268   bool Factored_;
00269   bool FirstCallToSolve_;
00270   //
00271   //  Here are the SuperLU data structures for A, L and U:
00272   //
00273   int numprocs;
00274   int nprow;
00275   int npcol;
00276   gridinfo_t grid;                 // SuperLU's grid information
00277   superlu_options_t options;
00278   SuperMatrix A;
00279   ScalePermstruct_t ScalePermstruct;
00280   SuperLUStat_t stat;
00281   LUstruct_t LUstruct;
00282   double   *berr;
00283   vector <int> Ap;
00284   vector <int> Ai;
00285   vector <double> Aval;
00286   bool A_and_LU_built ;            // Tells us whether to free them 
00287 
00288 
00289   //  This is needed by the old SuperludistOO.cpp
00290   int numrows ; 
00291 
00292 };
00293 
00294 
00295 #endif /* _SUPERLUDISTOO_H_ */
00296 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines