![]() |
SG++-Doxygen-Documentation
|
Class to solve the system of equations with a LL'-decomposed matrix. More...
#include <DBMatDMSChol.hpp>
Public Member Functions | |
void | choleskyDowndate (sgpp::base::DataMatrix &decompMatrix, const sgpp::base::DataVector &downdate, bool do_cv=false) const |
Performe a rank one cholesky downdate. | |
void | choleskyUpdate (sgpp::base::DataMatrix &decompMatrix, const sgpp::base::DataVector &update, bool do_cv=false) const |
Performe a rank one cholesky update. | |
DBMatDMSChol ()=default | |
Default constructor. | |
virtual void | solve (sgpp::base::DataMatrix &decompMatrix, sgpp::base::DataVector &alpha, const sgpp::base::DataVector &b, double lambda_old, double lambda_new) const |
Solves a system of equations. | |
void | solveParallel (DataMatrixDistributed &decompMatrix, DataVectorDistributed &x, double lambda_old, double lambda_new) const |
Parallel (distributed) version of solve. | |
![]() | |
DBMatDecompMatrixSolver () | |
![]() | |
double | getEpsilon () |
gets the the epsilon, that is used in the SGSolver | |
size_t | getNumberIterations () |
function that returns the number of needed solve steps | |
double | getResiduum () |
function the returns the residuum (current or final), error of the solver | |
void | setEpsilon (double eps) |
resets the epsilon, that is used in the SGSolver | |
void | setMaxIterations (size_t nIterations) |
resets the number of maximum iterations | |
SGSolver (size_t nMaximumIterations, double epsilon) | |
Std-Constructor. | |
virtual | ~SGSolver () |
Std-Destructor. | |
Protected Member Functions | |
virtual void | choleskyBackwardSolve (const sgpp::base::DataMatrix &decompMatrix, const sgpp::base::DataVector &y, sgpp::base::DataVector &alpha) const |
Perform Backward substitution solving the triangular system $A alpha = y$. | |
virtual void | choleskyForwardSolve (const sgpp::base::DataMatrix &decompMatrix, const sgpp::base::DataVector &b, sgpp::base::DataVector &y) const |
Perform forward substitution solving the triangular system $L y = b$. | |
virtual void | choleskyUpdateLambda (sgpp::base::DataMatrix &decompMatrix, double lambdaUpdate) const |
Update the decomposition if the regularization parameter changes. | |
Additional Inherited Members | |
![]() | |
double | myEpsilon |
epsilon needed in the, e.g. final error in the iterative solver, or a timestep | |
size_t | nIterations |
Number of Iterations needed for the solve. | |
size_t | nMaxIterations |
Number of maximum iterations for cg. | |
double | residuum |
residuum | |
Class to solve the system of equations with a LL'-decomposed matrix.
|
default |
Default constructor.
|
protectedvirtual |
Perform Backward substitution solving the triangular system $A alpha = y$.
decompMatrix | Triangular matrix |
y | right hand side obtained by forward substitution |
alpha | the vector of unknowns we solve for |
Reimplemented in sgpp::datadriven::DBMatDMSDenseIChol.
References alpha, sgpp::base::DataMatrix::get(), and sgpp::base::DataMatrix::getNcols().
Referenced by solve().
void sgpp::datadriven::DBMatDMSChol::choleskyDowndate | ( | sgpp::base::DataMatrix & | decompMatrix, |
const sgpp::base::DataVector & | downdate, | ||
bool | do_cv = false |
||
) | const |
Performe a rank one cholesky downdate.
decompMatrix | the LL' lower triangular cholesky factor |
downdate | the vector representing the rank one matrix (xx') |
do_cv | indicating if updates are used for cross valdiation (using special structure of update vectors to save runtime) |
References sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::base::DataVector::getPointer(), sgpp::base::DataVector::getSize(), and m.
Referenced by choleskyUpdateLambda().
|
protectedvirtual |
Perform forward substitution solving the triangular system $L y = b$.
decompMatrix | Triangular matrix |
b | right hand side of our initial system matrix we solve for |
y | the vector of unknowns we solve for |
Reimplemented in sgpp::datadriven::DBMatDMSDenseIChol.
References sgpp::base::DataMatrix::get(), and sgpp::base::DataMatrix::getNcols().
Referenced by solve().
void sgpp::datadriven::DBMatDMSChol::choleskyUpdate | ( | sgpp::base::DataMatrix & | decompMatrix, |
const sgpp::base::DataVector & | update, | ||
bool | do_cv = false |
||
) | const |
Performe a rank one cholesky update.
decompMatrix | the LL' lower triangular cholesky factor |
update | the vector representing the rank one matrix (xx') |
do_cv | indicating if updates are used for cross valdiation (using special structure of update vectors to save runtime) |
References sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::base::DataVector::getPointer(), sgpp::base::DataVector::getSize(), and m.
Referenced by sgpp::datadriven::DBMatOfflineChol::choleskyModification(), and choleskyUpdateLambda().
|
protectedvirtual |
Update the decomposition if the regularization parameter changes.
This may be more expensive then recalculating the decomposition.
decompMatrix | decomposed matrix to be modified |
lambdaUpdate | the value by which the regularization parameter modifies the diagonal. |
Reimplemented in sgpp::datadriven::DBMatDMSDenseIChol.
References choleskyDowndate(), choleskyUpdate(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataVector::set(), and sgpp::base::DataVector::setAll().
Referenced by solve(), and solveParallel().
|
virtual |
Solves a system of equations.
decompMatrix | the LL' lower triangular cholesky factor |
alpha | the vector of unknowns (the result is stored there) |
b | the right hand vector of the equation system |
lambda_old | the current regularization paramter |
lambda_new | the new regularization paramter (e.g. if cross-validation is applied) |
References alpha, choleskyBackwardSolve(), choleskyForwardSolve(), choleskyUpdateLambda(), and sgpp::base::DataMatrix::getNcols().
Referenced by sgpp::datadriven::DBMatOnlineDEChol::solveSLE().
void sgpp::datadriven::DBMatDMSChol::solveParallel | ( | DataMatrixDistributed & | decompMatrix, |
DataVectorDistributed & | x, | ||
double | lambda_old, | ||
double | lambda_new | ||
) | const |
Parallel (distributed) version of solve.
decompMatrix | the LL' lower triangular cholesky factor |
x | input: the right hand vector of the equation system, output: the vector of unknowns (the result is stored there) |
lambda_old | the current regularization paramter |
lambda_new | the new regularization paramter (e.g. if cross-validation is applied) |
References choleskyUpdateLambda(), sgpp::datadriven::DataMatrixDistributed::distribute(), sgpp::datadriven::DataMatrixDistributed::getProcessGrid(), sgpp::datadriven::DataMatrixDistributed::solveCholesky(), and sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrix().