Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
9879b9af
Commit
9879b9af
authored
Apr 03, 2013
by
Stefan Philips
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] Allow cast from WValue to WMatrixFixed with Cols=1
parent
bf49e3e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
src/core/common/math/linearAlgebra/WMatrixFixed.h
src/core/common/math/linearAlgebra/WMatrixFixed.h
+18
-0
No files found.
src/core/common/math/linearAlgebra/WMatrixFixed.h
View file @
9879b9af
...
...
@@ -51,6 +51,8 @@
#include "../../exceptions/WOutOfBounds.h"
#include "../WValue.h"
/**
* Macro for handling the value store template.
*/
...
...
@@ -284,6 +286,22 @@ public:
setValues
(
m
.
m_values
);
}
/**
* Casting constructor for WValue. This won't compile if Cols != 1 and
* causes a runtime assertion if val.size() != Rows.
*
* \param val the WValue with the fitting size.
*/
WMatrixFixed
(
const
WValue
<
ValueT
>&
val
)
// NOLINT - we do not want it explicit
{
WAssert
(
val
.
size
()
==
Rows
,
"The size of the given WValue doesn't equal the number of rows."
);
// NOTE: The static Cols == 1 check is done by operator []
for
(
size_t
i
=
0
;
i
<
Rows
;
i
++
)
{
operator
[](
i
)
=
val
[
i
];
}
}
/**
* Returns an identity matrix.
*
...
...
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