Aim: Used to minimize the angle variation between different angles while taking into accounts min and max constraints. Example (.
More...
#include <DGtal/math/AngleLinearMinimizer.h>
|
virtual void | oneStep (unsigned int i1, unsigned int i2) |
|
Aim: Used to minimize the angle variation between different angles while taking into accounts min and max constraints. Example (.
Description of class 'AngleLinearMinimizer'
- See also
- math/testAngleLinearMinimizer.cpp)
double delta= alm.optimize();
double aPrecision=0.00001;
while(delta >aPrecision){
delta= alm.optimize();
cerr << "sum of displacements " << delta << endl;
}
Definition at line 67 of file AngleLinearMinimizer.h.
◆ ~AngleLinearMinimizer()
virtual DGtal::AngleLinearMinimizer::~AngleLinearMinimizer |
( |
| ) |
|
|
virtual |
◆ AngleLinearMinimizer() [1/2]
DGtal::AngleLinearMinimizer::AngleLinearMinimizer |
( |
| ) |
|
◆ AngleLinearMinimizer() [2/2]
Copy constructor.
- Parameters
-
other | the object to clone. Forbidden by default. |
◆ className()
std::string DGtal::AngleLinearMinimizer::className |
( |
| ) |
const |
- Returns
- the style name used for drawing this object.
◆ getEnergy()
double DGtal::AngleLinearMinimizer::getEnergy |
( |
unsigned int |
i1, |
|
|
unsigned int |
i2 |
|
) |
| const |
- Parameters
-
i1 | the first value to be optimized (between 0 and 'size()-1'). |
i2 | the value after the last to be optimized (between 0 and 'size()-1') |
- Returns
- the current energy of the system.
◆ getFormerEnergy()
double DGtal::AngleLinearMinimizer::getFormerEnergy |
( |
unsigned int |
i1, |
|
|
unsigned int |
i2 |
|
) |
| const |
- Parameters
-
i1 | the first value to be optimized (between 0 and 'size()-1'). |
i2 | the value after the last to be optimized (between 0 and 'size()-1') |
- Returns
- the former energy of the system.
◆ getFormerGradient()
std::vector<double> DGtal::AngleLinearMinimizer::getFormerGradient |
( |
| ) |
const |
- Returns
- the energy gradient computed at the former position.
◆ getGradient()
std::vector<double> DGtal::AngleLinearMinimizer::getGradient |
( |
| ) |
const |
- Returns
- the energy gradient computed at the current position.
◆ init()
void DGtal::AngleLinearMinimizer::init |
( |
unsigned int |
nbMax | ) |
|
(Re-)initializes the linear minimizer.
- Parameters
-
nbMax | an upper bound for the number of values to optimize. |
Referenced by testAngleLinearMinimizer().
◆ isValid()
bool DGtal::AngleLinearMinimizer::isValid |
( |
| ) |
const |
Checks the validity/consistency of the object.
- Returns
- 'true' if the object is valid, 'false' otherwise.
◆ lastDelta()
virtual double DGtal::AngleLinearMinimizer::lastDelta |
( |
| ) |
const |
|
virtual |
◆ max()
double DGtal::AngleLinearMinimizer::max |
( |
| ) |
const |
Max of all the absolute displacements of the last optimisation step.
◆ maxSize()
unsigned int DGtal::AngleLinearMinimizer::maxSize |
( |
| ) |
const |
- Returns
- the maximum number of values stored in the object.
◆ oneStep()
virtual void DGtal::AngleLinearMinimizer::oneStep |
( |
unsigned int |
i1, |
|
|
unsigned int |
i2 |
|
) |
| |
|
protectedvirtual |
◆ operator=()
Assignment.
- Parameters
-
- Returns
- a reference on 'this'. Forbidden by default.
◆ optimize() [1/2]
double DGtal::AngleLinearMinimizer::optimize |
( |
| ) |
|
Move each value on the straight line joining its neighboring values while maintaining the value between its bounds. The optimization is performed on all values. After preparing datas, calls oneStep, which may be overriden.
- Returns
- the sum of the displacements.
- See also
- oneStep
Referenced by testAngleLinearMinimizer().
◆ optimize() [2/2]
double DGtal::AngleLinearMinimizer::optimize |
( |
unsigned int |
i1, |
|
|
unsigned int |
i2 |
|
) |
| |
Move each value on the straight line joining its neighboring values while maintaining the value between its bounds. The optimization is performed on values [i1] included to [i2] excluded. After preparing datas, calls oneStep, which may be overriden. Then, computes max and sum of displacements.
- Parameters
-
i1 | the first value to be optimized (between 0 and 'size()-1'). |
i2 | the value after the last to be optimized (between 0 and 'size()-1'). |
- Returns
- the sum of the displacements.
- See also
- oneStep
◆ reset()
void DGtal::AngleLinearMinimizer::reset |
( |
| ) |
|
Reset all. The object is as if it has just been created.
◆ ro()
const ValueInfo& DGtal::AngleLinearMinimizer::ro |
( |
unsigned int |
i | ) |
const |
◆ rw()
ValueInfo& DGtal::AngleLinearMinimizer::rw |
( |
unsigned int |
i | ) |
|
◆ selfDisplay()
void DGtal::AngleLinearMinimizer::selfDisplay |
( |
std::ostream & |
out | ) |
const |
Writes/Displays the object on an output stream.
- Parameters
-
out | the output stream where the object is written. |
◆ setIsCurveOpen()
void DGtal::AngleLinearMinimizer::setIsCurveOpen |
( |
bool |
is_curve_open = false | ) |
|
Specifies if the curve is open or not.
- Parameters
-
is_curve_open | when 'true' the curve is open and the last value does not depend on the first one, otherwise the curve is closed and the last value is linked to the first one. |
Referenced by testAngleLinearMinimizer().
◆ setSize()
void DGtal::AngleLinearMinimizer::setSize |
( |
unsigned int |
nb | ) |
|
Specifies the exact number of valid values.
- Parameters
-
◆ size()
unsigned int DGtal::AngleLinearMinimizer::size |
( |
| ) |
const |
- Returns
- the number of values stored in the object.
◆ sum()
double DGtal::AngleLinearMinimizer::sum |
( |
| ) |
const |
Sum of all the absolute displacements of the last optimisation step.
◆ myIsCurveOpen
bool DGtal::AngleLinearMinimizer::myIsCurveOpen |
|
protected |
◆ myMax
double DGtal::AngleLinearMinimizer::myMax |
|
private |
◆ myMaxSize
unsigned int DGtal::AngleLinearMinimizer::myMaxSize |
|
private |
The size of the array myValues, ie the maximal number of valid values.
Definition at line 316 of file AngleLinearMinimizer.h.
◆ mySize
unsigned int DGtal::AngleLinearMinimizer::mySize |
|
protected |
The meaningful size of the array [myValues], ie the number of valid entries.
Definition at line 309 of file AngleLinearMinimizer.h.
◆ mySum
double DGtal::AngleLinearMinimizer::mySum |
|
private |
◆ myValues
ValueInfo* DGtal::AngleLinearMinimizer::myValues |
|
protected |
The dynamically allocated array of values and the associated constraints.
Definition at line 303 of file AngleLinearMinimizer.h.
The documentation for this class was generated from the following file: