Chemical Data Processing Library Python API - Version 1.1.1
Classes | Public Member Functions | Properties | List of all members
CDPL.Math.FVectorBFGSMinimizer Class Reference

Fletcher's implementation of the BFGS method. More...

+ Inheritance diagram for CDPL.Math.FVectorBFGSMinimizer:

Classes

class  Status
 

Public Member Functions

None __init__ (FloatFVectorFunctor func, object grad_func)
 Initializes the FVectorBFGSMinimizer instance. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
float getGradientNorm ()
 
float getFunctionDelta ()
 
float getFunctionValue ()
 
int getNumIterations ()
 
Status getStatus ()
 
Status minimize (FVector x, FVector g, int max_iter, float g_norm, float delta_f, bool do_setup=True)
 
float setup (FVector x, FVector g, float step_size=0.001, float tol=0.15)
 
tuple iterate (float f, FVector x, FVector g)
 

Properties

 objectID = property(getObjectID)
 
 gradientNorm = property(getGradientNorm)
 
 functionDelta = property(getFunctionDelta)
 
 functionValue = property(getFunctionValue)
 
 numIterations = property(getNumIterations)
 
 status = property(getStatus)
 

Detailed Description

Fletcher's implementation of the BFGS method.

The implementation has been taken from the GNU Scientific Library.

See also
R. Fletcher, "Practical Method's of Optimization", Second Edition, ISBN 0471915475. Algorithms 2.6.2 and 2.6.4.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Math.FVectorBFGSMinimizer.__init__ ( FloatFVectorFunctor  func,
object  grad_func 
)

Initializes the FVectorBFGSMinimizer instance.

Parameters
func
grad_func

Member Function Documentation

◆ getObjectID()

int CDPL.Math.FVectorBFGSMinimizer.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python FVectorBFGSMinimizer instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two FVectorBFGSMinimizer instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ getGradientNorm()

float CDPL.Math.FVectorBFGSMinimizer.getGradientNorm ( )
Returns

◆ getFunctionDelta()

float CDPL.Math.FVectorBFGSMinimizer.getFunctionDelta ( )
Returns

◆ getFunctionValue()

float CDPL.Math.FVectorBFGSMinimizer.getFunctionValue ( )
Returns

◆ getNumIterations()

int CDPL.Math.FVectorBFGSMinimizer.getNumIterations ( )
Returns

◆ getStatus()

Status CDPL.Math.FVectorBFGSMinimizer.getStatus ( )
Returns

◆ minimize()

Status CDPL.Math.FVectorBFGSMinimizer.minimize ( FVector  x,
FVector  g,
int  max_iter,
float  g_norm,
float  delta_f,
bool   do_setup = True 
)
Parameters
x
g
max_iter
g_norm
delta_f
do_setup
Returns

◆ setup()

float CDPL.Math.FVectorBFGSMinimizer.setup ( FVector  x,
FVector  g,
float   step_size = 0.001,
float   tol = 0.15 
)
Parameters
x
g
step_size
tol
Returns

◆ iterate()

tuple CDPL.Math.FVectorBFGSMinimizer.iterate ( float  f,
FVector  x,
FVector  g 
)
Parameters
f
x
g
Returns