SourcePro® 2024.1 |
SourcePro® API Reference Guide |
Encapsulates factorizations of tridiagonal matrices. More...
#include <rw/lapack/trdgfct.h>
Public Member Functions | |
RWTriDiagFact () | |
RWTriDiagFact (const RWTriDiagFact< TypeT > &rhs) | |
RWTriDiagFact (const RWTriDiagMat< TypeT > &A, bool estimateCondition=true) | |
~RWTriDiagFact () | |
int | cols () const |
rw_numeric_traits< TypeT >::norm_type | condition () const |
TypeT | determinant () const |
void | factor (const RWTriDiagMat< TypeT > &A, bool estimateCondition=true) |
bool | fail () const |
bool | good () const |
bool | isSingular () const |
int | rows () const |
RWGenMat< TypeT > | solve (const RWGenMat< TypeT > &b) const |
RWMathVec< TypeT > | solve (const RWMathVec< TypeT > &b) const |
Related Symbols | |
(Note that these are not member symbols.) | |
double | condition (const RWTriDiagFact< DComplex > &A) |
double | condition (const RWTriDiagFact< double > &A) |
float | condition (const RWTriDiagFact< float > &A) |
template<class TypeT > | |
TypeT | determinant (const RWTriDiagFact< TypeT > &A) |
template<class TypeT > | |
RWGenMat< TypeT > | solve (const RWTriDiagFact< TypeT > &A, const RWGenMat< TypeT > &b) |
template<class TypeT > | |
RWMathVec< TypeT > | solve (const RWTriDiagFact< TypeT > &A, const RWMathVec< TypeT > &b) |
A factorization is a representation of a matrix that can be used to efficiently solve systems of equations, and to compute the inverse, determinant, and condition number of a matrix. The class RWTriDiagFact encapsulates factorizations of tridiagonal matrices. Provided the matrix being factored is nonsingular, the resulting factorization can always be used to solve a system of equations.
RWTriDiagFact< TypeT >::RWTriDiagFact | ( | ) |
Default constructor. Builds a factorization of a 0 x 0 matrix. You use the member function factor() to fill in the factorization.
RWTriDiagFact< TypeT >::RWTriDiagFact | ( | const RWTriDiagFact< TypeT > & | rhs | ) |
Copy constructor.
RWTriDiagFact< TypeT >::RWTriDiagFact | ( | const RWTriDiagMat< TypeT > & | A, |
bool | estimateCondition = true ) |
Constructs a factorization of the matrix A. This factorization can be used to solve systems of equations, and to calculate inverses and determinants. If the parameter estimateCondition is true
, you can use the function condition() to obtain an estimate of the condition number of the matrix. Setting estimateCondition to false
can save some computation if the condition number is not needed.
RWTriDiagFact< TypeT >::~RWTriDiagFact | ( | ) |
Destructor.
|
inline |
Returns the number of columns in the matrix represented by this factorization.
rw_numeric_traits< TypeT >::norm_type RWTriDiagFact< TypeT >::condition | ( | ) | const |
Calculates the reciprocal condition number of the matrix represented by this factorization. If this number is near 0
, the matrix is ill-conditioned and solutions to systems of equations computed using this factorization may not be accurate. If the number is near 1
, the matrix is well-conditioned. For the condition number to be computed, the norm of the matrix must be computed at the time the factorization is constructed. If you set the optional boolean parameter in RWTriDiagFact() or factor() to false
, calling condition() generates an exception.
TypeT RWTriDiagFact< TypeT >::determinant | ( | ) | const |
Calculates the determinant of the matrix represented by this factorization.
void RWTriDiagFact< TypeT >::factor | ( | const RWTriDiagMat< TypeT > & | A, |
bool | estimateCondition = true ) |
Factors a matrix. Calling factor() replaces the current factorization with the factorization of the matrix A. This is commonly used to initialize a factorization constructed with the default (no arguments) constructor.
bool RWTriDiagFact< TypeT >::fail | ( | ) | const |
Returns false
if the factorization is successfully constructed. If this function returns true
, attempting to use this factorization to solve a system of equations results in an exception being thrown.
|
inline |
Returns true
if the factorization is successfully constructed. If this function returns false
, attempting to use this factorization to solve a system of equations results in an exception being thrown.
bool RWTriDiagFact< TypeT >::isSingular | ( | ) | const |
Tests if the matrix is singular to within machine precision. If the factorization is a positive definite type and the matrix that was factored is not actually positive definite, then isSingular() may return true
regardless of whether or not the matrix is actually singular.
|
inline |
Returns the number of rows in the matrix represented by this factorization.
RWGenMat< TypeT > RWTriDiagFact< TypeT >::solve | ( | const RWGenMat< TypeT > & | b | ) | const |
RWMathVec< TypeT > RWTriDiagFact< TypeT >::solve | ( | const RWMathVec< TypeT > & | b | ) | const |
|
related |
Calculates the reciprocal condition number of the matrix represented by the factorization A. If this number is near 0
, the matrix is ill-conditioned and solutions to systems of equations computed using this factorization may not be accurate. If the number is near 1
, the matrix is well-conditioned. For the condition number to be computed, the norm of the matrix must be computed at the time the factorization is constructed. If you set the optional boolean parameter in the RWTriDiagFact() constructor or the factor() member function to false
, calling condition() generates an exception.
|
related |
Calculates the reciprocal condition number of the matrix represented by the factorization A. If this number is near 0
, the matrix is ill-conditioned and solutions to systems of equations computed using this factorization may not be accurate. If the number is near 1
, the matrix is well-conditioned. For the condition number to be computed, the norm of the matrix must be computed at the time the factorization is constructed. If you set the optional boolean parameter in the RWTriDiagFact() constructor or the factor() member function to false
, calling condition() generates an exception.
|
related |
Calculates the reciprocal condition number of the matrix represented by the factorization A. If this number is near 0
, the matrix is ill-conditioned and solutions to systems of equations computed using this factorization may not be accurate. If the number is near 1
, the matrix is well-conditioned. For the condition number to be computed, the norm of the matrix must be computed at the time the factorization is constructed. If you set the optional boolean parameter in the RWTriDiagFact() constructor or the factor() member function to false
, calling condition() generates an exception.
|
related |
Calculates the determinant of the matrix represented by the factorization A.
|
related |
|
related |
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |