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
a758fb09
Commit
a758fb09
authored
9 years ago
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a constructor for seeding rand with a time_t.
parent
f33d1ff1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
rand_kernel_1.h
dlib/rand/rand_kernel_1.h
+9
-0
rand_kernel_abstract.h
dlib/rand/rand_kernel_abstract.h
+13
-0
No files found.
dlib/rand/rand_kernel_1.h
View file @
a758fb09
...
...
@@ -10,6 +10,7 @@
#include "../is_kind.h"
#include <iostream>
#include "../serialize.h"
#include "../string.h"
namespace
dlib
{
...
...
@@ -39,6 +40,14 @@ namespace dlib
init
();
}
rand
(
time_t
seed_value
)
{
init
();
set_seed
(
cast_to_string
(
seed_value
));
}
rand
(
const
std
::
string
&
seed_value
)
...
...
This diff is collapsed.
Click to expand it.
dlib/rand/rand_kernel_abstract.h
View file @
a758fb09
...
...
@@ -34,6 +34,19 @@ namespace dlib
- std::bad_alloc
!*/
rand
(
time_t
seed_value
);
/*!
ensures
- #*this is properly initialized
- #get_seed() == cast_to_string(seed_value)
- This version of the constructor is equivalent to using
the default constructor and then calling set_seed(cast_to_string(seed_value))
throws
- std::bad_alloc
!*/
rand
(
const
std
::
string
&
seed_value
);
...
...
This diff is collapsed.
Click to expand it.
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