Class ae108::cpppetsc::LeastSquaresSolver
ClassList > ae108 > cpppetsc > LeastSquaresSolver
Public Types
| Type | Name |
|---|---|
| typedef std::function< void(const distributed< Vector > &, Matrix *)> | GradientFunctor |
| typedef std::function< void(const distributed< Vector > &, distributed< Vector > *)> | ObjectiveFunctor |
| typedef Vector::real_type | real_type |
| typedef Vector::size_type | size_type |
| typedef Vector::value_type | value_type |
Public Functions
| Type | Name |
|---|---|
| LeastSquaresSolver (Matrix bufferMatrix, distributed< Vector > bufferVector) Initializes the nonlinear solver with the problem dimension. |
|
| distributed< Vector > | solve (ObjectiveFunctor objective, GradientFunctor gradient, distributed< Vector > guess) const Minimizes the sum of the squared elements of the objective function. |
Public Types Documentation
typedef GradientFunctor
using ae108::cpppetsc::LeastSquaresSolver::GradientFunctor = std::function<void(const distributed<Vector> &, Matrix *)>;
Remark:
The first parameter is the input, the second parameter is the output.
typedef ObjectiveFunctor
using ae108::cpppetsc::LeastSquaresSolver::ObjectiveFunctor = std::function<void(const distributed<Vector> &, distributed<Vector> *)>;
Remark:
The first parameter is the input, the second parameter is the output.
typedef real_type
using ae108::cpppetsc::LeastSquaresSolver::real_type = Vector::real_type;
typedef size_type
using ae108::cpppetsc::LeastSquaresSolver::size_type = Vector::size_type;
typedef value_type
using ae108::cpppetsc::LeastSquaresSolver::value_type = Vector::value_type;
Public Functions Documentation
function LeastSquaresSolver
Initializes the nonlinear solver with the problem dimension.
explicit ae108::cpppetsc::LeastSquaresSolver::LeastSquaresSolver (
Matrix bufferMatrix,
distributed < Vector > bufferVector
)
Parameters:
bufferMatrixThe matrix to use as an internal buffer.bufferVectorThe matrix to use as an internal buffer.
function solve
Minimizes the sum of the squared elements of the objective function.
distributed < Vector > ae108::cpppetsc::LeastSquaresSolver::solve (
ObjectiveFunctor objective,
GradientFunctor gradient,
distributed < Vector > guess
) const
Parameters:
objectiveThe function to minimize.gradientThe gradient of the objective.guessThe starting point for the optimization.
Exception:
- TAOSolverDivergedException if solve did not converge.
Returns:
The minimizer.
The documentation for this class was generated from the following file cpppetsc/src/include/ae108/cpppetsc/LeastSquaresSolver.h