#include <KernelSolution.h>
Definition at line 31 of file KernelSolution.h.
◆ ImageT
◆ PixelT
◆ Ptr
◆ ConditionNumberType
◆ KernelSolvedBy
Enumerator |
---|
NONE | |
CHOLESKY_LDLT | |
CHOLESKY_LLT | |
LU | |
EIGENVECTOR | |
Definition at line 37 of file KernelSolution.h.
◆ KernelSolution() [1/3]
lsst::ip::diffim::KernelSolution::KernelSolution |
( |
Eigen::MatrixXd |
mMat, |
|
|
Eigen::VectorXd |
bVec, |
|
|
bool |
fitForBackground |
|
) |
| |
|
explicit |
◆ KernelSolution() [2/3]
lsst::ip::diffim::KernelSolution::KernelSolution |
( |
bool |
fitForBackground | ) |
|
|
explicit |
◆ KernelSolution() [3/3]
lsst::ip::diffim::KernelSolution::KernelSolution |
( |
| ) |
|
|
explicit |
◆ ~KernelSolution()
virtual lsst::ip::diffim::KernelSolution::~KernelSolution |
( |
| ) |
|
|
inlinevirtual |
◆ getB()
Eigen::VectorXd const& lsst::ip::diffim::KernelSolution::getB |
( |
| ) |
|
|
inline |
◆ getConditionNumber() [1/2]
double lsst::ip::diffim::KernelSolution::getConditionNumber |
( |
ConditionNumberType |
conditionType | ) |
|
|
virtual |
◆ getConditionNumber() [2/2]
double lsst::ip::diffim::KernelSolution::getConditionNumber |
( |
Eigen::MatrixXd const & |
mMat, |
|
|
ConditionNumberType |
conditionType |
|
) |
| |
|
virtual |
Definition at line 98 of file KernelSolution.cc.
100 switch (conditionType) {
103 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> eVecValues(mMat);
104 Eigen::VectorXd eValues = eVecValues.eigenvalues();
105 double eMax = eValues.maxCoeff();
106 double eMin = eValues.minCoeff();
107 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelSolution.getConditionNumber",
108 "EIGENVALUE eMax / eMin = %.3e", eMax / eMin);
109 return (eMax / eMin);
114 Eigen::VectorXd sValues = mMat.jacobiSvd().singularValues();
115 double sMax = sValues.maxCoeff();
116 double sMin = sValues.minCoeff();
117 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelSolution.getConditionNumber",
118 "SVD eMax / eMin = %.3e", sMax / sMin);
119 return (sMax / sMin);
125 "Undefined ConditionNumberType : only EIGENVALUE, SVD allowed.");
◆ getId()
int lsst::ip::diffim::KernelSolution::getId |
( |
| ) |
const |
|
inline |
◆ getM()
Eigen::MatrixXd const& lsst::ip::diffim::KernelSolution::getM |
( |
| ) |
|
|
inline |
◆ getSolvedBy()
◆ printA()
void lsst::ip::diffim::KernelSolution::printA |
( |
| ) |
|
|
inline |
◆ printB()
void lsst::ip::diffim::KernelSolution::printB |
( |
| ) |
|
|
inline |
◆ printM()
void lsst::ip::diffim::KernelSolution::printM |
( |
| ) |
|
|
inline |
◆ solve() [1/2]
void lsst::ip::diffim::KernelSolution::solve |
( |
| ) |
|
|
virtual |
◆ solve() [2/2]
void lsst::ip::diffim::KernelSolution::solve |
( |
Eigen::MatrixXd const & |
mMat, |
|
|
Eigen::VectorXd const & |
bVec |
|
) |
| |
|
virtual |
Definition at line 131 of file KernelSolution.cc.
141 Eigen::VectorXd aVec = Eigen::VectorXd::Zero(bVec.size());
146 LOGL_DEBUG(
"TRACE2.ip.diffim.KernelSolution.solve",
147 "Solving for kernel");
149 Eigen::FullPivLU<Eigen::MatrixXd> lu(mMat);
150 if (lu.isInvertible()) {
151 aVec = lu.solve(bVec);
153 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelSolution.solve",
154 "Unable to determine kernel via LU");
159 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> eVecValues(mMat);
160 Eigen::MatrixXd
const& rMat = eVecValues.eigenvectors();
161 Eigen::VectorXd eValues = eVecValues.eigenvalues();
163 for (
int i = 0; i != eValues.rows(); ++i) {
164 if (eValues(i) != 0.0) {
165 eValues(i) = 1.0/eValues(i);
169 aVec = rMat * eValues.asDiagonal() * rMat.transpose() * bVec;
173 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelSolution.solve",
174 "Unable to determine kernel via eigen-values");
180 double time = t.elapsed();
181 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelSolution.solve",
182 "Compute time for matrix math : %.2f s", time);
◆ _aVec
Eigen::VectorXd lsst::ip::diffim::KernelSolution::_aVec |
|
protected |
◆ _bVec
Eigen::VectorXd lsst::ip::diffim::KernelSolution::_bVec |
|
protected |
◆ _fitForBackground
bool lsst::ip::diffim::KernelSolution::_fitForBackground |
|
protected |
◆ _id
int lsst::ip::diffim::KernelSolution::_id |
|
protected |
◆ _mMat
Eigen::MatrixXd lsst::ip::diffim::KernelSolution::_mMat |
|
protected |
◆ _SolutionId
int lsst::ip::diffim::KernelSolution::_SolutionId = 0 |
|
staticprotected |
◆ _solvedBy
The documentation for this class was generated from the following files:
- /j/snowflake/release/lsstsw/stack/1a1d771/Linux64/ip_diffim/20.0.0/include/lsst/ip/diffim/KernelSolution.h
- /j/snowflake/release/lsstsw/stack/1a1d771/Linux64/ip_diffim/20.0.0/src/KernelSolution.cc