Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dr. Michael Petter
LLVM-abstractinterpretation
Commits
17f19bc0
Verified
Commit
17f19bc0
authored
Mar 13, 2020
by
Tim Gymnich
Browse files
added reshapeColumns and changed return type of toVector()
parent
4f5f49b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/matrix.h
View file @
17f19bc0
...
...
@@ -136,13 +136,13 @@ public:
}
/// Converts the matrix to a 1D Vector by stacking the column vectors
Matrix
<
T
>
toVector
()
const
{
std
::
vector
<
T
>
toVector
()
const
{
vector
<
T
>
result
;
result
.
reserve
(
getWidth
()
*
getHeight
());
for
(
vector
<
T
>
vector
:
vectors
)
{
result
.
insert
(
result
.
end
(),
vector
.
begin
(),
vector
.
end
());
}
return
Matrix
(
result
)
;
return
result
;
}
/// Converts a 1D Vector to a Matrix with given dimensions
...
...
@@ -161,6 +161,13 @@ public:
}
return
Matrix
(
result
);
}
vector
<
Matrix
<
T
>>
reshapeColumns
(
int
height
,
int
width
)
const
{
vector
<
Matrix
<
T
>>
result
;
for
(
int
c
=
0
;
c
<
width
;
c
++
)
{
result
.
push_back
(
column
(
c
).
reshape
(
height
,
width
));
}
}
/// Returns the value at row i and column j
/// @param row
...
...
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