Configuration.cpp
Go to the documentation of this file.
1 // -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2 #include "Configuration.h"
3 #define _USE_MATH_DEFINES // for MSVC
4 #include <math.h>
5 #include <stdlib.h>
6 
7 namespace PathEngine{
8  std::ostream& operator<< (std::ostream& out, const Configuration& cfg)
9  {
10  for (unsigned int i=0; i<cfg.size(); i++){
11  out << cfg.value(i) << " ";
12  }
13  return out;
14  }
15 }
16 
17 using namespace PathEngine;
18 
19 Configuration::Configuration(unsigned int i_size)
20 {
21  m_values.resize(i_size);
22 }
23 
24 const double Configuration::value(unsigned int i_rank) const
25 {
26  return m_values[i_rank];
27 }
28 
29 double &Configuration::value(unsigned int i_rank)
30 {
31  return m_values[i_rank];
32 }
33 
34 unsigned int Configuration::size() const
35 {
36  return m_values.size();
37 }
38 
40 {
41  if (size() != cfg.size()) return true;
42  for (unsigned int i=0; i<size(); i++){
43  if (value(i) != cfg.value(i)) return true;
44  }
45  return false;
46 }
47 
49 {
50  if (size() != cfg.size()) return false;
51  for (unsigned int i=0; i<size(); i++){
52  if (value(i) != cfg.value(i)) return false;
53  }
54  return true;
55 }
Configuration(unsigned int i_size)
constructor
bool operator==(const Configuration &cfg)
compare configurations
png_uint_32 i
Definition: png.h:2735
std::vector< double > m_values
Definition: Configuration.h:53
std::ostream & operator<<(std::ostream &out, const Configuration &cfg)
bool operator!=(const Configuration &cfg)
compare configurations
unsigned int size() const
get the number of degrees of freedom
const double value(unsigned int i_rank) const


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:20