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
c96cef9c
Commit
c96cef9c
authored
Jan 24, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added overload of svd_fast() that doesn't compute u.
parent
6fd1e18a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletion
+62
-1
matrix_la.h
dlib/matrix/matrix_la.h
+47
-1
matrix_la_abstract.h
dlib/matrix/matrix_la_abstract.h
+15
-0
No files found.
dlib/matrix/matrix_la.h
View file @
c96cef9c
...
...
@@ -724,6 +724,8 @@ convergence:
// ----------------------------------------------------------------------------------------
namespace
simpl
{
template
<
typename
sparse_vector_type
,
typename
T
,
...
...
@@ -734,12 +736,13 @@ convergence:
typename
L
>
void
svd_fast
(
bool
compute_u
,
const
std
::
vector
<
sparse_vector_type
>&
A
,
matrix
<
T
,
Unr
,
Unc
,
MM
,
L
>&
u
,
matrix
<
T
,
Wnr
,
Wnc
,
MM
,
L
>&
w
,
matrix
<
T
,
Vnr
,
Vnc
,
MM
,
L
>&
v
,
unsigned
long
l
,
unsigned
long
q
=
1
unsigned
long
q
)
{
const
long
n
=
max_index_plus_one
(
A
);
...
...
@@ -784,8 +787,51 @@ convergence:
},
1
);
svd3
(
B
,
v
,
w
,
u
);
if
(
compute_u
)
u
=
Q
*
u
;
}
}
template
<
typename
sparse_vector_type
,
typename
T
,
long
Unr
,
long
Unc
,
long
Wnr
,
long
Wnc
,
long
Vnr
,
long
Vnc
,
typename
MM
,
typename
L
>
void
svd_fast
(
const
std
::
vector
<
sparse_vector_type
>&
A
,
matrix
<
T
,
Unr
,
Unc
,
MM
,
L
>&
u
,
matrix
<
T
,
Wnr
,
Wnc
,
MM
,
L
>&
w
,
matrix
<
T
,
Vnr
,
Vnc
,
MM
,
L
>&
v
,
unsigned
long
l
,
unsigned
long
q
=
1
)
{
simpl
::
svd_fast
(
true
,
A
,
u
,
w
,
v
,
l
,
q
);
}
template
<
typename
sparse_vector_type
,
typename
T
,
long
Wnr
,
long
Wnc
,
long
Vnr
,
long
Vnc
,
typename
MM
,
typename
L
>
void
svd_fast
(
const
std
::
vector
<
sparse_vector_type
>&
A
,
matrix
<
T
,
Wnr
,
Wnc
,
MM
,
L
>&
w
,
matrix
<
T
,
Vnr
,
Vnc
,
MM
,
L
>&
v
,
unsigned
long
l
,
unsigned
long
q
=
1
)
{
matrix
<
T
,
0
,
0
,
MM
,
L
>
u
;
simpl
::
svd_fast
(
false
,
A
,
u
,
w
,
v
,
l
,
q
);
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/matrix/matrix_la_abstract.h
View file @
c96cef9c
...
...
@@ -249,6 +249,21 @@ namespace dlib
value should be good for many problems.
!*/
template
<
typename
sparse_vector_type
,
typename
T
>
void
svd_fast
(
const
std
::
vector
<
sparse_vector_type
>&
A
,
matrix
<
T
>&
w
,
matrix
<
T
>&
v
,
unsigned
long
l
,
unsigned
long
q
=
1
);
/*!
This function is identical to the above svd_fast() except it doesn't compute u.
!*/
// ----------------------------------------------------------------------------------------
template
<
...
...
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