Amesos Package Browser (Single Doxygen Collection)  Development
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 #include "Amesos_ConfigDefs.h"
33 #include "Amesos_BaseSolver.h"
34 #include "Amesos_NoCopiable.h"
35 #include "Amesos_Utils.h"
36 #include "Amesos_Time.h"
37 #include "Amesos_Status.h"
38 #include "Amesos_Control.h"
39 #include "Epetra_LinearProblem.h"
40 #include "Epetra_Comm.h"
41 #include "Epetra_Import.h"
42 #include "Teuchos_RCP.hpp"
43 
44 // Amesos_Dscpack_Pimpl contains a pointer to the structure defined in
45 // dscmain.h. This prevents Amesos_Dscpack.h from having to include dscmain.h.
46 //
47 // Doxygen does not handle forward class references well.
48 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49 class Amesos_Dscpack_Pimpl ;
50 #endif
51 
52 
54 
61  private Amesos_Time,
62  private Amesos_NoCopiable,
63  private Amesos_Utils,
64  private Amesos_Control,
65  private Amesos_Status {
66 
67 public:
68 
70 
78  Amesos_Dscpack(const Epetra_LinearProblem& LinearProblem );
79 
81 
83  ~Amesos_Dscpack(void);
85 
87 
88  int SymbolicFactorization() ;
89 
90  int NumericFactorization() ;
91 
92  int Solve();
93 
95 
96 
97  const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
98 
100 
103  bool MatrixShapeOK() const ;
104 
106  {
107  return(0);
108  }
109 
110  bool UseTranspose() const
111  {
112  return(false);
113  }
114 
115  const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
116 
118 
121 
124 
126  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
127 
129  void PrintTiming() const;
130 
132  void PrintStatus() const;
133 
135  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
136 
138 
139 private:
140 
141  const Epetra_Import& Importer() const
142  {
143  return(*Importer_.get());
144  }
145 
146  const Epetra_Map& DscRowMap() const
147  {
148  return(*DscRowMap_.get());
149  }
150 
151  const Epetra_Map& DscColMap() const
152  {
153  return(*DscColMap_.get());
154  }
155 
158 
161 
164 
166 
174 
181 
185 
187 
190 
191  // track memory (as reported by DSCPACK routines)
192  int TotalMemory_; // estimates of the total memory requirements
193  // for the factorization step as a
194  // whole number of Mbytes. As
195  // reported in the manual, this is a
196  // "fair" estimation, but not
197  // accurate at the last byte.
198 
199 
200 }; // class Amesos_Dscpack
201 #endif /* AMESOS_DSCPACK_H */
Amesos_Dscpack::UseTranspose
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Amesos_Dscpack.h:110
Amesos_Dscpack::DscColMap
const Epetra_Map & DscColMap() const
Definition: Amesos_Dscpack.h:151
Teuchos_RCP.hpp
Amesos_Dscpack::SymFactTime_
int SymFactTime_
Definition: Amesos_Dscpack.h:189
Amesos_Status::NumSolve_
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:71
Amesos_NoCopiable.h
Amesos_Dscpack::SymbolicFactorization
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
Definition: Amesos_Dscpack.cpp:429
Amesos_NoCopiable
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =.
Definition: Amesos_NoCopiable.h:44
Amesos_Dscpack::PrintStatus
void PrintStatus() const
Prints information about the factorization and solution phases.
Definition: Amesos_Dscpack.cpp:550
Amesos_Dscpack::PrivateDscpackData_
Teuchos::RCP< Amesos_Dscpack_Pimpl > PrivateDscpackData_
Definition: Amesos_Dscpack.h:165
Amesos_BaseSolver
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Definition: Amesos_BaseSolver.h:223
Amesos_Dscpack::DscNumProcs
int DscNumProcs
Definition: Amesos_Dscpack.h:176
Amesos_Dscpack::NumGlobalCols
int NumGlobalCols
Definition: Amesos_Dscpack.h:178
Amesos_Dscpack::GlobalStructOwner
int * GlobalStructOwner
Definition: Amesos_Dscpack.h:172
Amesos_Dscpack::NumSolve
int NumSolve() const
Returns the number of solves performed by this object.
Definition: Amesos_Dscpack.h:126
Amesos_Dscpack::NumFactTime_
int NumFactTime_
Definition: Amesos_Dscpack.h:189
Amesos_Dscpack::Problem_
const Epetra_LinearProblem * Problem_
Pointer to the linear problem.
Definition: Amesos_Dscpack.h:163
Amesos_Dscpack::NumSymbolicFact
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
Definition: Amesos_Dscpack.h:120
Amesos_Status::NumSymbolicFact_
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:67
Amesos_Dscpack::GetProblem
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
Definition: Amesos_Dscpack.h:97
Amesos_Dscpack::PrintTiming
void PrintTiming() const
Prints timing information.
Definition: Amesos_Dscpack.cpp:583
Amesos_Dscpack::NumLocalStructs
int NumLocalStructs
Definition: Amesos_Dscpack.h:179
Amesos_Dscpack::MyDscRank
int MyDscRank
Definition: Amesos_Dscpack.h:175
Amesos_Time.h
Epetra_Comm
Amesos_Dscpack::NumLocalCols
int NumLocalCols
Definition: Amesos_Dscpack.h:177
Amesos_Dscpack::A_and_LU_built
bool A_and_LU_built
Tells us whether to free them.
Definition: Amesos_Dscpack.h:169
Amesos_Dscpack::DscRowMap
const Epetra_Map & DscRowMap() const
Definition: Amesos_Dscpack.h:146
Epetra_LinearProblem.h
Teuchos::RCP< Amesos_Dscpack_Pimpl >
Amesos_Dscpack::MaxProcs_
int MaxProcs_
Definition: Amesos_Dscpack.h:186
Amesos_Dscpack::Comm
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Definition: Amesos_Dscpack.h:115
Amesos_Dscpack::OverheadTime_
int OverheadTime_
Definition: Amesos_Dscpack.h:189
Amesos_Dscpack::NumLocalNonz
int NumLocalNonz
Definition: Amesos_Dscpack.h:180
Amesos_Dscpack::Importer
const Epetra_Import & Importer() const
Definition: Amesos_Dscpack.h:141
Amesos_Dscpack
Amesos_Dscpack: An object-oriented wrapper for Dscpack.
Definition: Amesos_Dscpack.h:60
Amesos_Dscpack::FirstCallToSolve_
bool FirstCallToSolve_
Definition: Amesos_Dscpack.h:167
Amesos_Status::NumNumericFact_
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:69
Amesos_Utils
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:19
Amesos_Dscpack::SetUseTranspose
int SetUseTranspose(bool UseTranspose)
If set true, X will be set to the solution of AT X = B (not A X = B)
Definition: Amesos_Dscpack.h:105
Amesos_BaseSolver.h
Amesos_Dscpack::NumNumericFact
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
Definition: Amesos_Dscpack.h:123
Amesos_Dscpack::~Amesos_Dscpack
~Amesos_Dscpack(void)
Amesos_Dscpack Destructor.
Definition: Amesos_Dscpack.cpp:69
Epetra_LinearProblem
Amesos_Dscpack::GlobalStructNewColNum
int * GlobalStructNewColNum
Definition: Amesos_Dscpack.h:170
Amesos_Dscpack::Amesos_Dscpack
Amesos_Dscpack(const Epetra_LinearProblem &LinearProblem)
Amesos_Dscpack Constructor.
Definition: Amesos_Dscpack.cpp:48
Amesos_Dscpack::DscColMap_
RCP< Epetra_Map > DscColMap_
Definition: Amesos_Dscpack.h:183
Amesos_Dscpack::NumericFactorization
int NumericFactorization()
Performs NumericFactorization on the matrix A.
Definition: Amesos_Dscpack.cpp:445
Epetra_Import.h
Amesos_Control
Amesos_Control: Container for some control variables.
Definition: Amesos_Control.h:16
Amesos_Dscpack::SolveTime_
int SolveTime_
Definition: Amesos_Dscpack.h:189
Epetra_Comm.h
Amesos_Dscpack_Pimpl
Definition: Amesos_Dscpack.cpp:43
Amesos_ConfigDefs.h
Amesos_Dscpack::GlobalStructNewNum
int * GlobalStructNewNum
Definition: Amesos_Dscpack.h:171
Amesos_Dscpack::VecRedistTime_
int VecRedistTime_
Definition: Amesos_Dscpack.h:188
Amesos_Dscpack::TotalMemory_
int TotalMemory_
Definition: Amesos_Dscpack.h:192
Amesos_Utils.h
Amesos_Dscpack::SetParameters
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
Definition: Amesos_Dscpack.cpp:83
Amesos_Control.h
Amesos_Dscpack::Solve
int Solve()
Solves A X = B (or AT x = B)
Definition: Amesos_Dscpack.cpp:461
Amesos_Dscpack::LocalStructOldNum
int * LocalStructOldNum
Definition: Amesos_Dscpack.h:173
Amesos_Time::GetTiming
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:124
Teuchos::RCP::get
T * get() const
Amesos_Dscpack::DscRowMap_
RCP< Epetra_Map > DscRowMap_
Definition: Amesos_Dscpack.h:184
Amesos_Dscpack::GetTiming
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list.
Definition: Amesos_Dscpack.h:135
Amesos_Dscpack::MtxRedistTime_
int MtxRedistTime_
Definition: Amesos_Dscpack.h:188
Teuchos::ParameterList
Amesos_Dscpack::MtxConvTime_
int MtxConvTime_
Definition: Amesos_Dscpack.h:188
Amesos_Time
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:50
Amesos_Dscpack::Importer_
RCP< Epetra_Import > Importer_
Definition: Amesos_Dscpack.h:182
Amesos_Dscpack::PerformNumericFactorization
int PerformNumericFactorization()
Performs the numeric factorization.
Definition: Amesos_Dscpack.cpp:294
Amesos_Dscpack::PerformSymbolicFactorization
int PerformSymbolicFactorization()
Performs the symbolic factorization.
Definition: Amesos_Dscpack.cpp:108
Epetra_Map
Epetra_Import
Amesos_Status
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:20
Amesos_Dscpack::MatrixShapeOK
bool MatrixShapeOK() const
Returns true if DSCPACK can handle this matrix shape.
Definition: Amesos_Dscpack.cpp:415
Amesos_Status.h