Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
a46364f9
Commit
a46364f9
authored
May 11, 2011
by
Mathias Goldau
Browse files
[FIX] WMatrixFixed less operator now produce a lexicographically correct ordering
parent
b0b2ce9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
src/common/math/linearAlgebra/WMatrixFixed.h
src/common/math/linearAlgebra/WMatrixFixed.h
+10
-8
No files found.
src/common/math/linearAlgebra/WMatrixFixed.h
View file @
a46364f9
...
...
@@ -997,11 +997,11 @@ public:
bool
operator
==
(
const
WMatrixFixed
<
RHSValueT
,
Rows
,
Cols
,
RHSValueStoreT
>&
rhs
)
const
throw
()
{
bool
eq
=
true
;
for
(
size_t
row
=
0
;
row
<
Rows
;
++
row
)
for
(
size_t
row
=
0
;
eq
&&
(
row
<
Rows
)
;
++
row
)
{
for
(
size_t
col
=
0
;
col
<
Cols
;
++
col
)
for
(
size_t
col
=
0
;
eq
&&
(
col
<
Cols
)
;
++
col
)
{
eq
&
=
(
operator
()(
row
,
col
)
==
rhs
(
row
,
col
)
);
eq
=
eq
&&
(
operator
()(
row
,
col
)
==
rhs
(
row
,
col
)
);
}
}
return
eq
;
...
...
@@ -1018,15 +1018,17 @@ public:
template
<
typename
RHSValueT
,
ValueStoreTemplate
RHSValueStoreT
>
bool
operator
<
(
const
WMatrixFixed
<
RHSValueT
,
Rows
,
Cols
,
RHSValueStoreT
>&
rhs
)
const
throw
()
{
bool
less
=
true
;
for
(
size_t
row
=
0
;
row
<
Rows
;
++
row
)
bool
eq
=
true
;
bool
result
=
true
;
for
(
size_t
row
=
0
;
eq
&&
(
row
<
Rows
);
++
row
)
{
for
(
size_t
col
=
0
;
col
<
Cols
;
++
col
)
for
(
size_t
col
=
0
;
eq
&&
(
col
<
Cols
)
;
++
col
)
{
less
&=
(
operator
()(
row
,
col
)
<
rhs
(
row
,
col
)
);
eq
=
eq
&&
(
operator
()(
row
,
col
)
==
rhs
(
row
,
col
)
);
result
=
(
operator
()(
row
,
col
)
<
rhs
(
row
,
col
)
);
}
}
return
l
es
s
;
return
r
es
ult
;
}
/**
...
...
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