32 #ifndef _math_optimize_function_h
33 #define _math_optimize_function_h
38 #include <util/state/state.h>
39 #include <math/optimize/transform.h>
40 #include <math/scmat/matrix.h>
41 #include <math/scmat/result.h>
62 virtual void set_value(
double);
76 virtual void set_actual_value_accuracy(
double);
77 virtual void set_actual_gradient_accuracy(
double);
78 virtual void set_actual_hessian_accuracy(
double);
109 double gradacc = DBL_EPSILON,
double hessacc = DBL_EPSILON);
123 virtual double value();
143 virtual RefSCVector gradient();
144 int gradient_needed()
const;
145 int do_gradient(
int);
146 virtual void set_desired_gradient_accuracy(
double);
147 virtual double actual_gradient_accuracy()
const;
148 virtual double desired_gradient_accuracy()
const;
149 AccResultRefSCVector& gradient_result() {
return gradient_; }
156 virtual RefSymmSCMatrix hessian();
157 int hessian_needed()
const;
159 virtual void set_desired_hessian_accuracy(
double);
160 virtual double actual_hessian_accuracy()
const;
161 virtual double desired_hessian_accuracy()
const;
162 AccResultRefSymmSCMatrix& hessian_result() {
return hessian_; }
170 virtual RefSymmSCMatrix inverse_hessian(RefSymmSCMatrix&);
175 virtual int gradient_implemented()
const;
176 virtual int hessian_implemented()
const;
179 virtual void set_x(
const RefSCVector&);
180 RefSCVector get_x()
const {
return x_.copy(); }
181 const RefSCVector& get_x_no_copy()
const {
return x_; }
Ref< SCMatrixKit > matrixkit_
Used to construct new matrices.
Definition: function.h:50
Ref< SCMatrixKit > matrixkit() const
Return the SCMatrixKit used to construct vectors and matrices.
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:261
RefSCDimension dim_
The dimension of x_.
Definition: function.h:53
virtual void set_desired_value_accuracy(double)
Set the accuracy to which the value is to be computed.
A template class that maintains references counts.
Definition: ref.h:332
virtual void print(std::ostream &=ExEnv::out0()) const
Print information about the object.
virtual double desired_value_accuracy() const
Return the accuracy with which the value is to be computed.
The Function class is an abstract base class that, given a set of coordinates, will compute a value a...
Definition: function.h:48
AccResultRefSCVector gradient_
The gradient at x_.
Definition: function.h:55
int do_value(int)
If passed a nonzero number, compute the value the next time compute() is called.
Restores objects that derive from SavableState.
Definition: statein.h:70
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:156
virtual double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
AccResultRefSymmSCMatrix hessian_
The hessian at x_.
Definition: function.h:56
virtual void obsolete()
Marks all results as being out of date.
virtual void set_x(const RefSCVector &)
Set and retrieve the coordinate values.
RefSCVector & get_x_reference()
Get read/write access to the coordinates for modification.
Definition: function.h:82
RefSCDimension dimension() const
Return the SCDimension of the problem.
virtual void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual void guess_hessian(RefSymmSCMatrix &)
Compute a quick, approximate hessian.
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
Serializes objects that derive from SavableState.
Definition: stateout.h:61
The Compute class provides a means of keeping results up to date.
Definition: compute.h:55
AccResultdouble value_
The value of the function at x_.
Definition: function.h:54
virtual int value_implemented() const
Information about the availability of values, gradients, and hessians.
virtual double value()
Return the value of the function.
static std::ostream & out0()
Return an ostream that writes from node 0.
RefSCVector x_
The variables.
Definition: function.h:52
Base class for objects that can save/restore state.
Definition: state.h:46
virtual Ref< NonlinearTransform > change_coordinates()
An optimizer can call change coordinates periodically to give the function an opportunity to change i...
int value_needed() const
Returns nonzero if the current value is not up-to-date.
virtual void set_matrixkit(const Ref< SCMatrixKit > &)
Set the SCMatrixKit that should be used to construct the requisite vectors and matrices.
void do_change_coordinates(const Ref< NonlinearTransform > &)
Change the coordinate system and apply the given transform to intermediates matrices and vectors.
Generated at Sun Jan 26 2020 23:33:03 for MPQC
2.3.1 using the documentation package Doxygen
1.8.16.