Amesos Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
Amesos_Taucs.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
39#ifndef AMESOS_TAUCS_H
40#define AMESOS_TAUCS_H
41
42#include "Amesos_ConfigDefs.h"
43#include "Amesos_BaseSolver.h"
44#include "Amesos_NoCopiable.h"
45#include "Amesos_Utils.h"
46#include "Amesos_Time.h"
47#include "Amesos_Status.h"
48#include "Amesos_Control.h"
49#include "Epetra_LinearProblem.h"
50#include "Epetra_Map.h"
51#include "Epetra_Import.h"
52#include "Epetra_Comm.h"
53#include "Epetra_RowMatrix.h"
54#include "Epetra_CrsMatrix.h"
55#include "Teuchos_ParameterList.hpp"
56#include "Teuchos_RCP.hpp"
57extern "C" {
58 // #include "taucs.h"
59}
60
69#ifndef DOXYGEN_SHOULD_SKIP_THIS
70class Amesos_Taucs_Pimpl ;
71#endif
72
74 private Amesos_Time,
75 private Amesos_NoCopiable,
76 private Amesos_Utils,
77 private Amesos_Control,
78 private Amesos_Status {
79
80public:
81
83
85 Amesos_Taucs(const Epetra_LinearProblem& LinearProblem );
86
88 ~Amesos_Taucs(void);
89
91
92
94
96
97 int Solve();
98
100
101
102 const Epetra_LinearProblem* GetProblem() const { return(Problem_); };
103
105
106
107 bool MatrixShapeOK() const;
108
110
113
114 bool UseTranspose() const {return(UseTranspose_);};
115
116 const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
117
118 int SetParameters( Teuchos::ParameterList &ParameterList);
119
122
125
127 int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
128
130 void PrintTiming() const;
131
133 void PrintStatus() const;
134
136 void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
137
138private:
139
141
142
144 inline const Epetra_Map& Map() const
145 {
146 return(Matrix_->RowMatrixRowMap());
147 }
148
150 inline const Epetra_RowMatrix& Matrix() const
151 {
152 return(*Matrix_);
153 }
154
156 inline Epetra_Map& SerialMap()
157 {
158 return(*(SerialMap_.get()));
159 }
160
162 inline Epetra_RowMatrix& SerialMatrix()
163 {
164 return(*(SerialMatrix_.get()));
165 }
166
168 inline Epetra_CrsMatrix& SerialCrsMatrix()
169 {
170 return(*(SerialCrsMatrix_.get()));
171 }
172
174 inline Epetra_Import& Importer()
175 {
176 return(*(Importer_.get()));
177 }
178
180 int ConvertToSerial();
181
183 int ConvertToTaucs();
184
187
190
191 // @}
192
195
196 Teuchos::RCP<Epetra_Map> SerialMap_;
197 Teuchos::RCP<Epetra_CrsMatrix> SerialCrsMatrix_;
198 Teuchos::RCP<Epetra_RowMatrix> SerialMatrix_;
199 Teuchos::RCP<Epetra_Import> Importer_;
200
201 const Epetra_Map* Map_;
202 const Epetra_RowMatrix* Matrix_;
203
205 const Epetra_LinearProblem* Problem_;
206
210
211 //
212 // PrivateTaucsData_ contains pointers to data needed by taucs whose
213 // data structures are defined by taucs.h
214 //
215 Teuchos::RCP<Amesos_Taucs_Pimpl> PrivateTaucsData_;
216
217
218}; // class Amesos_Taucs
219
220#endif
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Amesos_Control: Container for some control variables.
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =.
Amesos_Status: Container for some status variables.
int NumSymbolicFact_
Number of symbolic factorization phases.
int NumSolve_
Number of solves.
int NumNumericFact_
Number of numeric factorization phases.
Amesos_Taucs: An interface to the TAUCS package.
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int ConvertToTaucs()
Converts the Epetra_RowMatrix into TAUCS format.
const Epetra_RowMatrix & Matrix() const
Returns a reference to the linear system matrix.
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int SetUseTranspose(bool UseTranspose)
Amesos_Taucs supports only symmetric matrices, hence transpose is irrelevant, but harmless.
Epetra_CrsMatrix & SerialCrsMatrix()
Returns a reference to the already SerialMatrix as Crs (if allocated).
int ConvertToSerial()
Constructs a matrix with all rows on processor 0.
Teuchos::RCP< Amesos_Taucs_Pimpl > PrivateTaucsData_
Amesos_Taucs(const Epetra_LinearProblem &LinearProblem)
Default constructor.
bool MatrixShapeOK() const
Returns true if the solver can handle this matrix shape.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Epetra_Import & Importer()
Returns a reference to the already allocated Importer.
Teuchos::RCP< Epetra_Import > Importer_
Epetra_Map & SerialMap()
Returns a reference to the already allocated SerialMap.
Teuchos::RCP< Epetra_RowMatrix > SerialMatrix_
int MtxConvTime_
Quick accessor pointer to internal timing data.
Epetra_RowMatrix & SerialMatrix()
Returns a reference to the SerialMatrix.
int PerformSymbolicFactorization()
Performs the symbolic factorization.
int PerformNumericFactorization()
Performs the numeric factorization.
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
int NumSolve() const
Returns the number of solves performed by this object.
Teuchos::RCP< Epetra_CrsMatrix > SerialCrsMatrix_
const Epetra_RowMatrix * Matrix_
bool UseTranspose_
If true, the transpose of A is used.
Teuchos::RCP< Epetra_Map > SerialMap_
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list.
void PrintTiming() const
Prints timing information.
const Epetra_LinearProblem * Problem_
Pointer to the linear system problem.
bool UseTranspose() const
Returns the current UseTranspose setting.
void PrintStatus() const
Prints status information.
~Amesos_Taucs(void)
Default destructor.
int Solve()
Solves A X = B (or AT x = B)
const Epetra_Map & Map() const
Returns a reference to the RowMatrixRowMap().
const Epetra_Map * Map_
Amesos_Time: Container for timing information.
Definition Amesos_Time.h:51
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Amesos_Utils: Collections of basic utilities.