Classes | Namespaces | Functions
misc.h File Reference

Miscellaneous functions. More...

#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <cmath>
#include <map>
#include <initializer_list>
#include <o2scl/err_hnd.h>

Go to the source code of this file.

Classes

class  o2scl::gen_test_number< tot >
 Generate number sequence for testing. More...
 
class  o2scl::vec_index
 A class to assign string labels to array indices. More...
 

Namespaces

 o2scl
 The main O2scl namespace.
 

Functions

int o2scl_python_test (int x)
 
template<class data_t >
data_t o2scl::quadratic_extremum_x (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3)
 Return the x value of the extremum of a quadratic defined by three $ (x,y) $ pairs. More...
 
template<class data_t >
void o2scl::quadratic_extremum_y_full (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, const data_t &xmin, const data_t &ymin, const data_t &a, const data_t &b, const data_t &c, const data_t &den)
 Return values related to a quadratic defined by three $ (x,y) $ pairs. More...
 
template<class data_t >
data_t o2scl::quadratic_extremum_y (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3)
 Return the y value of the extremum of a quadratic defined by three $ (x,y) $ pairs. More...
 
template<class data_t >
void o2scl::quadratic_extremum_xy (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, data_t &x, data_t &y)
 Return the (x,y) for the extremum of a quadratic defined by three $ (x,y) $ pairs. More...
 
template<class data_t >
void o2scl::quadratic_extremum_coeffs (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, data_t &a, data_t &b, data_t &c)
 Return the (x,y) for the extremum of a quadratic defined by three $ (x,y) $ pairs. More...
 
Functions from misc.h
double o2scl::fermi_function (double E, double mu, double T, double limit=40.0)
 Calculate a Fermi-Dirac distribution function safely. More...
 
int o2scl::pipe_cmd_string (std::string cmd, std::string &result, bool err_on_fail=true, int nmax=80)
 Store the first line from the output of the shell command cmd up to nmax characters in result. More...
 
std::string o2scl::pipe_cmd_string (std::string cmd, int nmax=80)
 Return the first line from the output of the shell command cmd up to nmax characters. More...
 
template<class string_arr_t >
void o2scl::screenify (size_t nin, const string_arr_t &in_cols, std::vector< std::string > &out_cols, size_t max_size=80)
 Reformat the columns for output of width size. More...
 
size_t o2scl::count_words (std::string str)
 Count the number of words in the string str. More...
 
void o2scl::remove_whitespace (std::string &s)
 Remove all whitespace from the string s. More...
 
std::string o2scl::binary_to_hex (std::string s)
 Take a string of binary quads and compress them to hexadecimal digits. More...
 
void o2scl::RGBtoHSV (double r, double g, double b, double &h, double &s, double &v)
 Convert RGB to HSV color. More...
 
void o2scl::HSVtoRGB (double h, double s, double v, double &r, double &g, double &b)
 Convert RGB to HSV color. More...
 

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).