Epetra Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
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//=========================================================================
147class EPETRA_LIB_DLL_EXPORT Epetra_SerialSpdDenseSolver : public Epetra_SerialDenseSolver {
148
149 public:
151
152
154
155
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
199
201
204 int EquilibrateMatrix(void);
205
207
210 int EquilibrateRHS(void);
211
212
214
217 int ApplyRefinement(void);
218
220
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: A class for solving dense linear problems.
virtual int Solve(void)
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()....
double AMAX() const
Returns the absolute value of the largest entry of the this matrix (returns -1 if not yet computed).
int SetMatrix(Epetra_SerialDenseMatrix &A)
Sets the pointers for coefficient matrix.
virtual int ReciprocalConditionEstimate(double &Value)
Returns the reciprocal of the 1-norm condition number of the this matrix.
virtual int ApplyRefinement(void)
Apply Iterative Refinement.
virtual int ComputeEquilibrateScaling(void)
Computes the scaling vector S(i) = 1/sqrt(A(i,i)) of the this matrix.
virtual int Factor(void)
Computes the in-place LU factorization of the matrix using the LAPACK routine DGETRF.
virtual int EquilibrateMatrix(void)
Equilibrates the this matrix.
virtual int Invert(void)
Inverts the this matrix.
Epetra_SerialSpdDenseSolver: A class for constructing and using symmetric positive definite dense mat...
Epetra_SerialSpdDenseSolver(const Epetra_SerialSpdDenseSolver &Source)
bool ShouldEquilibrate()
Returns true if the LAPACK general rules for equilibration suggest you should equilibrate the system.
Epetra_SerialSymDenseMatrix * SymFactor_
int EquilibrateRHS(void)
Equilibrates the current RHS.
double SCOND()
Ratio of smallest to largest equilibration scale factors for the this matrix (returns -1 if not yet c...
Epetra_SerialSpdDenseSolver & operator=(const Epetra_SerialSpdDenseSolver &Source)
Epetra_SerialSymDenseMatrix * SymMatrix() const
Returns pointer to current matrix.
double AMAX()
Returns the absolute value of the largest entry of the this matrix (returns -1 if not yet computed).
Epetra_SerialSymDenseMatrix * SymFactoredMatrix() const
Returns pointer to factored matrix (assuming factorization has been performed).
Epetra_SerialSymDenseMatrix * SymMatrix_
int UnequilibrateLHS(void)
Unscales the solution vectors if equilibration was used to solve the system.
Epetra_SerialSymDenseMatrix: A class for constructing and using symmetric positive definite dense mat...