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 #if defined(Amesos_SHOW_DEPRECATED_WARNINGS)
43 #ifdef __GNUC__
44 #warning "The Amesos package is deprecated"
45 #endif
46 #endif
47 
48 #include "Amesos_ConfigDefs.h"
49 #include "Amesos_BaseSolver.h"
50 #include "Amesos_NoCopiable.h"
51 #include "Amesos_Utils.h"
52 #include "Amesos_Time.h"
53 #include "Amesos_Status.h"
54 #include "Amesos_Control.h"
55 #include "Epetra_LinearProblem.h"
56 #include "Epetra_Map.h"
57 #include "Epetra_Import.h"
58 #include "Epetra_Comm.h"
59 #include "Epetra_RowMatrix.h"
60 #include "Epetra_CrsMatrix.h"
62 #include "Teuchos_RCP.hpp"
63 extern "C" {
64  // #include "taucs.h"
65 }
66 
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 class Amesos_Taucs_Pimpl ;
77 #endif
78 
80  private Amesos_Time,
81  private Amesos_NoCopiable,
82  private Amesos_Utils,
83  private Amesos_Control,
84  private Amesos_Status {
85 
86 public:
87 
89 
91  Amesos_Taucs(const Epetra_LinearProblem& LinearProblem );
92 
94  ~Amesos_Taucs(void);
95 
97 
98 
99  int SymbolicFactorization() ;
100 
101  int NumericFactorization() ;
102 
103  int Solve();
104 
106 
107 
108  const Epetra_LinearProblem* GetProblem() const { return(Problem_); };
109 
111 
112 
113  bool MatrixShapeOK() const;
114 
116 
119 
120  bool UseTranspose() const {return(UseTranspose_);};
121 
122  const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
123 
125 
128 
131 
133  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
134 
136  void PrintTiming() const;
137 
139  void PrintStatus() const;
140 
142  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
143 
144 private:
145 
147 
148 
150  inline const Epetra_Map& Map() const
151  {
152  return(Matrix_->RowMatrixRowMap());
153  }
154 
156  inline const Epetra_RowMatrix& Matrix() const
157  {
158  return(*Matrix_);
159  }
160 
163  {
164  return(*(SerialMap_.get()));
165  }
166 
169  {
170  return(*(SerialMatrix_.get()));
171  }
172 
175  {
176  return(*(SerialCrsMatrix_.get()));
177  }
178 
181  {
182  return(*(Importer_.get()));
183  }
184 
186  int ConvertToSerial();
187 
189  int ConvertToTaucs();
190 
193 
196 
197  // @}
198 
201 
206 
207  const Epetra_Map* Map_;
209 
212 
216 
217  //
218  // PrivateTaucsData_ contains pointers to data needed by taucs whose
219  // data structures are defined by taucs.h
220  //
222 
223 
224 }; // class Amesos_Taucs
225 
226 #endif
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:73
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
Definition: Amesos_Taucs.h:130
Amesos_Control: Container for some control variables.
Epetra_Import & Importer()
Returns a reference to the already allocated Importer.
Definition: Amesos_Taucs.h:180
const Epetra_RowMatrix & Matrix() const
Returns a reference to the linear system matrix.
Definition: Amesos_Taucs.h:156
virtual const Epetra_Map & RowMatrixRowMap() const =0
int NumSolve() const
Returns the number of solves performed by this object.
Definition: Amesos_Taucs.h:133
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Amesos_Taucs.h:120
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:214
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:75
bool MatrixShapeOK() const
Returns true if the solver can handle this matrix shape.
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:77
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
Definition: Amesos_Taucs.h:108
Amesos_Taucs(const Epetra_LinearProblem &LinearProblem)
Default constructor.
Teuchos::RCP< Epetra_Import > Importer_
Definition: Amesos_Taucs.h:205
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:200
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:130
Epetra_CrsMatrix & SerialCrsMatrix()
Returns a reference to the already SerialMatrix as Crs (if allocated).
Definition: Amesos_Taucs.h:174
~Amesos_Taucs(void)
Default destructor.
const Epetra_LinearProblem * Problem_
Pointer to the linear system problem.
Definition: Amesos_Taucs.h:211
void PrintTiming() const
Prints timing information.
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:26
int PerformNumericFactorization()
Performs the numeric factorization.
const Epetra_RowMatrix * Matrix_
Definition: Amesos_Taucs.h:208
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:56
void PrintStatus() const
Prints status information.
Epetra_Map & SerialMap()
Returns a reference to the already allocated SerialMap.
Definition: Amesos_Taucs.h:162
int SetUseTranspose(bool UseTranspose)
Amesos_Taucs supports only symmetric matrices, hence transpose is irrelevant, but harmless...
Definition: Amesos_Taucs.h:118
int ConvertToTaucs()
Converts the Epetra_RowMatrix into TAUCS format.
Teuchos::RCP< Amesos_Taucs_Pimpl > PrivateTaucsData_
Definition: Amesos_Taucs.h:221
Teuchos::RCP< Epetra_Map > SerialMap_
Definition: Amesos_Taucs.h:202
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list...
Definition: Amesos_Taucs.h:142
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
Definition: Amesos_Taucs.h:127
const Epetra_Map & Map() const
Returns a reference to the RowMatrixRowMap().
Definition: Amesos_Taucs.h:150
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:122
Epetra_RowMatrix & SerialMatrix()
Returns a reference to the SerialMatrix.
Definition: Amesos_Taucs.h:168
Teuchos::RCP< Epetra_RowMatrix > SerialMatrix_
Definition: Amesos_Taucs.h:204
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
const Epetra_Map * Map_
Definition: Amesos_Taucs.h:207
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =...
Teuchos::RCP< Epetra_CrsMatrix > SerialCrsMatrix_
Definition: Amesos_Taucs.h:203
Amesos_Taucs: An interface to the TAUCS package.
Definition: Amesos_Taucs.h:79
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:25