eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
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
14namespace eigenpy {
15
16template <typename LeastSquaresConjugateGradient>
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)
39 LeastSquaresConjugateGradient>())
41 }
42};
43
44} // namespace eigenpy
45
46#endif // ifndef __eigenpy_solvers_least_square_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