matrix-constant-command.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * Florent Lamiraux
4  *
5  * CNRS/AIST
6  *
7  */
8 
9 #ifndef MATRIX_CONSTANT_COMMAND_H
10 #define MATRIX_CONSTANT_COMMAND_H
11 
14 #include <dynamic-graph/command.h>
15 
16 #include <boost/assign/list_of.hpp>
17 
18 namespace dynamicgraph {
19 namespace sot {
20 namespace command {
21 namespace matrixConstant {
22 using ::dynamicgraph::command::Command;
23 using ::dynamicgraph::command::Value;
24 
25 // Command Resize
26 class Resize : public Command {
27  public:
28  virtual ~Resize() {}
32  Resize(MatrixConstant &entity, const std::string &docstring)
33  : Command(entity, boost::assign::list_of(Value::LONGINT)(Value::LONGINT),
34  docstring) {}
35  virtual Value doExecute() {
36  MatrixConstant &mc = static_cast<MatrixConstant &>(owner());
37  std::vector<Value> values = getParameterValues();
38  size_type rows = values[0].value();
39  size_type cols = values[1].value();
40  Matrix m(Matrix::Zero(rows, cols));
41  mc.SOUT.setConstant(m);
42 
43  // return void
44  return Value();
45  }
46 }; // class Resize
47 } // namespace matrixConstant
48 } // namespace command
49 } // namespace sot
50 } // namespace dynamicgraph
51 
52 #endif // MATRIX_CONSTANT_COMMAND_H
dynamicgraph::sot::command::matrixConstant::Resize::doExecute
virtual Value doExecute()
Definition: matrix-constant-command.h:35
m
float m
dynamicgraph::sot::command::matrixConstant::Resize
Definition: matrix-constant-command.h:26
dynamicgraph
rows
int rows
command-getter.h
boost
dynamicgraph::command::Command::getParameterValues
const std::vector< Value > & getParameterValues() const
dynamicgraph::Matrix
Eigen::MatrixXd Matrix
dynamicgraph::sot::MatrixConstant
Definition: matrix-constant.hh:28
command-setter.h
dynamicgraph::command::Command
dynamicgraph::sot::command::matrixConstant::Resize::~Resize
virtual ~Resize()
Definition: matrix-constant-command.h:28
dynamicgraph::size_type
Matrix::Index size_type
dynamicgraph::sot::command::matrixConstant::Resize::Resize
Resize(MatrixConstant &entity, const std::string &docstring)
Definition: matrix-constant-command.h:32
values
list values
cols
int cols
command.h
dynamicgraph::sot::MatrixConstant::SOUT
SignalTimeDependent< dynamicgraph::Matrix, sigtime_t > SOUT
Definition: matrix-constant.hh:45
dynamicgraph::command::Value
dynamicgraph::command::Command::owner
Entity & owner()


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31