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
17565cfb
Commit
17565cfb
authored
Mar 08, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added serialization support for the rls, rls_filter, and kalman_filter objects.
parent
9802fe64
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
0 deletions
+137
-0
kalman_filter.h
dlib/filtering/kalman_filter.h
+31
-0
kalman_filter_abstract.h
dlib/filtering/kalman_filter_abstract.h
+21
-0
rls_filter.h
dlib/filtering/rls_filter.h
+25
-0
rls_filter_abstract.h
dlib/filtering/rls_filter_abstract.h
+19
-0
rls.h
dlib/svm/rls.h
+23
-0
rls_abstract.h
dlib/svm/rls_abstract.h
+18
-0
No files found.
dlib/filtering/kalman_filter.h
View file @
17565cfb
...
...
@@ -82,6 +82,37 @@ namespace dlib
return
xb
;
}
friend
inline
void
serialize
(
const
kalman_filter
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
got_first_meas
,
out
);
serialize
(
item
.
x
,
out
);
serialize
(
item
.
xb
,
out
);
serialize
(
item
.
P
,
out
);
serialize
(
item
.
H
,
out
);
serialize
(
item
.
A
,
out
);
serialize
(
item
.
Q
,
out
);
serialize
(
item
.
R
,
out
);
}
friend
inline
void
deserialize
(
kalman_filter
&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
dlib
::
serialization_error
(
"Unknown version number found while deserializing kalman_filter object."
);
deserialize
(
item
.
got_first_meas
,
in
);
deserialize
(
item
.
x
,
in
);
deserialize
(
item
.
xb
,
in
);
deserialize
(
item
.
P
,
in
);
deserialize
(
item
.
H
,
in
);
deserialize
(
item
.
A
,
in
);
deserialize
(
item
.
Q
,
in
);
deserialize
(
item
.
R
,
in
);
}
private
:
bool
got_first_meas
;
...
...
dlib/filtering/kalman_filter_abstract.h
View file @
17565cfb
...
...
@@ -6,6 +6,27 @@
namespace
dlib
{
// ----------------------------------------------------------------------------------------
void
serialize
(
const
kalman_filter
&
item
,
std
::
ostream
&
out
);
/*!
provides serialization support
!*/
void
deserialize
(
kalman_filter
&
item
,
std
::
istream
&
in
);
/*!
provides deserialization support
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_KALMAN_FiLTER_ABSTRACT_H__
...
...
dlib/filtering/rls_filter.h
View file @
17565cfb
...
...
@@ -130,6 +130,31 @@ namespace dlib
return
next
;
}
friend
inline
void
serialize
(
const
rls_filter
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
count
,
out
);
serialize
(
item
.
size
,
out
);
serialize
(
item
.
filter
,
out
);
serialize
(
item
.
next
,
out
);
serialize
(
item
.
data
,
out
);
}
friend
inline
void
deserialize
(
rls_filter
&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
dlib
::
serialization_error
(
"Unknown version number found while deserializing rls_filter object."
);
deserialize
(
item
.
count
,
in
);
deserialize
(
item
.
size
,
in
);
deserialize
(
item
.
filter
,
in
);
deserialize
(
item
.
next
,
in
);
deserialize
(
item
.
data
,
in
);
}
private
:
unsigned
long
count
;
...
...
dlib/filtering/rls_filter_abstract.h
View file @
17565cfb
...
...
@@ -70,6 +70,25 @@ namespace dlib
// ----------------------------------------------------------------------------------------
void
serialize
(
const
rls_filter
&
item
,
std
::
ostream
&
out
);
/*!
provides serialization support
!*/
void
deserialize
(
rls_filter
&
item
,
std
::
istream
&
in
);
/*!
provides deserialization support
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_RLS_FiLTER_ABSTRACT_H__
...
...
dlib/svm/rls.h
View file @
17565cfb
...
...
@@ -143,6 +143,29 @@ namespace dlib
return
df
;
}
friend
inline
void
serialize
(
const
rls
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
w
,
out
);
serialize
(
item
.
R
,
out
);
serialize
(
item
.
C
,
out
);
serialize
(
item
.
forget_factor
,
out
);
}
friend
inline
void
deserialize
(
rls
&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
dlib
::
serialization_error
(
"Unknown version number found while deserializing rls object."
);
deserialize
(
item
.
w
,
in
);
deserialize
(
item
.
R
,
in
);
deserialize
(
item
.
C
,
in
);
deserialize
(
item
.
forget_factor
,
in
);
}
private
:
void
add_eye_to_inv
(
...
...
dlib/svm/rls_abstract.h
View file @
17565cfb
...
...
@@ -133,6 +133,24 @@ namespace dlib
};
// ----------------------------------------------------------------------------------------
void
serialize
(
const
rls
&
item
,
std
::
ostream
&
out
);
/*!
provides serialization support
!*/
void
deserialize
(
rls
&
item
,
std
::
istream
&
in
);
/*!
provides deserialization support
!*/
// ----------------------------------------------------------------------------------------
}
...
...
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