eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
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
14namespace eigenpy {
15
16template <typename ConjugateGradient>
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 {
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)
37 }
38};
39
40} // namespace eigenpy
41
42#endif // ifndef __eigenpy_solvers_conjugate_gradient_hpp__
void expose()
Call the expose function of a given type T.
Definition expose.hpp:23
Add the Python method id to retrieving a unique id for a given object exposed with Boost....
Definition id.hpp:18