19 #ifndef LIBMESH_UTILITY_H 20 #define LIBMESH_UTILITY_H 56 template <
typename ForwardIter,
typename T>
57 void iota (ForwardIter first, ForwardIter last, T
value)
76 template<
class InputIterator >
77 bool is_sorted(InputIterator first, InputIterator last)
94 InputIterator
prev( first );
95 for (++first; first != last; ++
prev, ++first)
134 template<
class ForwardIterator,
class T>
137 ForwardIterator it = std::lower_bound(first, last,
value);
138 return (it == last ||
value < *it) ? last : it;
144 template<
class ForwardIterator,
class T,
class Compare>
145 ForwardIterator
binary_find(ForwardIterator first, ForwardIterator last,
const T &
value, Compare comp)
147 ForwardIterator it = std::lower_bound(first, last,
value, comp);
148 return (it == last || comp(
value,*it)) ? last : it;
156 template <
int N,
typename T>
167 return xNover2*xNover2;
174 template <
typename T>
185 template <
typename T>
187 static inline T
apply (
const T & x) {
return x; }
190 template <
typename T>
192 static inline T
apply (
const T &) {
return 1; }
196 template <
int N,
typename T>
210 unsigned int factorial_n = 1;
215 for (
unsigned int i=1; i<n; i++)
223 template <
typename T>
233 for (T i = 0; i < k; ++i)
246 template <
typename T>
249 std::vector<T>().
swap(vec);
255 #ifdef LIBMESH_USE_COMPLEX_NUMBERS 263 unsigned int r_o_c=0);
269 std::vector<Real> & real_part,
270 std::vector<Real> & imag_part);
272 #endif // #ifdef LIBMESH_USE_COMPLEX_NUMBERS 278 int mkdir(
const char* pathname);
304 template <
typename T>
329 template <
typename T>
336 unsigned char * b = (
unsigned char *) &
data;
339 int j=(
sizeof(T) - 1);
356 #endif // LIBMESH_UTILITY_H
std::string complex_filename(const std::string &basename, unsigned int r_o_c=0)
void deallocate(std::vector< T > &vec)
int mkdir(const char *pathname)
std::string system_info()
void iota(ForwardIter first, ForwardIter last, T value)
static T apply(const T &)
static T apply(const T &x)
T operator()(T &data) const
void prepare_complex_data(const std::vector< Complex > &source, std::vector< Real > &real_part, std::vector< Real > &imag_part)
static T apply(const T &x)
static T apply(const T &x)
void swap(Iterator &lhs, Iterator &rhs)
unsigned int factorial(unsigned int n)
bool is_sorted(InputIterator first, InputIterator last)
ForwardIterator binary_find(ForwardIterator first, ForwardIterator last, const T &value)
ReverseBytes(const bool dr)