print
append
tol
randgen
randint
natrual
perturb
ftovec
rand_vlist
shuffled_vlist
ftostr
test_constexpr
(bolded sections are more interesting)
toggle TOC (ctrl + ⇔)
sal/algo/utility.h
| append | |
| tol | |
| randgen | |
| randint | |
| natrual | |
| perturb | |
| ftovec | |
| rand_vlist | |
| shuffled_vlist | |
| ftostr | |
| test_constexpr | |
| Rand_int | |
|---|---|
| Timer | |
| Pointer_hash |
print ¶
Declaration
template <typename Iter>
void print(Iter begin, Iter end, std::ostream& os = std::cout);
template <typename Sequence>
void print(const Sequence& v, std::ostream& os = std::cout);Parameters
| begin | |
| end | |
| os | |
| v |
Return value
Example
Discussion
append ¶
Declaration
template <typename Sequence>
void append(Sequence& a, const Sequence& b);Parameters
| a | |
| b |
Return value
Example
Discussion
tol ¶
Declaration
long tol(const char* s);
long tol(const std::string& s);Parameters
| s |
Return value
Example
Discussion
randgen ¶
Declaration
std::vector<int> randgen(int min, int max, size_t num);
template <typename T>
std::vector<T> randgen(T min, T max, size_t num, int granularity);Parameters
| min | |
| max | |
| num | |
| granularity |
Return value
Example
Discussion
randint ¶
Declaration
int randint(int min, int max);
int randint(int max);Parameters
| min | |
| max |
Return value
Example
Discussion
natrual ¶
Declaration
int natrual();Return value
Example
Discussion
perturb ¶
Declaration
template <typename Iter>
void perturb(const Iter begin, const Iter end, size_t range);Parameters
| begin | |
| end | |
| range |
Return value
Example
Discussion
ftovec ¶
Declaration
template <typename T>
vector_2d<T> ftovec(const std::string& name, int& n_line, int& w_line, int& range);Parameters
| name | |
| n_line | |
| w_line | |
| range |
Return value
Example
Discussion
rand_vlist ¶
Declaration
template <typename T>
vector_2d<T> rand_vlist(int l_num, int l_size, int r);Parameters
| l_num | |
| l_size | |
| r |
Return value
Example
Discussion
shuffled_vlist ¶
Declaration
template <typename T>
vector_2d<T> shuffled_vlist(int l_num, int l_size, int r);Parameters
| l_num | |
| l_size | |
| r |
Return value
Example
Discussion
ftostr ¶
Declaration
std::vector<std::string> ftostr(const std::string& name);Parameters
| name |
Return value
Example
Discussion
test_constexpr ¶
Declaration
template <typename T, T x>
constexpr bool test_constexpr(bool print);Parameters
Return value
Example
Discussion