Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
dbe14b7f
Commit
dbe14b7f
authored
Nov 24, 2012
by
Davis King
Browse files
Added uniform_random_hash() and gaussian_random_hash().
parent
0f419e18
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
936 additions
and
0 deletions
+936
-0
dlib/general_hash/random_hashing.h
dlib/general_hash/random_hashing.h
+877
-0
dlib/general_hash/random_hashing_abstract.h
dlib/general_hash/random_hashing_abstract.h
+58
-0
dlib/hash.h
dlib/hash.h
+1
-0
No files found.
dlib/general_hash/random_hashing.h
0 → 100644
View file @
dbe14b7f
This diff is collapsed.
Click to expand it.
dlib/general_hash/random_hashing_abstract.h
0 → 100644
View file @
dbe14b7f
// Copyright (C) 2012 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_RANDOM_HAsHING_ABSTRACT_H__
#ifdef DLIB_RANDOM_HAsHING_ABSTRACT_H__
#include "random_hashing_abstract.h"
#include "murmur_hash3.h"
namespace
dlib
{
// ----------------------------------------------------------------------------------------
double
uniform_random_hash
(
const
uint64
&
k1
,
const
uint64
&
k2
,
const
uint64
&
k3
);
/*!
ensures
- This function uses hashing to generate uniform random values in the range [0,1).
- To define this function precisely, assume we have an arbitrary sequence of
input triplets. Then calling uniform_random_hash() on each of them should
result in a sequence of double values that look like numbers sampled
independently and uniformly at random from the interval [0,1). This is true
even if there is some simple pattern in the inputs. For example, (0,0,0),
(1,0,0), (2,0,0), (3,0,0), etc.
- This function is deterministic. That is, the same output is always returned
when given the same input.
!*/
// ----------------------------------------------------------------------------------------
double
gaussian_random_hash
(
const
uint64
&
k1
,
const
uint64
&
k2
,
const
uint64
&
k3
);
/*!
ensures
- This function uses hashing to generate Gaussian distributed random values
with mean 0 and variance 1.
- To define this function precisely, assume we have an arbitrary sequence of
input triplets. Then calling gaussian_random_hash() on each of them should
result in a sequence of double values that look like numbers sampled
independently from a standard normal distribution. This is true even if
there is some simple pattern in the inputs. For example, (0,0,0), (1,0,0),
(2,0,0), (3,0,0), etc.
- This function is deterministic. That is, the same output is always returned
when given the same input.
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_RANDOM_HAsHING_ABSTRACT_H__
dlib/hash.h
View file @
dbe14b7f
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include "general_hash/hash.h"
#include "general_hash/hash.h"
#include "general_hash/random_hashing.h"
#endif // DLIB_HASh_
#endif // DLIB_HASh_
...
...
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