Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
2300036d
Commit
2300036d
authored
13 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
ENH: methods which do not access attributes must be static
parent
c2765fab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Hyperspectral/otbMDMDNMFImageFilter.h
+16
-16
16 additions, 16 deletions
Code/Hyperspectral/otbMDMDNMFImageFilter.h
Code/Hyperspectral/otbMDMDNMFImageFilter.txx
+11
-11
11 additions, 11 deletions
Code/Hyperspectral/otbMDMDNMFImageFilter.txx
with
27 additions
and
27 deletions
Code/Hyperspectral/otbMDMDNMFImageFilter.h
+
16
−
16
View file @
2300036d
...
...
@@ -198,37 +198,37 @@ private:
MDMDNMFImageFilter
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
void
AddOneRowOfOnes
(
const
MatrixType
&
m
,
MatrixType
&
M
)
const
;
static
void
AddOneRowOfOnes
(
const
MatrixType
&
m
,
MatrixType
&
M
);
double
Criterion
(
const
MatrixType
&
X
,
static
double
Criterion
(
const
MatrixType
&
X
,
const
MatrixType
&
A
,
const
MatrixType
&
S
,
const
double
&
delt
,
const
double
&
lambdS
,
const
double
&
lambdD
)
const
;
const
double
&
lambdD
);
void
EvalGradS
(
const
MatrixType
&
X
,
static
void
EvalGradS
(
const
MatrixType
&
X
,
const
MatrixType
&
A
,
const
MatrixType
&
S
,
const
double
&
delt
,
const
double
&
lambdS
,
MatrixType
&
gradS
)
const
;
MatrixType
&
gradS
);
void
EvalGradA
(
const
MatrixType
&
X
,
static
void
EvalGradA
(
const
MatrixType
&
X
,
const
MatrixType
&
A
,
const
MatrixType
&
S
,
const
double
&
delt
,
const
double
&
lambdD
,
MatrixType
&
gradA
)
const
;
MatrixType
&
gradA
);
double
Call
(
const
MatrixType
&
variMat
,
static
double
Call
(
const
MatrixType
&
variMat
,
const
MatrixType
&
fixedMat
,
const
MatrixType
&
X
,
const
double
&
delt
,
const
double
&
lambdS
,
const
double
&
lambdD
,
const
bool
isDirectEvalDirection
)
const
;
const
double
&
lambdD
,
const
bool
isDirectEvalDirection
);
void
ProjGradOneStep
(
static
void
ProjGradOneStep
(
const
MatrixType
&
X
,
const
MatrixType
&
fixedMat
,
const
MatrixType
&
gradVariMat
,
...
...
@@ -238,21 +238,21 @@ private:
const
double
&
lambdS
,
const
double
&
lambdD
,
MatrixType
&
variMat
,
double
&
alph
,
const
bool
isDirectEvalDirection
)
const
;
double
&
alph
,
const
bool
isDirectEvalDirection
);
void
SetNegativeCoefficientsToZero
(
MatrixType
&
M
)
const
;
static
void
SetNegativeCoefficientsToZero
(
MatrixType
&
M
);
MatrixType
TermByTermMatrixProduct
(
const
MatrixType
&
M1
,
const
MatrixType
&
M2
)
const
;
static
MatrixType
TermByTermMatrixProduct
(
const
MatrixType
&
M1
,
const
MatrixType
&
M2
);
double
SumMatrixElements
(
const
MatrixType
&
M
)
const
;
static
double
SumMatrixElements
(
const
MatrixType
&
M
);
bool
ArmijoTest
(
const
double
&
sig
,
static
bool
ArmijoTest
(
const
double
&
sig
,
const
MatrixType
variMat
,
const
MatrixType
&
newVariMat
,
const
double
&
evalf
,
const
double
&
newEvalf
,
const
MatrixType
&
gradVariMat
,
const
double
&
alph
)
const
;
const
double
&
alph
);
// attributes
MatrixType
m_Endmembers
;
...
...
This diff is collapsed.
Click to expand it.
Code/Hyperspectral/otbMDMDNMFImageFilter.txx
+
11
−
11
View file @
2300036d
...
...
@@ -69,7 +69,7 @@ template <class TInputImage, class TOutputImage>
void
MDMDNMFImageFilter<TInputImage, TOutputImage>
::AddOneRowOfOnes(const MatrixType & m,
MatrixType & M)
const
MatrixType & M)
{
M.set_size(m.rows()+1, m.cols());
...
...
@@ -89,7 +89,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
const MatrixType & S,
const double &m_Delt,
const double &m_LambdS,
const double &m_LambdD)
const
const double &m_LambdD)
{
// This function computes
// f = ||Xsu-Asu.S||_2^2 -
...
...
@@ -166,7 +166,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
const MatrixType &S,
const double &m_Delt,
const double &m_LambdS,
MatrixType & gradS)
const
MatrixType & gradS)
{
// Calculus of: gradS = 2 * Asu' * (Asu*S-Xsu) - lambd * 2 * (S - 1/J*ones(J,I));
...
...
@@ -189,7 +189,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
const MatrixType &S,
const double &m_Delt,
const double &m_LambdD,
MatrixType &gradA)
const
MatrixType &gradA)
{
// Compute gradA
// = (A*S-X) * (transpose(S)) + m_LambdD*(A-1/nbBands*ones(L,L)*A)
...
...
@@ -233,11 +233,11 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
const double & m_LambdS,
const double & m_LambdD,
MatrixType & variMat,
double & alph, const bool isDirectEvalDirection )
const
double & alph, const bool isDirectEvalDirection )
{
double evalf, newEvalf, bet;
evalf =
this->
Call(variMat, fixedMat, X, m_Delt, m_LambdS, m_LambdD, isDirectEvalDirection); // compute evalf
evalf = Call(variMat, fixedMat, X, m_Delt, m_LambdS, m_LambdD, isDirectEvalDirection); // compute evalf
MatrixType newVariMat = variMat - alph*gradVariMat;
SetNegativeCoefficientsToZero(newVariMat);
...
...
@@ -286,7 +286,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
const MatrixType & X,
const double & m_Delt,
const double & m_LambdS,
const double & m_LambdD, const bool isDirectEvalDirection)
const
const double & m_LambdD, const bool isDirectEvalDirection)
{
double evalf;
if ( isDirectEvalDirection )
...
...
@@ -304,7 +304,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
template <class TInputImage, class TOutputImage>
void
MDMDNMFImageFilter<TInputImage, TOutputImage>
::SetNegativeCoefficientsToZero(MatrixType & M)
const
::SetNegativeCoefficientsToZero(MatrixType & M)
{
for (unsigned int i=0; i<M.rows(); ++i)
{
...
...
@@ -320,7 +320,7 @@ template <class TInputImage, class TOutputImage>
typename MDMDNMFImageFilter<TInputImage, TOutputImage>
::MatrixType
MDMDNMFImageFilter<TInputImage, TOutputImage>
::TermByTermMatrixProduct(const MatrixType & M1, const MatrixType & M2)
const
::TermByTermMatrixProduct(const MatrixType & M1, const MatrixType & M2)
{
MatrixType M;
M.set_size(M1.rows(), M1.cols());
...
...
@@ -337,7 +337,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
template <class TInputImage, class TOutputImage>
double
MDMDNMFImageFilter<TInputImage, TOutputImage>
::SumMatrixElements(const MatrixType & M)
const
::SumMatrixElements(const MatrixType & M)
{
double sum = 0;
for (unsigned int i = 0; i<M.cols(); ++i)
...
...
@@ -356,7 +356,7 @@ MDMDNMFImageFilter<TInputImage, TOutputImage>
const double & evalf,
const double & newEvalf,
const MatrixType & gradVariMat,
const double & alph)
const
const double & alph)
{
bool bit;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment