Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
46 
47 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The Epetra package is deprecated"
50 #endif
51 #endif
52 
53 
56 
58 
154 //=========================================================================
155 class EPETRA_LIB_DLL_EXPORT Epetra_SerialSpdDenseSolver : public Epetra_SerialDenseSolver {
156 
157  public:
159 
162 
163 
165  virtual ~Epetra_SerialSpdDenseSolver();
167 
169 
170 
171  //Let the compiler know we intend to overload the SetMatrix function,
172  //rather than hide it.
174 
178 
180 
181 
183 
186  int Factor(void);
187 
189 
192  int Solve(void);
193 
195 
200  int Invert(void);
201 
203 
206  int ComputeEquilibrateScaling(void);
207 
209 
212  int EquilibrateMatrix(void);
213 
215 
218  int EquilibrateRHS(void);
219 
220 
222 
225  int ApplyRefinement(void);
226 
228 
231  int UnequilibrateLHS(void);
232 
234 
240  int ReciprocalConditionEstimate(double & Value);
242 
244 
245 
246 
248  bool ShouldEquilibrate() {ComputeEquilibrateScaling(); return(ShouldEquilibrate_);};
250 
252 
253 
255  Epetra_SerialSymDenseMatrix * SymMatrix() const {return(SymMatrix_);};
256 
258  Epetra_SerialSymDenseMatrix * SymFactoredMatrix() const {return(SymFactor_);};
259 
261 
263  double SCOND() {return(SCOND_);};
264 
265  //Let the compiler know we intend to overload the AMAX function,
266  //rather than hide it.
268 
270  double AMAX() {return(AMAX_);};
272 
273  private:
274 
275  double SCOND_;
276  Epetra_SerialSymDenseMatrix * SymMatrix_; // Need pointer to symmetric matrix for Spd-specific methods
277  Epetra_SerialSymDenseMatrix * SymFactor_; // Need pointer to symmetric matrix for Spd-specific methods
278 
279  // Epetra_SerialSpdDenseSolver copy constructor (put here because we don't want user access)
280 
283 };
284 
285 #endif /* EPETRA_SERIALSPDDENSESOLVER_H */
Epetra_SerialSymDenseMatrix * SymFactor_
Epetra_SerialSymDenseMatrix: A class for constructing and using symmetric positive definite dense mat...
int UnequilibrateLHS(void)
Unscales the solution vectors if equilibration was used to solve the system.
Epetra_SerialSpdDenseSolver: A class for constructing and using symmetric positive definite dense mat...
virtual int ApplyRefinement(void)
Apply Iterative Refinement.
bool ShouldEquilibrate()
Returns true if the LAPACK general rules for equilibration suggest you should equilibrate the system...
Epetra_SerialDenseSolver & operator=(const Epetra_SerialDenseSolver &Source)
double SCOND()
Ratio of smallest to largest equilibration scale factors for the this matrix (returns -1 if not yet c...
Epetra_SerialSymDenseMatrix * SymMatrix_
Epetra_SerialSymDenseMatrix * SymMatrix() const
Returns pointer to current matrix.
virtual int Solve(void)
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()..
virtual int Invert(void)
Inverts the this matrix.
int SetMatrix(Epetra_SerialDenseMatrix &A)
Sets the pointers for coefficient matrix.
Epetra_SerialSymDenseMatrix * SymFactoredMatrix() const
Returns pointer to factored matrix (assuming factorization has been performed).
virtual int EquilibrateMatrix(void)
Equilibrates the this matrix.
virtual int ComputeEquilibrateScaling(void)
Computes the scaling vector S(i) = 1/sqrt(A(i,i)) of the this matrix.
double AMAX() const
Returns the absolute value of the largest entry of the this matrix (returns -1 if not yet computed)...
int EquilibrateRHS(void)
Equilibrates the current RHS.
virtual int ReciprocalConditionEstimate(double &Value)
Returns the reciprocal of the 1-norm condition number of the this matrix.
virtual int Factor(void)
Computes the in-place LU factorization of the matrix using the LAPACK routine DGETRF.
Epetra_SerialDenseSolver: A class for solving dense linear problems.