Skip to content

Commit 63c698e

Browse files
committed
multiple time instances implemented. Had to fix some bugs in Tikhonv SVD and TSVD
1 parent f47f242 commit 63c698e

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithStandardTikhonovImpl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ using namespace SCIRun::Core::Algorithms::Inverse;
7575
const int numTimeSamples = y.ncols();
7676
DenseMatrix inverseG(sizeB,sizeB);
7777

78-
DenseColumnMatrix b(sizeB);
78+
DenseMatrix b(sizeB);
7979
DenseMatrix solution(sizeSolution,numTimeSamples);
8080
DenseMatrix G;
8181

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD_impl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ SCIRun::Core::Datatypes::DenseMatrix SolveInverseProblemWithTikhonovSVD_impl::co
125125
{
126126
// evaluate filter factor
127127
double singVal = svd_SingularValues[rr];
128-
double filterFactor_i = singVal / ( lambda * lambda + singVal * singVal ) * Uy(rr);
128+
double filterFactor_i = singVal / ( lambda * lambda + singVal * singVal );
129129

130130
// u[date solution
131-
solution += filterFactor_i * svd_MatrixV.col(rr);
131+
solution += filterFactor_i * svd_MatrixV.col(rr) * Uy.row(rr);
132132

133133
// update inverse operator
134134
if (inverseCalculation)

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovTSVD_impl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ SCIRun::Core::Datatypes::DenseMatrix SolveInverseProblemWithTikhonovTSVD_impl::c
128128
{
129129
// evaluate filter factor
130130
double singVal = svd_SingularValues[rr];
131-
double filterFactor_i = 1 / ( singVal ) * Uy(rr);
131+
auto filterFactor_i = 1 / ( singVal );
132132

133133
// u[date solution
134-
solution += filterFactor_i * svd_MatrixV.col(rr);
134+
solution += filterFactor_i * svd_MatrixV.col(rr) * Uy.row(rr);
135135

136136
// update inverse operator
137137
if (inverseCalculation)

src/Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ bool TikhonovAlgoAbstractBase::checkInputMatrixSizes( const AlgorithmInput & inp
132132
return false;
133133
}
134134

135-
// check that number of time samples is 1. @JCOLLFONT to change for a more general case later (should add a for loop)
136-
if (1 != measuredData_->ncols())
137-
{
138-
THROW_ALGORITHM_INPUT_ERROR("Measured data must be a vector");
139-
return false;
140-
}
135+
// // check that number of time samples is 1. @JCOLLFONT to change for a more general case later (should add a for loop)
136+
// if (1 != measuredData_->ncols())
137+
// {
138+
// THROW_ALGORITHM_INPUT_ERROR("Measured data must be a vector");
139+
// return false;
140+
// }
141141

142142
// check source regularization matrix sizes
143143
if (sourceWeighting_)

src/Modules/Legacy/Inverse/SolveInverseProblemWithTikhonovTSVD.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ void SolveInverseProblemWithTikhonovTSVD::execute()
127127
setAlgoOptionFromState(Parameters::RegularizationMethod);
128128
setAlgoDoubleFromState(Parameters::LambdaFromDirectEntry);
129129
// state->setValue(Parameters::LambdaMin,1);
130-
// state->setValue(Parameters::LambdaMax,double(rank)); // casting to double to keep consistency across tikhonov types
131-
// state->setValue(Parameters::LambdaNum, rank); // casting to double to keep consistency across tikhonov types
130+
state->setValue(Parameters::LambdaMax,double(rank)); // casting to double to keep consistency across tikhonov types
131+
state->setValue(Parameters::LambdaNum, rank); // casting to double to keep consistency across tikhonov types
132132
// state->setValue( Parameters::LambdaResolution, 1);
133133
setAlgoDoubleFromState(Parameters::LambdaMin);
134134
setAlgoDoubleFromState(Parameters::LambdaMax);

0 commit comments

Comments
 (0)