41#include "psort/MersenneTwister.h"
45template<
typename T1,
typename T2>
49 return lhs.first ==
rhs.first;
56struct myset:
public std::unary_function<T, T>
69struct identity :
public std::unary_function<T, T>
81struct myidentity :
public std::unary_function<T, T>
92struct totality :
public std::unary_function<T, bool>
103struct safemultinv :
public std::unary_function<T, T>
107 T inf = std::numeric_limits<T>::max();
108 return (
x == 0) ?
inf:(1/
x);
114struct sel2nd:
public std::binary_function<T, T, T>
122template<
typename T1,
typename T2>
123struct bintotality :
public std::binary_function<T1, T2, bool>
140struct exponentiate :
public std::binary_function<double, double, double>
154struct maximum :
public std::binary_function<T, T, T>
172struct minimum :
public std::binary_function<T, T, T>
185struct RandReduce :
public std::binary_function<T, T, T>
190 return (
M.
rand() < 0.5)?
x :
y;
207struct SetIfNotEqual :
public std::binary_function<T, T, T>
233struct bitwise_and :
public std::binary_function<T, T, T>
251struct bitwise_or :
public std::binary_function<T, T, T>
268struct logical_xor :
public std::binary_function<T, T, T>
273 return (
x ||
y) && !(
x &&
y);
286struct bitwise_xor :
public std::binary_function<T, T, T>
const T operator()(const T &x, const T &y)
const T operator()(const T &x, const T &y)
bool operator()(const T1 &x, const T2 &y) const
T operator()(const T &x, const T &y) const
T operator()(const T &x, const T &y) const
T operator()(const T &x, const T &y) const
bool operator()(std::pair< T1, T2 > &lhs, std::pair< T1, T2 > &rhs)
double operator()(double x, double y) const
const T operator()(const T &x) const
T operator()(const T &x, const T &y) const
const T operator()(const T &x, const T &y) const
const T operator()(const T &x, const T &y) const
const T operator()(const T &x) const
const T & operator()(const T &x) const
const T operator()(const T &x) const
const T & operator()(const T &x, const T &y) const
bool operator()(const T &x) const