class QPanda::Brent

Overview

Given a function of one-variable, return the local minimum of the function isolated to a fractional precision of tol. More…

#include <OriginPowell.h>

class Brent
{
public:
    // construction

    Brent(const Func& func, double tol = 1.48e-8, size_t maxiter = 500);
    Brent(const Brent&);

    // methods

    Brent& operator = (const Brent&);
    void optimize();
    std::pair<double, QResultPair> getResult();
};

Detailed Documentation

Given a function of one-variable, return the local minimum of the function isolated to a fractional precision of tol.

Uses inverse parabolic interpolation when possible to speed up convergence of golden section method.

Construction

Brent(const Func& func, double tol = 1.48e-8, size_t maxiter = 500)

Constructor of Brent.

Methods

void optimize()

execute optimization

std::pair<double, QResultPair> getResult()

get result

Returns:

std::pair<double, QResultPair> result