Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph
Commits
384b2078
Commit
384b2078
authored
Aug 26, 2019
by
Olivier Stasse
Browse files
[clang] Update format.
parent
873dafcc
Pipeline
#6420
failed with stage
in 4 minutes and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/dynamic-graph/logger.h
View file @
384b2078
...
...
@@ -61,14 +61,14 @@ namespace dynamicgraph {
#define SEND_WARNING_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_WARNING_STREAM)
#define SEND_ERROR_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_ERROR_STREAM)
template
<
typename
T
>
std
::
string
toString
(
const
T
&
v
,
const
int
precision
=
3
,
const
int
width
=-
1
)
{
template
<
typename
T
>
std
::
string
toString
(
const
T
&
v
,
const
int
precision
=
3
,
const
int
width
=
-
1
)
{
std
::
stringstream
ss
;
if
(
width
>
precision
)
ss
<<
std
::
fixed
<<
std
::
setw
(
width
)
<<
std
::
setprecision
(
precision
)
<<
v
;
if
(
width
>
precision
)
ss
<<
std
::
fixed
<<
std
::
setw
(
width
)
<<
std
::
setprecision
(
precision
)
<<
v
;
else
ss
<<
std
::
fixed
<<
std
::
setprecision
(
precision
)
<<
v
;
ss
<<
std
::
fixed
<<
std
::
setprecision
(
precision
)
<<
v
;
return
ss
.
str
();
}
...
...
tests/debug-logger.cpp
View file @
384b2078
...
...
@@ -51,15 +51,17 @@ public:
sendMsg
(
"This is a message of level MSG_TYPE_ERROR_STREAM"
,
MSG_TYPE_ERROR_STREAM
);
/* Add test toString */
double
q
=
1.0
;
sendMsg
(
"Value to display: "
+
toString
(
q
));
double
q
=
1.0
;
sendMsg
(
"Value to display: "
+
toString
(
q
));
std
::
vector
<
double
>
vq
;
vq
.
resize
(
3
);
vq
[
0
]
=
1.0
;
vq
[
1
]
=
2.0
;
vq
[
2
]
=
3.0
;
sendMsg
(
"Value to display: "
+
toString
(
vq
));
Eigen
::
Matrix
<
double
,
3
,
3
>
an_eig_m
;
vq
[
0
]
=
1.0
;
vq
[
1
]
=
2.0
;
vq
[
2
]
=
3.0
;
sendMsg
(
"Value to display: "
+
toString
(
vq
));
Eigen
::
Matrix
<
double
,
3
,
3
>
an_eig_m
;
an_eig_m
.
Ones
();
sendMsg
(
"Value to display: "
+
toString
(
an_eig_m
));
sendMsg
(
"Value to display: "
+
toString
(
an_eig_m
));
logger_
.
countdown
();
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment