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
50a2113f
Commit
50a2113f
authored
Apr 23, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added operator+= to discriminant_pca.
parent
81a04634
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
dpca.h
dlib/statistics/dpca.h
+9
-1
dpca_abstract.h
dlib/statistics/dpca_abstract.h
+15
-1
discriminant_pca.cpp
dlib/test/discriminant_pca.cpp
+1
-1
No files found.
dlib/statistics/dpca.h
View file @
50a2113f
...
...
@@ -346,7 +346,7 @@ namespace dlib
serialize
(
item
.
within_weight
,
out
);
}
const
discriminant_pca
operator
+
(
discriminant_pca
operator
+
(
const
discriminant_pca
&
item
)
const
{
...
...
@@ -408,6 +408,14 @@ namespace dlib
return
temp
;
}
discriminant_pca
&
operator
+=
(
const
discriminant_pca
&
rhs
)
{
(
*
this
+
rhs
).
swap
(
*
this
);
return
*
this
;
}
private
:
void
compute_dpca_matrix
(
...
...
dlib/statistics/dpca_abstract.h
View file @
50a2113f
...
...
@@ -281,7 +281,7 @@ namespace dlib
reduction to num_rows dimensions.
!*/
const
discriminant_pca
operator
+
(
discriminant_pca
operator
+
(
const
discriminant_pca
&
item
)
const
;
/*!
...
...
@@ -298,6 +298,20 @@ namespace dlib
been done to R.
!*/
discriminant_pca
&
operator
+=
(
const
discriminant_pca
&
rhs
);
/*!
requires
- in_vector_size() == 0 || rhs.in_vector_size() == 0 || in_vector_size() == rhs.in_vector_size()
(i.e. the in_vector_size() of *this and rhs must match or one must be zero)
- between_class_weight() == rhs.between_class_weight()
- within_class_weight() == rhs.within_class_weight()
ensures
- #*this == *item + rhs
- returns #*this
!*/
void
swap
(
discriminant_pca
&
item
);
...
...
dlib/test/discriminant_pca.cpp
View file @
50a2113f
...
...
@@ -252,7 +252,7 @@ namespace
matrix
<
double
>
mat
,
mat2
;
sum_dpca
=
dpca_type
()
+
dpca_type
()
+
add_dpca1
+
dpca_type
()
+
add_dpca2
+
add_dpca3
+
add_dpca4
;
sum_dpca
+
=
dpca_type
()
+
dpca_type
()
+
add_dpca1
+
dpca_type
()
+
add_dpca2
+
add_dpca3
+
add_dpca4
;
dpca
.
set_within_class_weight
(
0
);
dpca
.
set_between_class_weight
(
0
);
sum_dpca
.
set_within_class_weight
(
0
);
...
...
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