eigenpy
3.13.0
Bindings between Numpy and Eigen using Boost.Python
Toggle main menu visibility
Loading...
Searching...
No Matches
LeastSquaresConjugateGradient.hpp
1
/*
2
* Copyright 2017-2018 CNRS
3
* Copyright 2025 INRIA
4
*/
5
6
#ifndef __eigenpy_solvers_least_square_conjugate_gradient_hpp__
7
#define __eigenpy_solvers_least_square_conjugate_gradient_hpp__
8
9
#include <Eigen/IterativeLinearSolvers>
10
11
#include "eigenpy/fwd.hpp"
12
#include "eigenpy/solvers/IterativeSolverBase.hpp"
13
14
namespace
eigenpy
{
15
16
template
<
typename
LeastSquaresConjugateGradient>
17
struct
LeastSquaresConjugateGradientVisitor
18
:
public
boost::python::def_visitor<
19
LeastSquaresConjugateGradientVisitor<LeastSquaresConjugateGradient>> {
20
typedef
typename
LeastSquaresConjugateGradient::MatrixType MatrixType;
21
22
template
<
class
PyClass>
23
void
visit(PyClass& cl)
const
{
24
cl.def(bp::init<>(
"Default constructor"
))
25
.def(bp::init<MatrixType>(
26
bp::arg(
"A"
),
27
"Initialize the solver with matrix A for further || Ax - b || "
28
"solving.\n"
29
"This constructor is a shortcut for the default constructor "
30
"followed by a call to compute()."
));
31
}
32
33
static
void
expose
(
34
const
std::string& name =
"LeastSquaresConjugateGradient"
) {
35
bp::class_<LeastSquaresConjugateGradient, boost::noncopyable>(name.c_str(),
36
bp::no_init)
37
.def(
IterativeSolverVisitor<LeastSquaresConjugateGradient>
())
38
.def(
LeastSquaresConjugateGradientVisitor
<
39
LeastSquaresConjugateGradient>())
40
.def(
IdVisitor<LeastSquaresConjugateGradient>
());
41
}
42
};
43
44
}
// namespace eigenpy
45
46
#endif
// ifndef __eigenpy_solvers_least_square_conjugate_gradient_hpp__
eigenpy
Definition
alignment.hpp:14
eigenpy::expose
void expose()
Call the expose function of a given type T.
Definition
expose.hpp:23
eigenpy::IdVisitor
Add the Python method id to retrieving a unique id for a given object exposed with Boost....
Definition
id.hpp:18
eigenpy::IterativeSolverVisitor
Definition
IterativeSolverBase.hpp:16
eigenpy::LeastSquaresConjugateGradientVisitor
Definition
LeastSquaresConjugateGradient.hpp:19
include
eigenpy
solvers
LeastSquaresConjugateGradient.hpp
Generated by
1.17.0