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,
34  boost::assign::list_of(Value::UNSIGNED)(Value::UNSIGNED),
35  docstring) {}
36  virtual Value doExecute() {
37  MatrixConstant &mc = static_cast<MatrixConstant &>(owner());
38  std::vector<Value> values = getParameterValues();
39  unsigned rows = values[0].value();
40  unsigned cols = values[1].value();
41  Matrix m(Matrix::Zero(rows, cols));
42  mc.SOUT.setConstant(m);
43 
44  // return void
45  return Value();
46  }
47 }; // class Resize
48 } // namespace matrixConstant
49 } // namespace command
50 } // namespace sot
51 } // namespace dynamicgraph
52 
53 #endif // MATRIX_CONSTANT_COMMAND_H
int rows
virtual void setConstant(const T &t)
Resize(MatrixConstant &entity, const std::string &docstring)
list values
float m
Eigen::MatrixXd Matrix
SignalTimeDependent< dynamicgraph::Matrix, int > SOUT
int cols
const std::vector< Value > & getParameterValues() const


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26