Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
07c4df4e
Commit
07c4df4e
authored
Dec 19, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed set_colm() and set_rowm() not being assignable from some matrix
expressions.
parent
c4f48a16
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
matrix_blas_bindings.h
dlib/matrix/matrix_blas_bindings.h
+12
-0
matrix.cpp
dlib/test/matrix.cpp
+39
-0
No files found.
dlib/matrix/matrix_blas_bindings.h
View file @
07c4df4e
...
@@ -410,6 +410,18 @@ namespace dlib
...
@@ -410,6 +410,18 @@ namespace dlib
template
<
typename
T
,
long
NR
,
long
NC
,
typename
MM
>
template
<
typename
T
,
long
NR
,
long
NC
,
typename
MM
>
int
get_ld
(
const
assignable_sub_matrix
<
T
,
NR
,
NC
,
MM
,
column_major_layout
>&
m
)
{
return
m
.
m
.
nr
();
}
int
get_ld
(
const
assignable_sub_matrix
<
T
,
NR
,
NC
,
MM
,
column_major_layout
>&
m
)
{
return
m
.
m
.
nr
();
}
template
<
typename
T
,
long
NR
,
long
NC
,
typename
MM
>
int
get_ld
(
const
assignable_col_matrix
<
T
,
NR
,
NC
,
MM
,
row_major_layout
>&
m
)
{
return
m
.
m
.
nc
();
}
template
<
typename
T
,
long
NR
,
long
NC
,
typename
MM
>
int
get_ld
(
const
assignable_col_matrix
<
T
,
NR
,
NC
,
MM
,
column_major_layout
>&
m
)
{
return
m
.
m
.
nr
();
}
template
<
typename
T
,
long
NR
,
long
NC
,
typename
MM
>
int
get_ld
(
const
assignable_row_matrix
<
T
,
NR
,
NC
,
MM
,
row_major_layout
>&
m
)
{
return
m
.
m
.
nc
();
}
template
<
typename
T
,
long
NR
,
long
NC
,
typename
MM
>
int
get_ld
(
const
assignable_row_matrix
<
T
,
NR
,
NC
,
MM
,
column_major_layout
>&
m
)
{
return
m
.
m
.
nr
();
}
template
<
typename
T
>
template
<
typename
T
>
int
get_ld
(
const
assignable_ptr_matrix
<
T
>&
m
)
{
return
m
.
nc
();
}
int
get_ld
(
const
assignable_ptr_matrix
<
T
>&
m
)
{
return
m
.
nc
();
}
...
...
dlib/test/matrix.cpp
View file @
07c4df4e
...
@@ -1451,6 +1451,45 @@ namespace
...
@@ -1451,6 +1451,45 @@ namespace
}
}
{
matrix
<
double
,
3
,
3
,
default_memory_manager
,
column_major_layout
>
a
(
3
,
3
);
matrix
<
double
,
3
,
3
,
default_memory_manager
,
column_major_layout
>
m
=
randm
(
3
,
3
);
matrix
<
double
,
3
,
1
,
default_memory_manager
,
column_major_layout
>
b
=
randm
(
3
,
1
);
a
=
0
;
set_colm
(
a
,
0
)
=
m
*
b
;
DLIB_TEST
(
colm
(
a
,
0
)
==
m
*
b
);
a
=
0
;
set_rowm
(
a
,
0
)
=
trans
(
m
*
b
);
DLIB_TEST
(
rowm
(
a
,
0
)
==
trans
(
m
*
b
));
DLIB_TEST
(
rowm
(
a
,
0
)
!=
m
*
b
);
}
{
matrix
<
double
,
0
,
0
,
default_memory_manager
,
column_major_layout
>
a
(
3
,
3
);
matrix
<
double
,
0
,
0
,
default_memory_manager
,
column_major_layout
>
m
=
randm
(
3
,
3
);
matrix
<
double
,
0
,
0
,
default_memory_manager
,
column_major_layout
>
b
=
randm
(
3
,
1
);
a
=
0
;
set_colm
(
a
,
0
)
=
m
*
b
;
DLIB_TEST
(
colm
(
a
,
0
)
==
m
*
b
);
a
=
0
;
set_rowm
(
a
,
0
)
=
trans
(
m
*
b
);
DLIB_TEST
(
rowm
(
a
,
0
)
==
trans
(
m
*
b
));
DLIB_TEST
(
rowm
(
a
,
0
)
!=
m
*
b
);
}
{
matrix
<
double
>
a
(
3
,
3
);
matrix
<
double
>
m
=
randm
(
3
,
3
);
matrix
<
double
>
b
=
randm
(
3
,
1
);
a
=
0
;
set_colm
(
a
,
0
)
=
m
*
b
;
DLIB_TEST
(
colm
(
a
,
0
)
==
m
*
b
);
a
=
0
;
set_rowm
(
a
,
0
)
=
trans
(
m
*
b
);
DLIB_TEST
(
rowm
(
a
,
0
)
==
trans
(
m
*
b
));
DLIB_TEST
(
rowm
(
a
,
0
)
!=
m
*
b
);
}
}
}
...
...
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