Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_Dscpack.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 #ifndef AMESOS_DSCPACK_H
30 #define AMESOS_DSCPACK_H
31 
32 #if defined(Amesos_SHOW_DEPRECATED_WARNINGS)
33 #ifdef __GNUC__
34 #warning "The Amesos package is deprecated"
35 #endif
36 #endif
37 
38 #include "Amesos_ConfigDefs.h"
39 #include "Amesos_BaseSolver.h"
40 #include "Amesos_NoCopiable.h"
41 #include "Amesos_Utils.h"
42 #include "Amesos_Time.h"
43 #include "Amesos_Status.h"
44 #include "Amesos_Control.h"
45 #include "Epetra_LinearProblem.h"
46 #include "Epetra_Comm.h"
47 #include "Epetra_Import.h"
48 #include "Teuchos_RCP.hpp"
49 
50 // Amesos_Dscpack_Pimpl contains a pointer to the structure defined in
51 // dscmain.h. This prevents Amesos_Dscpack.h from having to include dscmain.h.
52 //
53 // Doxygen does not handle forward class references well.
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 class Amesos_Dscpack_Pimpl ;
56 #endif
57 
58 
60 
67  private Amesos_Time,
68  private Amesos_NoCopiable,
69  private Amesos_Utils,
70  private Amesos_Control,
71  private Amesos_Status {
72 
73 public:
74 
76 
84  Amesos_Dscpack(const Epetra_LinearProblem& LinearProblem );
85 
87 
89  ~Amesos_Dscpack(void);
91 
93 
94  int SymbolicFactorization() ;
95 
96  int NumericFactorization() ;
97 
98  int Solve();
99 
101 
102 
103  const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
104 
106 
109  bool MatrixShapeOK() const ;
110 
112  {
113  return(0);
114  }
115 
116  bool UseTranspose() const
117  {
118  return(false);
119  }
120 
121  const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
122 
124 
127 
130 
132  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
133 
135  void PrintTiming() const;
136 
138  void PrintStatus() const;
139 
141  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
142 
144 
145 private:
146 
147  const Epetra_Import& Importer() const
148  {
149  return(*Importer_.get());
150  }
151 
152  const Epetra_Map& DscRowMap() const
153  {
154  return(*DscRowMap_.get());
155  }
156 
157  const Epetra_Map& DscColMap() const
158  {
159  return(*DscColMap_.get());
160  }
161 
164 
167 
170 
172 
180 
187 
191 
193 
196 
197  // track memory (as reported by DSCPACK routines)
198  int TotalMemory_; // estimates of the total memory requirements
199  // for the factorization step as a
200  // whole number of Mbytes. As
201  // reported in the manual, this is a
202  // "fair" estimation, but not
203  // accurate at the last byte.
204 
205 
206 }; // class Amesos_Dscpack
207 #endif /* AMESOS_DSCPACK_H */
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:73
Amesos_Control: Container for some control variables.
RCP< Epetra_Map > DscColMap_
RCP< Epetra_Import > Importer_
const Epetra_Map & DscColMap() const
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
bool A_and_LU_built
Tells us whether to free them.
const Epetra_Import & Importer() const
Amesos_Dscpack: An object-oriented wrapper for Dscpack.
T * get() const
int SetUseTranspose(bool UseTranspose)
If set true, X will be set to the solution of AT X = B (not A X = B)
void PrintTiming() const
Prints timing information.
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:75
bool MatrixShapeOK() const
Returns true if DSCPACK can handle this matrix shape.
bool UseTranspose() const
Returns the current UseTranspose setting.
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:77
const Epetra_LinearProblem * Problem_
Pointer to the linear problem.
Teuchos::RCP< Amesos_Dscpack_Pimpl > PrivateDscpackData_
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:130
int PerformSymbolicFactorization()
Performs the symbolic factorization.
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:26
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int * GlobalStructNewColNum
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:56
Amesos_Dscpack(const Epetra_LinearProblem &LinearProblem)
Amesos_Dscpack Constructor.
~Amesos_Dscpack(void)
Amesos_Dscpack Destructor.
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list...
int Solve()
Solves A X = B (or AT x = B)
RCP< Epetra_Map > DscRowMap_
void PrintStatus() const
Prints information about the factorization and solution phases.
int PerformNumericFactorization()
Performs the numeric factorization.
int * GlobalStructNewNum
int NumSolve() const
Returns the number of solves performed by this object.
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =...
const Epetra_Map & DscRowMap() const
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:25