hrplib
hrpPlanner
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
39
bool
Configuration::operator!=
(
const
Configuration
& cfg)
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
48
bool
Configuration::operator==
(
const
Configuration
& cfg)
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
}
i
png_uint_32 i
Definition:
png.h:2732
PathEngine::Configuration::value
const double value(unsigned int i_rank) const
Definition:
Configuration.cpp:24
PathEngine::Configuration::operator!=
bool operator!=(const Configuration &cfg)
compare configurations
Definition:
Configuration.cpp:39
PathEngine::operator<<
std::ostream & operator<<(std::ostream &out, const Configuration &cfg)
Definition:
Configuration.cpp:8
PathEngine::Configuration::m_values
std::vector< double > m_values
Definition:
Configuration.h:53
PathEngine
Definition:
Algorithm.h:13
PathEngine::Configuration::Configuration
Configuration(unsigned int i_size)
constructor
Definition:
Configuration.cpp:19
PathEngine::Configuration::size
unsigned int size() const
get the number of degrees of freedom
Definition:
Configuration.cpp:34
PathEngine::Configuration::operator==
bool operator==(const Configuration &cfg)
compare configurations
Definition:
Configuration.cpp:48
Configuration.h
PathEngine::Configuration
Definition:
Configuration.h:10
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:02