eigenpy
3.13.0
Bindings between Numpy and Eigen using Boost.Python
Toggle main menu visibility
Loading...
Searching...
No Matches
ConjugateGradient.hpp
1
/*
2
* Copyright 2017 CNRS
3
* Copyright 2025 INRIA
4
*/
5
6
#ifndef __eigenpy_solvers_conjugate_gradient_hpp__
7
#define __eigenpy_solvers_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
ConjugateGradient>
17
struct
ConjugateGradientVisitor
18
:
public
boost::python::def_visitor<
19
ConjugateGradientVisitor<ConjugateGradient>> {
20
typedef
typename
ConjugateGradient::MatrixType MatrixType;
21
22
template
<
class
PyClass>
23
void
visit(PyClass& cl)
const
{
24
cl.def(
IterativeSolverVisitor<ConjugateGradient>
())
25
.def(bp::init<>(
"Default constructor"
))
26
.def(bp::init<MatrixType>(
27
bp::arg(
"A"
),
28
"Initialize the solver with matrix A for further Ax=b 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
(
const
std::string& name =
"ConjugateGradient"
) {
34
bp::class_<ConjugateGradient, boost::noncopyable>(name.c_str(), bp::no_init)
35
.def(
ConjugateGradientVisitor<ConjugateGradient>
())
36
.def(
IdVisitor<ConjugateGradient>
());
37
}
38
};
39
40
}
// namespace eigenpy
41
42
#endif
// ifndef __eigenpy_solvers_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::ConjugateGradientVisitor
Definition
ConjugateGradient.hpp:19
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
include
eigenpy
solvers
ConjugateGradient.hpp
Generated by
1.17.0