Skip to content

Commit 378595d

Browse files
committed
restarted the Tikhonov modules from scratch. Trying to use the new scirun5 structure
1 parent dd41eef commit 378595d

12 files changed

+762
-1128
lines changed

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

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,6 @@ using namespace SCIRun::Core::Logging;
5454
using namespace SCIRun::Core::Algorithms;
5555
using namespace SCIRun::Core::Algorithms::Inverse;
5656

57-
//// Class Constructor
58-
/////////////
59-
SolveInverseProblemWithTikhonovImpl_child::SolveInverseProblemWithTikhonovImpl_child(const DenseMatrixHandle& forwardMatrix,
60-
const DenseMatrixHandle& measuredData,
61-
AlgorithmChoice regularizationChoice,
62-
AlgorithmSolutionSubcase regularizationSolutionSubcase,
63-
AlgorithmResidualSubcase regularizationResidualSubcase,
64-
const DenseMatrixHandle sourceWeighting,
65-
const DenseMatrixHandle sensorWeighting,
66-
bool computeRegularizedInverse,
67-
LegacyLoggerInterface* pr)
68-
:TikhonovImplAbstractBase(forwardMatrix,
69-
measuredData,
70-
regularizationChoice,
71-
regularizationSolutionSubcase,
72-
regularizationResidualSubcase,
73-
sourceWeighting,
74-
sensorWeighting,
75-
computeRegularizedInverse,
76-
pr)
77-
{
78-
// prealocate matrices needed for computation
79-
preAlocateInverseMatrices();
80-
}
81-
//////////////////
82-
//////////
83-
8457

8558
/////////////////////////
8659
///////// compute Inverse solution
@@ -125,7 +98,7 @@ using namespace SCIRun::Core::Algorithms::Inverse;
12598

12699
/////// precomputeInverseMatrices
127100
///////////////
128-
void SolveInverseProblemWithTikhonovImpl_child::preAlocateInverseMatrices()
101+
void SolveInverseProblemWithTikhonovImpl_child::preAlocateInverseMatrices(SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_, SCIRun::Core::Datatypes::DenseMatrix& measuredData_ , SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_, SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_)
129102
{
130103

131104
// TODO: use DimensionMismatch exception where appropriate

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovImpl_child.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <Core/Datatypes/DenseMatrix.h>
4141
#include <Core/Datatypes/DenseColumnMatrix.h>
4242
#include <Core/Logging/LoggerFwd.h>
43-
#include <Core/Algorithms/Legacy/Inverse/TikhonovImplAbstractBase.h>
43+
#include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
4444
#include <Core/Algorithms/Legacy/Inverse/share.h>
4545

4646
namespace SCIRun {
@@ -52,15 +52,11 @@ namespace SCIRun {
5252
{
5353

5454
public:
55-
SolveInverseProblemWithTikhonovImpl_child(const SCIRun::Core::Datatypes::DenseMatrixHandle& forwardMatrix,
56-
const SCIRun::Core::Datatypes::DenseMatrixHandle& measuredData,
57-
AlgorithmChoice regularizationChoice = automatic,
58-
AlgorithmSolutionSubcase regularizationSolutionSubcase = solution_constrained,
59-
AlgorithmResidualSubcase regularizationResidualSubcase = residual_constrained,
60-
const SCIRun::Core::Datatypes::DenseMatrixHandle sourceWeighting = 0,
61-
const SCIRun::Core::Datatypes::DenseMatrixHandle sensorWeighting = 0,
62-
bool computeRegularizedInverse = false,
63-
SCIRun::Core::Logging::LegacyLoggerInterface* pr = 0);
55+
SolveInverseProblemWithTikhonovImpl_child() : TikhonovImplAbstractBase()
56+
{
57+
// prealocate matrices needed for computation
58+
preAlocateInverseMatrices();
59+
};
6460

6561
private:
6662

@@ -72,7 +68,7 @@ namespace SCIRun {
7268

7369

7470
SCIRun::Core::Datatypes::DenseColumnMatrix computeInverseSolution( double lambda_sq, bool inverseCalculation);
75-
void preAlocateInverseMatrices();
71+
void preAlocateInverseMatrices(SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_,SCIRun::Core::Datatypes::DenseMatrix& measuredData_ ,SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_,SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_);
7672
// bool checkInputMatrixSizes(); // DEFINED IN PARENT, MIGHT WANT TO OVERRIDE SOME OTHER TIME
7773

7874
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <Core/Utils/Exception.h>
4646

4747
// Tikhonov inverse libraries
48-
#include <Core/Algorithms/Legacy/Inverse/TikhonovImplAbstractBase.h>
48+
#include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
4949
// #include <Modules/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD.h>
5050
#include <Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD_impl.h>
5151

@@ -67,7 +67,7 @@ using namespace SCIRun::Core::Algorithms::Inverse;
6767
/////// prealocate Matrices for inverse compuation
6868
/// This function precalcualtes the SVD of the forward matrix and prepares singular vectors and values for posterior computations
6969
///////////////////////////////////////////////////////////////////
70-
void SolveInverseProblemWithTikhonovSVD_impl::preAlocateInverseMatrices()
70+
void SolveInverseProblemWithTikhonovSVD_impl::preAlocateInverseMatrices( SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_,SCIRun::Core::Datatypes::DenseMatrix& measuredData_ ,SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_,SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_)
7171
{
7272

7373
// Compute the SVD of the forward matrix

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

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include <Core/Datatypes/DenseColumnMatrix.h>
4444
#include <Core/Logging/LoggerFwd.h>
4545

46-
#include <Core/Algorithms/Legacy/Inverse/TikhonovImplAbstractBase.h>
46+
#include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
4747

4848
#include <Core/Algorithms/Legacy/Inverse/share.h>
4949

@@ -62,29 +62,9 @@ namespace SCIRun
6262

6363

6464
public:
65-
66-
SolveInverseProblemWithTikhonovSVD_impl( const SCIRun::Core::Datatypes::DenseMatrixHandle& forwardMatrix,
67-
const SCIRun::Core::Datatypes::DenseMatrixHandle& measuredData,
68-
AlgorithmChoice regularizationChoice = automatic,
69-
AlgorithmSolutionSubcase regularizationSolutionSubcase = solution_constrained,
70-
AlgorithmResidualSubcase regularizationResidualSubcase = residual_constrained,
71-
const SCIRun::Core::Datatypes::DenseMatrixHandle sourceWeighting = 0,
72-
const SCIRun::Core::Datatypes::DenseMatrixHandle sensorWeighting = 0,
73-
bool computeRegularizedInverse = false,
74-
SCIRun::Core::Logging::LegacyLoggerInterface* pr = 0)
75-
76-
: TikhonovImplAbstractBase( forwardMatrix,
77-
measuredData,
78-
automatic,
79-
solution_constrained,
80-
residual_constrained,
81-
0,
82-
0,
83-
computeRegularizedInverse,
84-
pr)
65+
SolveInverseProblemWithTikhonovSVD_impl() : TikhonovImplAbstractBase()
8566
{
8667
rank = 0;
87-
preAlocateInverseMatrices();
8868
};
8969

9070

@@ -100,7 +80,7 @@ namespace SCIRun
10080

10181

10282
SCIRun::Core::Datatypes::DenseColumnMatrix computeInverseSolution( double lambda_sq, bool inverseCalculation);
103-
void preAlocateInverseMatrices();
83+
void preAlocateInverseMatrices(SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_,SCIRun::Core::Datatypes::DenseMatrix& measuredData_ ,SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_,SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_);
10484
// bool checkInputMatrixSizes(); // DEFINED IN PARENT, MIGHT WANT TO OVERRIDE SOME OTHER TIME
10585

10686

0 commit comments

Comments
 (0)