Epetra Package Browser (Single Doxygen Collection)  Development
Epetra_SerialSpdDenseSolver.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // Epetra: Linear Algebra Services Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ************************************************************************
41 //@HEADER
42 */
43 
44 #ifndef EPETRA_SERIALSPDDENSESOLVER_H
45 #define EPETRA_SERIALSPDDENSESOLVER_H
48 
50 
146 //=========================================================================
147 class EPETRA_LIB_DLL_EXPORT Epetra_SerialSpdDenseSolver : public Epetra_SerialDenseSolver {
148 
149  public:
151 
154 
155 
157  virtual ~Epetra_SerialSpdDenseSolver();
159 
161 
162 
163  //Let the compiler know we intend to overload the SetMatrix function,
164  //rather than hide it.
166 
170 
172 
173 
175 
178  int Factor(void);
179 
181 
184  int Solve(void);
185 
187 
192  int Invert(void);
193 
195 
198  int ComputeEquilibrateScaling(void);
199 
201 
204  int EquilibrateMatrix(void);
205 
207 
210  int EquilibrateRHS(void);
211 
212 
214 
217  int ApplyRefinement(void);
218 
220 
223  int UnequilibrateLHS(void);
224 
226 
232  int ReciprocalConditionEstimate(double & Value);
234 
236 
237 
238 
240  bool ShouldEquilibrate() {ComputeEquilibrateScaling(); return(ShouldEquilibrate_);};
242 
244 
245 
247  Epetra_SerialSymDenseMatrix * SymMatrix() const {return(SymMatrix_);};
248 
250  Epetra_SerialSymDenseMatrix * SymFactoredMatrix() const {return(SymFactor_);};
251 
253 
255  double SCOND() {return(SCOND_);};
256 
257  //Let the compiler know we intend to overload the AMAX function,
258  //rather than hide it.
260 
262  double AMAX() {return(AMAX_);};
264 
265  private:
266 
267  double SCOND_;
268  Epetra_SerialSymDenseMatrix * SymMatrix_; // Need pointer to symmetric matrix for Spd-specific methods
269  Epetra_SerialSymDenseMatrix * SymFactor_; // Need pointer to symmetric matrix for Spd-specific methods
270 
271  // Epetra_SerialSpdDenseSolver copy constructor (put here because we don't want user access)
272 
275 };
276 
277 #endif /* EPETRA_SERIALSPDDENSESOLVER_H */
Epetra_SerialDenseSolver::operator=
Epetra_SerialDenseSolver & operator=(const Epetra_SerialDenseSolver &Source)
Epetra_SerialDenseSolver.h
Epetra_SerialDenseSolver::EquilibrateMatrix
virtual int EquilibrateMatrix(void)
Equilibrates the this matrix.
Definition: Epetra_SerialDenseSolver.cpp:368
Epetra_SerialSpdDenseSolver::SymMatrix
Epetra_SerialSymDenseMatrix * SymMatrix() const
Returns pointer to current matrix.
Definition: Epetra_SerialSpdDenseSolver.h:247
Epetra_SerialDenseSolver::AMAX
double AMAX() const
Returns the absolute value of the largest entry of the this matrix (returns -1 if not yet computed).
Definition: Epetra_SerialDenseSolver.h:345
Epetra_SerialSpdDenseSolver::ShouldEquilibrate
bool ShouldEquilibrate()
Returns true if the LAPACK general rules for equilibration suggest you should equilibrate the system.
Definition: Epetra_SerialSpdDenseSolver.h:240
Epetra_SerialDenseSolver::UnequilibrateLHS
int UnequilibrateLHS(void)
Unscales the solution vectors if equilibration was used to solve the system.
Definition: Epetra_SerialDenseSolver.cpp:443
Epetra_SerialDenseSolver::SetMatrix
int SetMatrix(Epetra_SerialDenseMatrix &A)
Sets the pointers for coefficient matrix.
Definition: Epetra_SerialDenseSolver.cpp:162
Epetra_SerialDenseSolver::Solve
virtual int Solve(void)
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()....
Definition: Epetra_SerialDenseSolver.cpp:255
Epetra_SerialDenseSolver::Invert
virtual int Invert(void)
Inverts the this matrix.
Definition: Epetra_SerialDenseSolver.cpp:468
Epetra_SerialDenseSolver::ReciprocalConditionEstimate
virtual int ReciprocalConditionEstimate(double &Value)
Returns the reciprocal of the 1-norm condition number of the this matrix.
Definition: Epetra_SerialDenseSolver.cpp:499
Epetra_SerialDenseSolver::Factor
virtual int Factor(void)
Computes the in-place LU factorization of the matrix using the LAPACK routine DGETRF.
Definition: Epetra_SerialDenseSolver.cpp:219
Epetra_SerialSpdDenseSolver
Epetra_SerialSpdDenseSolver: A class for constructing and using symmetric positive definite dense mat...
Definition: Epetra_SerialSpdDenseSolver.h:147
Epetra_SerialDenseSolver::ApplyRefinement
virtual int ApplyRefinement(void)
Apply Iterative Refinement.
Definition: Epetra_SerialDenseSolver.cpp:318
Epetra_SerialDenseSolver::EquilibrateRHS
int EquilibrateRHS(void)
Equilibrates the current RHS.
Definition: Epetra_SerialDenseSolver.cpp:414
Epetra_SerialSpdDenseSolver::SymFactor_
Epetra_SerialSymDenseMatrix * SymFactor_
Definition: Epetra_SerialSpdDenseSolver.h:269
Epetra_SerialSpdDenseSolver::SCOND
double SCOND()
Ratio of smallest to largest equilibration scale factors for the this matrix (returns -1 if not yet c...
Definition: Epetra_SerialSpdDenseSolver.h:255
Epetra_SerialSpdDenseSolver::SymFactoredMatrix
Epetra_SerialSymDenseMatrix * SymFactoredMatrix() const
Returns pointer to factored matrix (assuming factorization has been performed).
Definition: Epetra_SerialSpdDenseSolver.h:250
Epetra_SerialSpdDenseSolver::SymMatrix_
Epetra_SerialSymDenseMatrix * SymMatrix_
Definition: Epetra_SerialSpdDenseSolver.h:268
Epetra_SerialSymDenseMatrix
Epetra_SerialSymDenseMatrix: A class for constructing and using symmetric positive definite dense mat...
Definition: Epetra_SerialSymDenseMatrix.h:130
Epetra_SerialDenseSolver::ComputeEquilibrateScaling
virtual int ComputeEquilibrateScaling(void)
Computes the scaling vector S(i) = 1/sqrt(A(i,i)) of the this matrix.
Definition: Epetra_SerialDenseSolver.cpp:349
Epetra_SerialDenseSolver
Epetra_SerialDenseSolver: A class for solving dense linear problems.
Definition: Epetra_SerialDenseSolver.h:132