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

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;
......
...@@ -523,7 +523,7 @@ namespace ...@@ -523,7 +523,7 @@ namespace
} }
dlib::rand::float_1a rnd; dlib::rand rnd;
for (int i = 0; i < 1; ++i) for (int i = 0; i < 1; ++i)
{ {
matrix<double> d1 = randm(4,1,rnd); matrix<double> d1 = randm(4,1,rnd);
......
...@@ -24,7 +24,7 @@ namespace ...@@ -24,7 +24,7 @@ namespace
logger dlog("test.matrix_chol"); logger dlog("test.matrix_chol");
dlib::rand::float_1a rnd; dlib::rand rnd;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -24,7 +24,7 @@ namespace ...@@ -24,7 +24,7 @@ namespace
logger dlog("test.matrix_eig"); logger dlog("test.matrix_eig");
dlib::rand::float_1a rnd; dlib::rand rnd;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -24,7 +24,7 @@ namespace ...@@ -24,7 +24,7 @@ namespace
logger dlog("test.matrix_lu"); logger dlog("test.matrix_lu");
dlib::rand::float_1a rnd; dlib::rand rnd;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -24,7 +24,7 @@ namespace ...@@ -24,7 +24,7 @@ namespace
logger dlog("test.matrix_qr"); logger dlog("test.matrix_qr");
dlib::rand::float_1a rnd; dlib::rand rnd;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -98,7 +98,7 @@ namespace ...@@ -98,7 +98,7 @@ namespace
"Runs tests on the max_cost_assignment function.") "Runs tests on the max_cost_assignment function.")
{} {}
dlib::rand::float_1a rnd; dlib::rand rnd;
template <typename T> template <typename T>
void test_hungarian() void test_hungarian()
......
...@@ -43,7 +43,7 @@ namespace ...@@ -43,7 +43,7 @@ namespace
const int num const int num
) )
{ {
static dlib::rand::kernel_1a rnd; static dlib::rand rnd;
matrix<int> mat, mask; matrix<int> mat, mask;
......
...@@ -44,7 +44,7 @@ namespace ...@@ -44,7 +44,7 @@ namespace
sample_type m; sample_type m;
dlib::rand::float_1a rnd; dlib::rand rnd;
// make some samples near the origin // make some samples near the origin
......
...@@ -45,7 +45,7 @@ namespace ...@@ -45,7 +45,7 @@ namespace
sample_type m; sample_type m;
dlib::rand::float_1a rnd; dlib::rand rnd;
// make some samples near the origin // make some samples near the origin
......
...@@ -93,7 +93,7 @@ namespace ...@@ -93,7 +93,7 @@ namespace
} }
time_t thetime; time_t thetime;
dlib::rand::float_1a rnd; dlib::rand rnd;
void perform_test( void perform_test(
) )
......
...@@ -857,7 +857,7 @@ namespace ...@@ -857,7 +857,7 @@ namespace
// test apq with a big vector // test apq with a big vector
p.set_size(500); p.set_size(500);
dlib::rand::float_1a rnd; dlib::rand rnd;
for (long i = 0; i < p.size(); ++i) for (long i = 0; i < p.size(); ++i)
{ {
p(i) = rnd.get_random_double()*20 - 10; p(i) = rnd.get_random_double()*20 - 10;
......
...@@ -217,8 +217,8 @@ namespace ...@@ -217,8 +217,8 @@ namespace
) )
{ {
dlog << LINFO << "testing kernel_1a"; dlog << LINFO << "testing kernel_1a";
rand_test<dlib::rand::kernel_1a>(); rand_test<dlib::rand>();
rand_test<dlib::rand::float_1a>(); rand_test<dlib::rand>();
} }
} a; } a;
......
...@@ -36,7 +36,7 @@ namespace ...@@ -36,7 +36,7 @@ namespace
{ {
} }
dlib::rand::float_1a rnd; dlib::rand rnd;
void perform_test ( void perform_test (
......
...@@ -133,7 +133,7 @@ namespace ...@@ -133,7 +133,7 @@ namespace
void test_running_covariance ( void test_running_covariance (
) )
{ {
dlib::rand::float_1a rnd; dlib::rand rnd;
std::vector<matrix<double,0,1> > vects; std::vector<matrix<double,0,1> > vects;
running_covariance<matrix<double,0,1> > cov, cov2; running_covariance<matrix<double,0,1> > cov, cov2;
......
...@@ -58,7 +58,7 @@ namespace ...@@ -58,7 +58,7 @@ namespace
sample_type m; sample_type m;
dlib::rand::float_1a rnd; dlib::rand rnd;
print_spinner(); print_spinner();
// we will make 50 points from each class // we will make 50 points from each class
...@@ -549,7 +549,7 @@ namespace ...@@ -549,7 +549,7 @@ namespace
offset_kernel<sigmoid_kernel<sample_type> > k5; offset_kernel<sigmoid_kernel<sample_type> > k5;
offset_kernel<radial_basis_kernel<sample_type> > k6; offset_kernel<radial_basis_kernel<sample_type> > k6;
dlib::rand::float_1a rnd; dlib::rand rnd;
sample_type x, y; sample_type x, y;
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
......
...@@ -33,7 +33,7 @@ namespace ...@@ -33,7 +33,7 @@ namespace
{ {
} }
dlib::rand::float_1a rnd; dlib::rand rnd;
// ----------------------------------- // -----------------------------------
......
...@@ -51,7 +51,7 @@ namespace ...@@ -51,7 +51,7 @@ namespace
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
dlib::rand::float_1a rnd; dlib::rand rnd;
template <typename T> template <typename T>
void test_with_rosen() void test_with_rosen()
......
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