#include <cmath>
#include <limits>
#include <vector>
#include <stdexcept>
#include <boost/foreach.hpp>
#include <boost/random.hpp>
Go to the source code of this file.
Namespaces | |
| namespace | lshkit |
Defines | |
| #define | BOOST_CONCEPT_ASSERT(A) |
| Enable concept checking. | |
| #define | panic(_fmt, _args...) |
| Print a message and quit the program. The interface is like printf, but it prepends the source file name and line number to the output. | |
| #define | verify(_x) |
| A runtime version of assert. | |
Typedefs | |
| typedef boost::mt19937 | lshkit::DefaultRng |
| The default random number generator. | |
|
typedef boost::normal_distribution< float > | lshkit::Gaussian |
| Gaussian distribution. | |
|
typedef boost::cauchy_distribution< float > | lshkit::Cauchy |
| Cauchy distribution. | |
|
typedef boost::uniform_real< float > | lshkit::Uniform |
| Uniform distribution. | |
|
typedef boost::uniform_int< int > | lshkit::UniformInt |
| Uniform distribution with int values. | |
|
typedef boost::uniform_int< unsigned > | lshkit::UniformUnsigned |
| Uniform distribution with unsigned values. | |
Functions | |
| template<typename T> | |
| T | lshkit::min (T a, T b) |
| Take the minimum of two values. | |
| template<typename T> | |
| T | lshkit::max (T a, T b) |
| Take the maximum of two values. | |
| template<typename T> | |
| T | lshkit::sqr (const T &x) |
| Square function. | |
| void | lshkit::panic_intern (const char *fmt,...) |
| #define BOOST_CONCEPT_ASSERT | ( | A | ) |
Enable concept checking.
Concept checking requires boost > 1.35. Remove this definition to disable concept checking.
| #define panic | ( | _fmt, | |||
| _args... | ) |
Value:
do { \ lshkit::panic_intern("%s: %s: %d: "_fmt, \ __FILE__, \ __FUNCTION__, \ __LINE__ , \ ## _args); \ } while (0)
| #define verify | ( | _x | ) |
Value:
do { \ if (_x) { \ /* noop */ \ } else { \ panic("!(%s)", #_x); \ } \ } while (0)