newtonoptimizer.h 1.82 KB
Newer Older
1
2
3
4
5
6
/*!
 * @file newtonoptimizer.h
 * @brief class for solving the minimal entropy optimization problem using a newton optimizer with line search.
 * @author S. Schotthöfer
 */

7
8
9
10
11
#ifndef NEWTONOPTIMIZER_H
#define NEWTONOPTIMIZER_H

#include "optimizerbase.h"

12
13
class QuadratureBase;

14
15
16
class NewtonOptimizer : public OptimizerBase
{
  public:
17
    NewtonOptimizer( Config* settings );
18

19
    ~NewtonOptimizer();
20

21
22
23
24
25
26
27
28
29
30
31
    void Solve( Vector& lambda, Vector& u, VectorVector& moments ) override;

  private:
    /*! @brief: Computes gradient of objective function and stores it in grad
                grad = <m*eta*'(alpha*m)> - sol */
    void ComputeGradient( Vector& alpha, Vector& sol, VectorVector& moments, Vector& grad );

    /*! @brief: Computes hessian of objective function and stores it in hessian
                grad = <mXm*eta*'(alpha*m)> */
    void ComputeHessian( Vector& alpha, VectorVector& moments, Matrix& hessian );

32
33
    double ComputeObjFunc( Vector& alpha, Vector& sol, VectorVector& moments );

34
35
36
37
38
    QuadratureBase* _quadrature; /*! @brief: used quadrature */    // THis is memory doubling! Try to use a pointer.
    unsigned _nq;                                                  /*! @brief: number of quadrature points */
    Vector _weights;                                               /*!  @brief quadrature weights, dim(_weights) = (_nq) */
    VectorVector _quadPointsSphere;                                /*!  @brief (my,phi), dim(_quadPoints) = (_nq,2) */

39
    double _epsilon;                 /*! @brief: Termination criterion for newton optimizer */
40
41
42
    unsigned short _maxIterations;   /*! @brief: Max iterations of the newton solver */
    double _alpha;                   /*! @brief: Newton Step Size */
    unsigned short _maxLineSearches; /*! @brief: Max amount of line searches for Newton Algo */
43
44
45
};

#endif    // NEWTONOPTIMIZER_H