6 #ifndef DISMEC_OBJECTIVE_H
7 #define DISMEC_OBJECTIVE_H
134 Eigen::Ref<DenseRealVector> target);
145 Eigen::Ref<DenseRealVector>
gradient,
146 Eigen::Ref<DenseRealVector> pre);
162 Eigen::Ref<DenseRealVector> target) = 0;
174 Eigen::Ref<DenseRealVector>
gradient,
175 Eigen::Ref<DenseRealVector> pre);
An Eigen vector with versioning information, to implement simple caching of results.
Class that models an optimization objective.
virtual void declare_vector_on_last_line(const HashVector &location, real_t t)
State that the given vector corresponds to a certain position on the line of the last line search.
virtual void gradient_and_pre_conditioner_unchecked(const HashVector &location, Eigen::Ref< DenseRealVector > gradient, Eigen::Ref< DenseRealVector > pre)
virtual void gradient_at_zero_unchecked(Eigen::Ref< DenseRealVector > target)
void hessian_times_direction(const HashVector &location, const DenseRealVector &direction, Eigen::Ref< DenseRealVector > target)
Calculates the product of the Hessian matrix at location with direction.
void gradient_at_zero(Eigen::Ref< DenseRealVector > target)
Gets the gradient for location zero.
virtual ~Objective() noexcept=default
virtual void gradient_unchecked(const HashVector &location, Eigen::Ref< DenseRealVector > target)=0
virtual long num_variables() const noexcept=0
void gradient(const HashVector &location, Eigen::Ref< DenseRealVector > target)
Evaluate the gradient at location.
virtual real_t value_unchecked(const HashVector &location)=0
virtual void hessian_times_direction_unchecked(const HashVector &location, const DenseRealVector &direction, Eigen::Ref< DenseRealVector > target)=0
virtual void diag_preconditioner_unchecked(const HashVector &location, Eigen::Ref< DenseRealVector > target)
virtual void project_to_line_unchecked(const HashVector &location, const DenseRealVector &direction)=0
void gradient_and_pre_conditioner(const HashVector &location, Eigen::Ref< DenseRealVector > gradient, Eigen::Ref< DenseRealVector > pre)
Combines the calculation of gradient and pre-conditioner, which may be more efficient in some cases.
virtual real_t lookup_on_line(real_t position)=0
Looks up the value of the objective on the line defined by the last call to project_to_line().
void project_to_line(const HashVector &location, const DenseRealVector &direction)
creates a function g such that g(a) = objective(location + a * direction) Use lookup_on_line() to eva...
void diag_preconditioner(const HashVector &location, Eigen::Ref< DenseRealVector > target)
Get precondition to be used in CG optimization.
real_t value(const HashVector &location)
Evaluate the objective at the given location.
A base class to be used for all types that implement some for of statistics tracking.
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.
float real_t
The default type for floating point values.