5 #ifndef CNOID_UTIL_YAML_EIGEN_H_INCLUDED
6 #define CNOID_UTIL_YAML_EIGEN_H_INCLUDED
13 template<
typename Derived>
14 bool read(
const YamlMapping& mapping,
const std::string& key, Eigen::MatrixBase<Derived>& x)
18 const int nr = x.rows();
19 const int nc = x.cols();
20 const int n = s.
size();
23 for(
int i=0; i < nr; ++i){
24 for(
int j=0; j < nc; ++j){
32 return (index == nr * nc);
37 template<
typename Derived>
38 inline void readEx(
const YamlMapping& mapping,
const std::string& key, Eigen::MatrixBase<Derived>& x)
40 if(!
read(mapping, key, x)){
45 template<
typename Derived>
49 const int nr = x.rows();
50 const int nc = x.cols();
52 for(
int i=0; i < nr; ++i){
56 for(
int i=0; i < nr; ++i){
58 for(
int j=0; j < nc; ++j){