tests
task
test_multi_bound.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2010,
3
* François Bleibel,
4
* Olivier Stasse,
5
*
6
* CNRS/AIST
7
*
8
*/
9
10
/* -------------------------------------------------------------------------- */
11
/* --- INCLUDES ------------------------------------------------------------- */
12
/* -------------------------------------------------------------------------- */
13
#include <iostream>
14
#include <
sot/core/debug.hh
>
15
#include <
sot/core/multi-bound.hh
>
16
#include <sstream>
17
18
using namespace
std
;
19
using namespace
dynamicgraph::sot
;
20
21
int
main
(
void
) {
22
DebugTrace::openFile();
23
24
MultiBound
mbs(1.2), mbdi(3.4, MultiBound::BOUND_INF),
25
mbds(5.6, MultiBound::BOUND_SUP), mbdb(-7.8, 9.10);
26
cout <<
"mbs ="
<< mbs << std::endl;
27
cout <<
"mbdi="
<< mbdi << std::endl;
28
cout <<
"mbds="
<< mbds << std::endl;
29
cout <<
"mbdb="
<< mbdb << std::endl;
30
31
{
32
ostringstream oss;
33
istringstream iss;
34
oss.str(
""
);
35
oss << mbs;
36
iss.str(oss.str());
37
iss.seekg(0);
38
//{char strbuf[256]; iss.getline(strbuf,256); cout <<
39
//"#"<<strbuf<<"#"<<std::endl;}
40
iss >> mbs;
41
cout << oss.str() <<
"=> mbs ="
<< mbs << std::endl;
42
}
43
44
{
45
ostringstream oss;
46
istringstream iss;
47
oss.str(
""
);
48
oss << mbdi;
49
iss.str(oss.str());
50
iss.seekg(0);
51
iss >> mbdi;
52
cout << oss.str() <<
"=> mbdi ="
<< mbdi << std::endl;
53
}
54
{
55
ostringstream oss;
56
istringstream iss;
57
oss.str(
""
);
58
oss << mbds;
59
iss.str(oss.str());
60
iss.seekg(0);
61
iss >> mbds;
62
cout << oss.str() <<
"=> mbds ="
<< mbds << std::endl;
63
}
64
{
65
ostringstream oss;
66
istringstream iss;
67
oss.str(
""
);
68
oss << mbdb;
69
iss.seekg(0);
70
iss.str(oss.str());
71
iss >> mbdb;
72
cout << oss.str() <<
"=> mbdb ="
<< mbdb << std::endl;
73
}
74
75
ostringstream oss;
76
istringstream iss;
77
oss <<
"[4]("
<< mbs <<
","
<< mbdi <<
","
<< mbds <<
","
<< mbdb <<
")"
78
<< std::endl;
79
iss.str(oss.str());
80
VectorMultiBound
vmb;
81
iss >> vmb;
82
cout <<
"vmb4 = "
<< vmb << std::endl;
83
84
return
0;
85
}
multi-bound.hh
dynamicgraph::sot::VectorMultiBound
std::vector< MultiBound > VectorMultiBound
Definition:
multi-bound.hh:71
std
debug.hh
dynamicgraph::sot
main
int main(void)
Definition:
test_multi_bound.cpp:21
dynamicgraph::sot::MultiBound
Definition:
multi-bound.hh:35
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26