Skip to content

Commit bed503e

Browse files
committed
Refactor and restyle
1 parent 158d0d6 commit bed503e

16 files changed

+313
-299
lines changed

Libs/Optimize/Function/CorrespondenceFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void CorrespondenceFunction::ComputeUpdates(const ParticleSystem* c) {
182182
}
183183
}
184184

185-
CorrespondenceFunction::VectorType CorrespondenceFunction::Evaluate(unsigned int idx, unsigned int d,
185+
CorrespondenceFunction::VectorType CorrespondenceFunction::evaluate(unsigned int idx, unsigned int d,
186186
const ParticleSystem* system, double& maxdt,
187187
double& energy) const {
188188
int dom = d % m_DomainsPerShape; // domain number within shape

Libs/Optimize/Function/CorrespondenceFunction.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,24 @@ class CorrespondenceFunction : public VectorFunction {
4747
third argument is the index of the particle location within the given
4848
domain. */
4949

50-
virtual VectorType Evaluate(unsigned int, unsigned int, const ParticleSystem*, double&, double&) const;
50+
virtual VectorType evaluate(unsigned int, unsigned int, const ParticleSystem*, double&, double&) const;
5151

52-
virtual VectorType Evaluate(unsigned int a, unsigned int b, const ParticleSystem* c, double& d) const {
52+
virtual VectorType evaluate(unsigned int a, unsigned int b, const ParticleSystem* c, double& d) const {
5353
double e;
54-
return this->Evaluate(a, b, c, d, e);
54+
return this->evaluate(a, b, c, d, e);
5555
}
5656

57-
virtual double Energy(unsigned int a, unsigned int b, const ParticleSystem* c) const {
57+
virtual double energy(unsigned int a, unsigned int b, const ParticleSystem* c) const {
5858
double e, d;
59-
this->Evaluate(a, b, c, d, e);
59+
this->evaluate(a, b, c, d, e);
6060
return e;
6161
}
6262

6363
/** Called before each iteration of a solver. */
64-
virtual void BeforeIteration() { this->ComputeUpdates(this->m_ParticleSystem); }
64+
virtual void before_iteration() { this->ComputeUpdates(this->particle_system_); }
6565

6666
/** Called after each iteration of the solver. */
67-
virtual void AfterIteration() {
67+
virtual void after_iteration() {
6868
// Update the annealing parameter.
6969
if (m_HoldMinimumVariance != true && !m_UseMeanEnergy) {
7070
m_Counter++;
@@ -97,7 +97,7 @@ class CorrespondenceFunction : public VectorFunction {
9797

9898
void SetAttributesPerDomain(const std::vector<int>& i) { m_AttributesPerDomain = i; }
9999

100-
void UseMeanEnergy() { m_UseMeanEnergy = true; }
100+
void UseMeanenergy() { m_UseMeanEnergy = true; }
101101
void UseEntropy() { m_UseMeanEnergy = false; }
102102

103103
void SetXYZ(int i, bool val) {
@@ -122,12 +122,12 @@ class CorrespondenceFunction : public VectorFunction {
122122
return flag;
123123
}
124124

125-
std::shared_ptr<VectorFunction> Clone() override {
125+
std::shared_ptr<VectorFunction> clone() override {
126126
auto copy = CorrespondenceFunction::New();
127127

128128
// from itkParticleVectorFunction
129-
copy->m_DomainNumber = this->m_DomainNumber;
130-
copy->m_ParticleSystem = this->m_ParticleSystem;
129+
copy->domain_number_ = this->domain_number_;
130+
copy->particle_system_ = this->particle_system_;
131131

132132
// local
133133
copy->m_AttributeScales = this->m_AttributeScales;

Libs/Optimize/Function/DisentangledCorrespondenceFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void DisentangledCorrespondenceFunction::ComputeCovarianceMatrices() {
220220

221221
}
222222

223-
DisentangledCorrespondenceFunction::VectorType DisentangledCorrespondenceFunction ::Evaluate(unsigned int idx, unsigned int d,
223+
DisentangledCorrespondenceFunction::VectorType DisentangledCorrespondenceFunction ::evaluate(unsigned int idx, unsigned int d,
224224
const ParticleSystem* system,
225225
double& maxdt,
226226
double& energy) const {

Libs/Optimize/Function/DisentangledCorrespondenceFunction.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ class DisentangledCorrespondenceFunction : public VectorFunction {
3636
argument is the index of the domain within that particle system. The
3737
third argument is the index of the particle location within the given
3838
domain. */
39-
virtual VectorType Evaluate(unsigned int, unsigned int, const ParticleSystem*, double&, double&) const;
40-
virtual VectorType Evaluate(unsigned int a, unsigned int b, const ParticleSystem* c, double& d) const {
39+
virtual VectorType evaluate(unsigned int, unsigned int, const ParticleSystem*, double&, double&) const;
40+
virtual VectorType evaluate(unsigned int a, unsigned int b, const ParticleSystem* c, double& d) const {
4141
double e;
42-
return this->Evaluate(a, b, c, d, e);
42+
return this->evaluate(a, b, c, d, e);
4343
}
4444

45-
virtual double Energy(unsigned int a, unsigned int b, const ParticleSystem* c) const {
45+
virtual double energy(unsigned int a, unsigned int b, const ParticleSystem* c) const {
4646
double e, d;
47-
this->Evaluate(a, b, c, d, e);
47+
this->evaluate(a, b, c, d, e);
4848
return e;
4949
}
5050

@@ -59,17 +59,17 @@ class DisentangledCorrespondenceFunction : public VectorFunction {
5959
const ShapeMatrixType* GetShapeMatrix() const { return m_ShapeMatrix.GetPointer(); }
6060

6161
/** Called before each iteration of a solver. */
62-
virtual void BeforeIteration() {
63-
m_ShapeMatrix->BeforeIteration();
62+
virtual void before_iteration() {
63+
m_ShapeMatrix->before_iteration();
6464

6565
if (m_Counter == 0) {
6666
this->ComputeCovarianceMatrices();
6767
}
6868
}
6969

7070
/** Called after each iteration of the solver. */
71-
virtual void AfterIteration() {
72-
m_ShapeMatrix->AfterIteration();
71+
virtual void after_iteration() override {
72+
m_ShapeMatrix->after_iteration();
7373
// Update the annealing parameter.
7474
if (m_HoldMinimumVariance != true && !m_UseMeanEnergy) {
7575
m_Counter++;
@@ -93,7 +93,7 @@ class DisentangledCorrespondenceFunction : public VectorFunction {
9393

9494
void PrintShapeMatrix() { m_ShapeMatrix->PrintMatrix(); }
9595

96-
void UseMeanEnergy() { m_UseMeanEnergy = true; }
96+
void UseMeanenergy() { m_UseMeanEnergy = true; }
9797
void UseEntropy() { m_UseMeanEnergy = false; }
9898

9999
/** */
@@ -103,7 +103,7 @@ class DisentangledCorrespondenceFunction : public VectorFunction {
103103
void SetRecomputeCovarianceInterval(int i) { m_RecomputeCovarianceInterval = i; }
104104
int GetRecomputeCovarianceInterval() const { return m_RecomputeCovarianceInterval; }
105105

106-
std::shared_ptr<VectorFunction> Clone() override {
106+
std::shared_ptr<VectorFunction> clone() override {
107107
auto copy = DisentangledCorrespondenceFunction::New();
108108

109109
copy->m_Shape_PointsUpdate = this->m_Shape_PointsUpdate;
@@ -118,8 +118,8 @@ class DisentangledCorrespondenceFunction : public VectorFunction {
118118
copy->m_RecomputeCovarianceInterval = this->m_RecomputeCovarianceInterval;
119119
copy->m_Counter = m_Counter;
120120

121-
copy->m_DomainNumber = this->m_DomainNumber;
122-
copy->m_ParticleSystem = this->m_ParticleSystem;
121+
copy->domain_number_ = this->domain_number_;
122+
copy->particle_system_ = this->particle_system_;
123123
copy->m_ShapeMatrix = this->m_ShapeMatrix;
124124

125125

0 commit comments

Comments
 (0)