Commit 7cb946de authored by Davis King's avatar Davis King
Browse files

Renamed all the rand::kernel_1a and rand::float_1a declarations

to just say rand.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404250
parent 98045930
...@@ -1188,7 +1188,7 @@ namespace dlib ...@@ -1188,7 +1188,7 @@ namespace dlib
assignment v; assignment v;
dlib::rand::float_1a rnd; dlib::rand rnd;
matrix<double,1> samples; matrix<double,1> samples;
}; };
......
...@@ -82,7 +82,7 @@ namespace dlib ...@@ -82,7 +82,7 @@ namespace dlib
std::vector<sample_pair, alloc> edges; std::vector<sample_pair, alloc> edges;
edges.reserve(num); edges.reserve(num);
dlib::rand::kernel_1a rnd; dlib::rand rnd;
rnd.set_seed(cast_to_string(random_seed)); rnd.set_seed(cast_to_string(random_seed));
// randomly sample a bunch of edges // randomly sample a bunch of edges
...@@ -211,7 +211,7 @@ namespace dlib ...@@ -211,7 +211,7 @@ namespace dlib
std::vector<sample_pair, alloc> temp; std::vector<sample_pair, alloc> temp;
temp.reserve(num); temp.reserve(num);
dlib::rand::kernel_1a rnd; dlib::rand rnd;
rnd.set_seed(cast_to_string(random_seed)); rnd.set_seed(cast_to_string(random_seed));
// randomly sample a bunch of edges // randomly sample a bunch of edges
......
...@@ -362,7 +362,7 @@ namespace dlib ...@@ -362,7 +362,7 @@ namespace dlib
matrix<double> w3m; matrix<double> w3m;
rand::float_1a rand_nums; rand rand_nums;
// temporary storage // temporary storage
mutable matrix<double> e1, e2, e3; mutable matrix<double> e1, e2, e3;
......
...@@ -15,7 +15,7 @@ namespace dlib ...@@ -15,7 +15,7 @@ namespace dlib
{ {
template < template <
typename T, typename T,
typename Rand_type = dlib::rand::kernel_1a typename Rand_type = dlib::rand
> >
class random_subset_selector class random_subset_selector
{ {
......
...@@ -12,7 +12,7 @@ namespace dlib ...@@ -12,7 +12,7 @@ namespace dlib
{ {
template < template <
typename T, typename T,
typename Rand_type = dlib::rand::kernel_1a typename Rand_type = dlib::rand
> >
class random_subset_selector class random_subset_selector
{ {
......
...@@ -484,7 +484,7 @@ namespace dlib ...@@ -484,7 +484,7 @@ namespace dlib
const vector_type& samples const vector_type& samples
) )
{ {
dlib::rand::float_1a rnd; dlib::rand rnd;
impl::fill_lisf(lisf, vector_to_matrix(samples),rnd, 2000); impl::fill_lisf(lisf, vector_to_matrix(samples),rnd, 2000);
} }
...@@ -515,7 +515,7 @@ namespace dlib ...@@ -515,7 +515,7 @@ namespace dlib
const int sampling_size = 2000 const int sampling_size = 2000
) )
{ {
dlib::rand::float_1a rnd; dlib::rand rnd;
rnd.set_seed(cast_to_string(random_seed)); rnd.set_seed(cast_to_string(random_seed));
impl::fill_lisf(lisf, vector_to_matrix(samples), rnd, sampling_size); impl::fill_lisf(lisf, vector_to_matrix(samples), rnd, sampling_size);
} }
......
...@@ -544,7 +544,7 @@ namespace dlib ...@@ -544,7 +544,7 @@ namespace dlib
typedef typename decision_function<kernel_type>::sample_vector_type sample_vector_type; typedef typename decision_function<kernel_type>::sample_vector_type sample_vector_type;
typedef typename decision_function<kernel_type>::scalar_vector_type scalar_vector_type; typedef typename decision_function<kernel_type>::scalar_vector_type scalar_vector_type;
dlib::rand::kernel_1a rnd; dlib::rand rnd;
trainer_type my_trainer(trainer); trainer_type my_trainer(trainer);
...@@ -594,7 +594,7 @@ namespace dlib ...@@ -594,7 +594,7 @@ namespace dlib
typedef typename decision_function<kernel_type>::sample_vector_type sample_vector_type; typedef typename decision_function<kernel_type>::sample_vector_type sample_vector_type;
typedef typename decision_function<kernel_type>::scalar_vector_type scalar_vector_type; typedef typename decision_function<kernel_type>::scalar_vector_type scalar_vector_type;
dlib::rand::kernel_1a rnd; dlib::rand rnd;
// make a caching kernel // make a caching kernel
typedef caching_kernel<kernel_type, in_sample_vector_type> ckernel_type; typedef caching_kernel<kernel_type, in_sample_vector_type> ckernel_type;
......
...@@ -772,7 +772,7 @@ namespace dlib ...@@ -772,7 +772,7 @@ namespace dlib
U& u U& u
) )
{ {
rand::kernel_1a r; rand r;
randomize_samples(t,u,r); randomize_samples(t,u,r);
} }
...@@ -846,7 +846,7 @@ namespace dlib ...@@ -846,7 +846,7 @@ namespace dlib
T& t T& t
) )
{ {
rand::kernel_1a r; rand r;
randomize_samples(t,r); randomize_samples(t,r);
} }
......
...@@ -422,7 +422,7 @@ namespace dlib ...@@ -422,7 +422,7 @@ namespace dlib
// we will use a linearly_independent_subset_finder to store our basis set. // we will use a linearly_independent_subset_finder to store our basis set.
linearly_independent_subset_finder<kernel_type> lisf(get_kernel(), max_basis_size); linearly_independent_subset_finder<kernel_type> lisf(get_kernel(), max_basis_size);
dlib::rand::kernel_1a rnd; dlib::rand rnd;
// first pick the initial basis set randomly // first pick the initial basis set randomly
for (unsigned long i = 0; i < 10*initial_basis_size && lisf.size() < initial_basis_size; ++i) for (unsigned long i = 0; i < 10*initial_basis_size && lisf.size() < initial_basis_size; ++i)
......
...@@ -33,7 +33,7 @@ namespace ...@@ -33,7 +33,7 @@ namespace
- runs tests on array for compliance with the specs - runs tests on array for compliance with the specs
!*/ !*/
{ {
dlib::rand::kernel_1a rnd; dlib::rand rnd;
array a1, a2; array a1, a2;
......
...@@ -27,7 +27,7 @@ namespace dlib ...@@ -27,7 +27,7 @@ namespace dlib
board_dimension squares on each side. board_dimension squares on each side.
!*/ !*/
{ {
static dlib::rand::float_1a rnd; static dlib::rand rnd;
x.clear(); x.clear();
y.clear(); y.clear();
......
...@@ -38,7 +38,7 @@ namespace ...@@ -38,7 +38,7 @@ namespace
} }
time_t thetime; time_t thetime;
dlib::rand::float_1a rnd; dlib::rand rnd;
template <typename dpca_type> template <typename dpca_type>
void test1() void test1()
......
...@@ -37,7 +37,7 @@ namespace ...@@ -37,7 +37,7 @@ namespace
} }
time_t thetime; time_t thetime;
dlib::rand::float_1a rnd; dlib::rand rnd;
template <typename T> template <typename T>
void validate ( void validate (
......
...@@ -38,7 +38,7 @@ namespace ...@@ -38,7 +38,7 @@ namespace
} }
time_t thetime; time_t thetime;
dlib::rand::float_1a rnd; dlib::rand rnd;
void test_projection_error() void test_projection_error()
{ {
......
...@@ -329,7 +329,7 @@ namespace ...@@ -329,7 +329,7 @@ namespace
std::vector< dlib::vector<double> > a; std::vector< dlib::vector<double> > a;
dlib::vector<double> v; dlib::vector<double> v;
dlib::rand::float_1a rnd; dlib::rand rnd;
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{ {
......
...@@ -449,7 +449,7 @@ namespace ...@@ -449,7 +449,7 @@ namespace
void test_integral_image ( void test_integral_image (
) )
{ {
dlib::rand::float_1a rnd; dlib::rand rnd;
array2d<unsigned char>::kernel_1a_c img; array2d<unsigned char>::kernel_1a_c img;
integral_image int_img; integral_image int_img;
......
...@@ -37,7 +37,7 @@ namespace ...@@ -37,7 +37,7 @@ namespace
seed = 1; seed = 1;
} }
dlib::rand::float_1a rnd; dlib::rand rnd;
unsigned long seed; unsigned long seed;
......
...@@ -734,7 +734,7 @@ namespace ...@@ -734,7 +734,7 @@ namespace
a.set_size(1000,10); a.set_size(1000,10);
b.set_size(1000,10); b.set_size(1000,10);
i.set_size(1000,10); i.set_size(1000,10);
dlib::rand::float_1a rnd; dlib::rand rnd;
for (long r = 0; r < a.nr(); ++r) for (long r = 0; r < a.nr(); ++r)
{ {
for (long c = 0; c < a.nc(); ++c) for (long c = 0; c < a.nc(); ++c)
......
...@@ -25,7 +25,7 @@ namespace ...@@ -25,7 +25,7 @@ namespace
logger dlog("test.matrix2"); logger dlog("test.matrix2");
dlib::rand::float_1a rnd; dlib::rand rnd;
void matrix_test ( void matrix_test (
) )
......
...@@ -87,7 +87,7 @@ namespace ...@@ -87,7 +87,7 @@ namespace
} }
template <typename type> template <typename type>
type rnd_num (dlib::rand::float_1a& rnd) type rnd_num (dlib::rand& rnd)
{ {
return static_cast<type>(10*rnd.get_random_double()); return static_cast<type>(10*rnd.get_random_double());
} }
...@@ -99,7 +99,7 @@ namespace ...@@ -99,7 +99,7 @@ namespace
// It does this by performing an assignment that is subject to BLAS bindings and comparing the // It does this by performing an assignment that is subject to BLAS bindings and comparing the
// results directly to an unevaluated matrix_exp that should be equal. // results directly to an unevaluated matrix_exp that should be equal.
dlib::rand::float_1a rnd; dlib::rand rnd;
matrix<type> a(rows,cols), temp, temp2, temp3; matrix<type> a(rows,cols), temp, temp2, temp3;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment