constraint-base.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
19 
20 using namespace tsid::math;
21 
22 ConstraintBase::ConstraintBase(const std::string& name) : m_name(name) {}
23 
24 ConstraintBase::ConstraintBase(const std::string& name, const unsigned int rows,
25  const unsigned int cols)
26  : m_name(name) {
27  m_A = Matrix::Zero(rows, cols);
28 }
29 
31  : m_name(name), m_A(A) {}
32 
33 const std::string& ConstraintBase::name() const { return m_name; }
34 
35 const Matrix& ConstraintBase::matrix() const { return m_A; }
36 
38 
40  PINOCCHIO_CHECK_INPUT_ARGUMENT(m_A.cols() == A.cols(),
41  "cols do not match the constraint dimension");
42  PINOCCHIO_CHECK_INPUT_ARGUMENT(m_A.rows() == A.rows(),
43  "rows do not match the constraint dimension");
44  m_A = A;
45  return true;
46 }
const Eigen::Ref< const Matrix > ConstRefMatrix
Definition: math/fwd.hpp:51
virtual unsigned int rows() const =0
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: math/fwd.hpp:36
virtual unsigned int cols() const =0
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstraintBase(const std::string &name)
virtual bool setMatrix(ConstRefMatrix A)
virtual const std::string & name() const
virtual const Matrix & matrix() const
#define PINOCCHIO_CHECK_INPUT_ARGUMENT(...)


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sun Jul 2 2023 02:21:51