5 #include <boost/serialization/serialization.hpp>
27 template <
typename IT,
typename OT>
32 friend class boost::serialization::access;
39 template <
typename Archive>
40 void serialize(Archive &ar,
unsigned int const version){
41 boost::serialization::void_cast_register<DiffMinimizer, Minimizer>();
42 ar &boost::serialization::base_object<Minimizer>(*
this);
53 vector<
function<OT(IT)>>
df;
112 {
df.erase(
df.begin()+i);}
118 {this->df.push_back(
df);}
Base abstract class providing basic structure for minimization optimization of a given function based...
Definition: DiffMinimizer.h:28
DiffMinimizer(function< OT(IT)> f, vector< function< OT(IT)>> df)
Differential minimizer default constructor.
Definition: DiffMinimizer.h:62
vector< function< OT(IT)> > df
The derivatives of the function to be minimized such that df[i] corresponds with .
Definition: DiffMinimizer.h:53
virtual void setDerivatives(vector< function< OT(IT)>> df)
Set the derivatives of the function to be minimized.
Definition: DiffMinimizer.h:81
virtual size_t numDerivatives() const
Obtain the number of available derivatives for the function to be minimized.
Definition: DiffMinimizer.h:89
virtual void setDerivative(size_t const i, function< OT(IT)> df)
Set the i-th derivative for the function being minimized.
Definition: DiffMinimizer.h:104
virtual vector< function< OT(IT)> > getDerivatives() const
Obtain the derivatives of the function to be minimized.
Definition: DiffMinimizer.h:75
virtual void removeDerivative(size_t const i)
Remove the i-th derivative for the function being minimized.
Definition: DiffMinimizer.h:111
virtual function< OT(IT)> getDerivative(size_t const i)
Obtain the i-th derivative for the function being minimized.
Definition: DiffMinimizer.h:96
virtual void addDerivative(function< OT(IT)> df)
Append given derivative.
Definition: DiffMinimizer.h:117
void serialize(Archive &ar, unsigned int const version)
Serialize the differential minimizer to a stream of bytes.
Definition: DiffMinimizer.h:40
Base abstract class providing basic structure for minimization optimization of a given function.
Definition: Minimizer.h:31
function< OT(IT)> f
The function to be minimized.
Definition: Minimizer.h:53