Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
f7b395a8
Commit
f7b395a8
authored
Jun 10, 2016
by
Davis King
Browse files
Fixed minor bugs in join_rows() and join_cols(). They didn't work when
one of the matrices was empty.
parent
89e344f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
dlib/matrix/matrix_utilities.h
dlib/matrix/matrix_utilities.h
+7
-4
No files found.
dlib/matrix/matrix_utilities.h
View file @
f7b395a8
...
...
@@ -4021,9 +4021,10 @@ namespace dlib
template
<
typename
M1
,
typename
M2
>
struct
op_join_rows
{
op_join_rows
(
const
M1
&
m1_
,
const
M2
&
m2_
)
:
m1
(
m1_
),
m2
(
m2_
)
{}
op_join_rows
(
const
M1
&
m1_
,
const
M2
&
m2_
)
:
m1
(
m1_
),
m2
(
m2_
)
,
_nr
(
std
::
max
(
m1
.
nr
(),
m2
.
nr
()))
{}
const
M1
&
m1
;
const
M2
&
m2
;
const
long
_nr
;
template
<
typename
T
,
typename
U
,
bool
selection
>
struct
type_selector
;
...
...
@@ -4054,7 +4055,7 @@ namespace dlib
return
m2
(
r
,
c
-
m1
.
nc
());
}
long
nr
()
const
{
return
m1
.
nr
()
;
}
long
nr
()
const
{
return
_nr
;
}
long
nc
()
const
{
return
m1
.
nc
()
+
m2
.
nc
();
}
template
<
typename
U
>
bool
aliases
(
const
matrix_exp
<
U
>&
item
)
const
...
...
@@ -4095,9 +4096,10 @@ namespace dlib
template
<
typename
M1
,
typename
M2
>
struct
op_join_cols
{
op_join_cols
(
const
M1
&
m1_
,
const
M2
&
m2_
)
:
m1
(
m1_
),
m2
(
m2_
)
{}
op_join_cols
(
const
M1
&
m1_
,
const
M2
&
m2_
)
:
m1
(
m1_
),
m2
(
m2_
)
,
_nc
(
std
::
max
(
m1
.
nc
(),
m2
.
nc
()))
{}
const
M1
&
m1
;
const
M2
&
m2
;
const
long
_nc
;
template
<
typename
T
,
typename
U
,
bool
selection
>
struct
type_selector
;
...
...
@@ -4131,7 +4133,8 @@ namespace dlib
}
long
nr
()
const
{
return
m1
.
nr
()
+
m2
.
nr
();
}
long
nc
()
const
{
return
m1
.
nc
();
}
long
nc
()
const
{
return
_nc
;
}
template
<
typename
U
>
bool
aliases
(
const
matrix_exp
<
U
>&
item
)
const
{
return
m1
.
aliases
(
item
)
||
m2
.
aliases
(
item
);
}
...
...
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