20 #if !defined(__MITSUBA_CORE_BRENT_H_)
21 #define __MITSUBA_CORE_BRENT_H_
23 #include <mitsuba/mitsuba.h>
24 #include <boost/function.hpp>
48 : success(success), iterations(iterations), x(x), y(y) { }
52 std::ostringstream oss;
53 oss <<
"BrentSolver::Result["
54 <<
"success=" << success <<
", "
55 <<
"iterations=" << iterations <<
", "
79 Float absAccuracy = 1e-6f,
80 Float absAccuracyPos = 1e-6f,
81 Float relAccuracyPos = 1e-6f)
82 : m_maxIterations(maxIterations),
83 m_absAccuracy(absAccuracy),
84 m_absAccuracyPos(absAccuracyPos),
85 m_relAccuracyPos(relAccuracyPos) { }
97 Result solve(
const boost::function<
Float (
Float)> &func,
114 Result solve(
const boost::function<
Float (
Float)> &func,
130 Result solve(
const boost::function<
Float (
Float)> &func,
Return value of BrentSolver::solve()
Definition: brent.h:40
size_t iterations
Definition: brent.h:42
Brent's method nonlinear zero finder.
Definition: brent.h:37
#define MTS_EXPORT_CORE
Definition: getopt.h:29
Float m_absAccuracyPos
Definition: brent.h:137
Result(bool success, size_t iterations, Float x, Float y)
Create a new result instance.
Definition: brent.h:47
BrentSolver(size_t maxIterations=100, Float absAccuracy=1e-6f, Float absAccuracyPos=1e-6f, Float relAccuracyPos=1e-6f)
Create a new Brent-style solver with the specified accuracy requirements.
Definition: brent.h:78
Float y
Definition: brent.h:44
Float m_absAccuracy
Definition: brent.h:136
Float x
Definition: brent.h:43
Float m_relAccuracyPos
Definition: brent.h:138
size_t m_maxIterations
Definition: brent.h:135
bool success
Definition: brent.h:41
std::string toString() const
Return a string representation of the result.
Definition: brent.h:51