Class ae108::cpppetsc::LeastSquaresSolver
template <class Policy>
ClassList > ae108 > cpppetsc > LeastSquaresSolver
Public Types
| Type | Name |
|---|---|
| typedef std::function< void(const distributed< vector_type > &, matrix_type *)> | GradientFunctor |
| typedef std::function< void(const distributed< vector_type > &, distributed< vector_type > *)> | ObjectiveFunctor |
| typedef Matrix< Policy > | matrix_type |
| typedef typename Vector< Policy >::real_type | real_type |
| typedef typename Vector< Policy >::size_type | size_type |
| typedef typename Vector< Policy >::value_type | value_type |
| typedef Vector< Policy > | vector_type |
Public Functions
| Type | Name |
|---|---|
| LeastSquaresSolver (matrix_type bufferMatrix, distributed< vector_type > bufferVector) Initializes the nonlinear solver with the problem dimension. |
|
| distributed< vector_type > | solve (ObjectiveFunctor objective, GradientFunctor gradient, distributed< vector_type > guess) const Minimizes the sum of the squared elements of the objective function. |
Public Types Documentation
typedef GradientFunctor
using ae108::cpppetsc::LeastSquaresSolver< Policy >::GradientFunctor = std::function<void(const distributed<vector_type> &, matrix_type *)>;
Remark:
The first parameter is the input, the second parameter is the output.
typedef ObjectiveFunctor
using ae108::cpppetsc::LeastSquaresSolver< Policy >::ObjectiveFunctor = std::function<void(const distributed<vector_type> &, distributed<vector_type> *)>;
Remark:
The first parameter is the input, the second parameter is the output.
typedef matrix_type
using ae108::cpppetsc::LeastSquaresSolver< Policy >::matrix_type = Matrix<Policy>;
typedef real_type
using ae108::cpppetsc::LeastSquaresSolver< Policy >::real_type = typename Vector<Policy>::real_type;
typedef size_type
using ae108::cpppetsc::LeastSquaresSolver< Policy >::size_type = typename Vector<Policy>::size_type;
typedef value_type
using ae108::cpppetsc::LeastSquaresSolver< Policy >::value_type = typename Vector<Policy>::value_type;
typedef vector_type
using ae108::cpppetsc::LeastSquaresSolver< Policy >::vector_type = Vector<Policy>;
Public Functions Documentation
function LeastSquaresSolver
Initializes the nonlinear solver with the problem dimension.
explicit ae108::cpppetsc::LeastSquaresSolver::LeastSquaresSolver (
matrix_type bufferMatrix,
distributed < vector_type > 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_type > ae108::cpppetsc::LeastSquaresSolver::solve (
ObjectiveFunctor objective,
GradientFunctor gradient,
distributed < vector_type > 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