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
d4c75a85
Verified
Commit
d4c75a85
authored
Mar 12, 2020
by
Tim Gymnich
Browse files
changed span to static func
parent
3d4562ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/matrix.h
View file @
d4c75a85
...
...
@@ -126,11 +126,11 @@ public:
}
/// Linear span of the matrix ... fixme
Matrix
span
(
)
const
{
static
Matrix
<
T
>
span
(
Matrix
<
T
>
matrix
)
{
vector
<
vector
<
T
>>
columns
;
int
rank
=
getRank
();
int
rank
=
matrix
.
getRank
();
for
(
int
col
=
0
;
col
<
rank
;
col
++
)
{
columns
.
push_back
(
column
(
col
));
columns
.
push_back
(
matrix
.
column
(
col
));
}
return
Matrix
(
columns
).
transpose
();
}
...
...
@@ -166,7 +166,7 @@ public:
/// @param row
/// @param column
T
&
value
(
int
row
,
int
column
)
{
assert
(
row
<
getHeight
()
&&
column
<
get
Height
());
assert
(
row
<
getHeight
()
&&
column
<
get
Width
());
return
vectors
[
row
][
column
];
};
...
...
@@ -174,7 +174,7 @@ public:
/// @param row
/// @param column
T
const
&
value
(
int
row
,
int
column
)
const
{
assert
(
row
<
getHeight
()
&&
column
<
get
Height
());
assert
(
row
<
getHeight
()
&&
column
<
get
Width
());
return
vectors
[
row
][
column
];
};
...
...
test/matrix_test.cpp
View file @
d4c75a85
...
...
@@ -312,7 +312,8 @@ bool MatrixTest<T>::runTestSpan1() {
};
auto
matrix
=
Matrix
(
a
);
auto
actual
=
matrix
.
span
();
auto
actual
=
Matrix
<
int
>::
span
(
matrix
);
result
=
actual
==
Matrix
(
expected
);
...
...
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