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
6391a034
Commit
6391a034
authored
Jan 19, 2013
by
Davis King
Browse files
Made some of this code a little more general.
parent
04f8d803
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
dlib/test/cca.cpp
dlib/test/cca.cpp
+7
-5
No files found.
dlib/test/cca.cpp
View file @
6391a034
...
@@ -30,11 +30,12 @@ namespace
...
@@ -30,11 +30,12 @@ namespace
return
temp
;
return
temp
;
}
}
std
::
vector
<
std
::
map
<
unsigned
long
,
double
>
>
mat_to_sparse
(
template
<
typename
T
>
const
matrix
<
double
>&
A
std
::
vector
<
std
::
map
<
unsigned
long
,
T
>
>
mat_to_sparse
(
const
matrix
<
T
>&
A
)
)
{
{
std
::
vector
<
std
::
map
<
unsigned
long
,
double
>
>
temp
(
A
.
nr
());
std
::
vector
<
std
::
map
<
unsigned
long
,
T
>
>
temp
(
A
.
nr
());
for
(
long
r
=
0
;
r
<
A
.
nr
();
++
r
)
for
(
long
r
=
0
;
r
<
A
.
nr
();
++
r
)
{
{
for
(
long
c
=
0
;
c
<
A
.
nc
();
++
c
)
for
(
long
c
=
0
;
c
<
A
.
nc
();
++
c
)
...
@@ -47,8 +48,9 @@ namespace
...
@@ -47,8 +48,9 @@ namespace
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
matrix
<
double
>
rm_zeros
(
template
<
typename
EXP
>
const
matrix
<
double
>&
m
matrix
<
typename
EXP
::
type
>
rm_zeros
(
const
matrix_exp
<
EXP
>&
m
)
)
{
{
// Do this to avoid trying to correlate super small numbers that are really just
// Do this to avoid trying to correlate super small numbers that are really just
...
...
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