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
c324a65e
Commit
c324a65e
authored
Sep 04, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added get_double_in_range() to dlib::rand.
parent
1970bf29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
rand_kernel_1.h
dlib/rand/rand_kernel_1.h
+9
-0
rand_kernel_abstract.h
dlib/rand/rand_kernel_abstract.h
+14
-0
No files found.
dlib/rand/rand_kernel_1.h
View file @
c324a65e
...
...
@@ -137,6 +137,15 @@ namespace dlib
return
(
a
<<
32
)
|
b
;
}
double
get_double_in_range
(
double
begin
,
double
end
)
{
DLIB_ASSERT
(
begin
<=
end
);
return
begin
+
get_random_double
()
*
(
end
-
begin
);
}
double
get_random_double
(
)
{
...
...
dlib/rand/rand_kernel_abstract.h
View file @
c324a65e
...
...
@@ -135,6 +135,20 @@ namespace dlib
- returns a random double number N where: 0.0 <= N < 1.0.
!*/
double
get_double_in_range
(
double
begin
,
double
end
);
/*!
requires
- begin <= end
ensures
- if (begin < end) then
- returns a random double number N where: begin <= N < end.
- else
- returns begin
!*/
double
get_random_gaussian
(
);
/*!
...
...
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