Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
soth
Commits
bc7c2970
Commit
bc7c2970
authored
Dec 05, 2017
by
Joseph Mirabel
Committed by
Joseph Mirabel
Dec 05, 2017
Browse files
Fix unit test of SubMatrix
parent
f468344e
Changes
2
Hide whitespace changes
Inline
Side-by-side
unitTesting/RandomGenerator.cpp
View file @
bc7c2970
...
...
@@ -499,8 +499,8 @@ namespace soth
sotDEBUG
(
15
)
<<
"Mi: "
<<
rowDistrib
.
sum
()
<<
" "
<<
(
MATLAB
)
rowDistrib
<<
std
::
endl
;
sotDEBUG
(
15
)
<<
"Ri: "
<<
rankDistrib
.
sum
()
<<
" "
<<
(
MATLAB
)
rankDistrib
<<
std
::
endl
;
rankDistrib
=
rankDistrib
.
unaryExpr
(
&
round
);
rowDistrib
=
rowDistrib
.
unaryExpr
(
&
round
);
rankDistrib
=
rankDistrib
.
unaryExpr
(
std
::
ptr_fun
<
double
,
double
>
(
round
)
)
;
rowDistrib
=
rowDistrib
.
unaryExpr
(
std
::
ptr_fun
<
double
,
double
>
(
round
)
)
;
VectorXd
selfdefDistrib
(
nbStage
);
soth
::
MatrixRnd
::
randomize
(
selfdefDistrib
,
0
,
1
);
double
vsd
=
selfdefDistrib
.
cwiseProduct
(
rowDistrib
-
rankDistrib
).
sum
();
...
...
@@ -521,7 +521,7 @@ namespace soth
sotDEBUG
(
15
)
<<
"Si: "
<<
selfdefDistrib
.
sum
()
<<
" "
<<
(
MATLAB
)
selfdefDistrib
<<
std
::
endl
;
selfdefDistrib
=
selfdefDistrib
.
unaryExpr
(
&
round
);
selfdefDistrib
=
selfdefDistrib
.
unaryExpr
(
std
::
ptr_fun
<
double
,
double
>
(
round
)
)
;
sotDEBUG
(
5
)
<<
"Mi: "
<<
rowDistrib
.
sum
()
<<
" "
<<
(
MATLAB
)
rowDistrib
<<
std
::
endl
;
sotDEBUG
(
5
)
<<
"Ri: "
<<
rankDistrib
.
sum
()
<<
" "
<<
(
MATLAB
)
rankDistrib
<<
std
::
endl
;
sotDEBUG
(
5
)
<<
"Si: "
<<
selfdefDistrib
.
sum
()
<<
" "
<<
(
MATLAB
)
selfdefDistrib
<<
std
::
endl
;
...
...
unitTesting/tsubmatrix.cpp
View file @
bc7c2970
...
...
@@ -281,10 +281,10 @@ void testStack()
/* --- */
typedef
SubMatrix
<
MatrixXi
,
RowPermutation
>
SubMatrixXi
;
Matrix
<
Sub
MatrixXi
::
Index
,
Dynamic
,
1
>
row1
(
3
);
row1
<<
2
,
3
,
0
;
Matrix
<
MatrixXi
::
Index
,
Dynamic
,
1
>
row1
(
3
);
row1
<<
2
,
3
,
0
;
SubMatrixXi
m1i
(
m1
,
row1
);
std
::
cout
<<
"m1i = "
<<
m1i
<<
std
::
endl
;
Matrix
<
Sub
MatrixXi
::
Index
,
Dynamic
,
1
>
row2
(
1
);
row2
<<
0
;
Matrix
<
MatrixXi
::
Index
,
Dynamic
,
1
>
row2
(
1
);
row2
<<
0
;
SubMatrixXi
m2i
(
m2
,
row2
);
std
::
cout
<<
"m2i = "
<<
m2i
<<
std
::
endl
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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