Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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"
56 #include "Teuchos_RCP.hpp"
57 extern "C" {
58  // #include "taucs.h"
59 }
60 
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 class 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 
80 public:
81 
83 
85  Amesos_Taucs(const Epetra_LinearProblem& LinearProblem );
86 
88  ~Amesos_Taucs(void);
89 
91 
92 
93  int SymbolicFactorization() ;
94 
95  int NumericFactorization() ;
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 
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 
138 private:
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 
157  {
158  return(*(SerialMap_.get()));
159  }
160 
163  {
164  return(*(SerialMatrix_.get()));
165  }
166 
169  {
170  return(*(SerialCrsMatrix_.get()));
171  }
172 
175  {
176  return(*(Importer_.get()));
177  }
178 
180  int ConvertToSerial();
181 
183  int ConvertToTaucs();
184 
187 
190 
191  // @}
192 
195 
200 
201  const Epetra_Map* Map_;
203 
206 
210 
211  //
212  // PrivateTaucsData_ contains pointers to data needed by taucs whose
213  // data structures are defined by taucs.h
214  //
216 
217 
218 }; // class Amesos_Taucs
219 
220 #endif
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:67
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
Definition: Amesos_Taucs.h:124
Amesos_Control: Container for some control variables.
Epetra_Import & Importer()
Returns a reference to the already allocated Importer.
Definition: Amesos_Taucs.h:174
const Epetra_RowMatrix & Matrix() const
Returns a reference to the linear system matrix.
Definition: Amesos_Taucs.h:150
virtual const Epetra_Map & RowMatrixRowMap() const =0
int NumSolve() const
Returns the number of solves performed by this object.
Definition: Amesos_Taucs.h:127
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Amesos_Taucs.h:114
int PerformSymbolicFactorization()
Performs the symbolic factorization.
int Solve()
Solves A X = B (or AT x = B)
T * get() const
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
int MtxConvTime_
Quick accessor pointer to internal timing data.
Definition: Amesos_Taucs.h:208
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:69
bool MatrixShapeOK() const
Returns true if the solver can handle this matrix shape.
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:71
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
Definition: Amesos_Taucs.h:102
Amesos_Taucs(const Epetra_LinearProblem &LinearProblem)
Default constructor.
Teuchos::RCP< Epetra_Import > Importer_
Definition: Amesos_Taucs.h:199
int ConvertToSerial()
Constructs a matrix with all rows on processor 0.
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
bool UseTranspose_
If true, the transpose of A is used.
Definition: Amesos_Taucs.h:194
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:124
Epetra_CrsMatrix & SerialCrsMatrix()
Returns a reference to the already SerialMatrix as Crs (if allocated).
Definition: Amesos_Taucs.h:168
~Amesos_Taucs(void)
Default destructor.
const Epetra_LinearProblem * Problem_
Pointer to the linear system problem.
Definition: Amesos_Taucs.h:205
void PrintTiming() const
Prints timing information.
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:20
int PerformNumericFactorization()
Performs the numeric factorization.
const Epetra_RowMatrix * Matrix_
Definition: Amesos_Taucs.h:202
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:50
void PrintStatus() const
Prints status information.
Epetra_Map & SerialMap()
Returns a reference to the already allocated SerialMap.
Definition: Amesos_Taucs.h:156
int SetUseTranspose(bool UseTranspose)
Amesos_Taucs supports only symmetric matrices, hence transpose is irrelevant, but harmless...
Definition: Amesos_Taucs.h:112
int ConvertToTaucs()
Converts the Epetra_RowMatrix into TAUCS format.
Teuchos::RCP< Amesos_Taucs_Pimpl > PrivateTaucsData_
Definition: Amesos_Taucs.h:215
Teuchos::RCP< Epetra_Map > SerialMap_
Definition: Amesos_Taucs.h:196
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list...
Definition: Amesos_Taucs.h:136
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
Definition: Amesos_Taucs.h:121
const Epetra_Map & Map() const
Returns a reference to the RowMatrixRowMap().
Definition: Amesos_Taucs.h:144
int NumericFactorization()
Performs NumericFactorization on the matrix A.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Definition: Amesos_Taucs.h:116
Epetra_RowMatrix & SerialMatrix()
Returns a reference to the SerialMatrix.
Definition: Amesos_Taucs.h:162
Teuchos::RCP< Epetra_RowMatrix > SerialMatrix_
Definition: Amesos_Taucs.h:198
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
const Epetra_Map * Map_
Definition: Amesos_Taucs.h:201
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =...
Teuchos::RCP< Epetra_CrsMatrix > SerialCrsMatrix_
Definition: Amesos_Taucs.h:197
Amesos_Taucs: An interface to the TAUCS package.
Definition: Amesos_Taucs.h:73
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:19