The main O2scl namespace. More...
Classes | |
class | anneal_base |
Simulated annealing base. More... | |
class | anneal_gsl |
Multidimensional minimization by simulated annealing (GSL) More... | |
class | anneal_mt |
Multidimensional minimization by simulated annealing (Boost multi-threaded version) More... | |
class | anneal_para |
Multidimensional minimization by simulated annealing (OpenMP/MPI version) More... | |
class | astep_base |
Adaptive stepper [abstract base]. More... | |
class | astep_gsl |
Adaptive ODE stepper (GSL) More... | |
class | astep_nonadapt |
An non-adaptive stepper implementation of astep_base. More... | |
class | calculator |
Evaluate a mathematical expression in a string. More... | |
class | cheb_approx_tl |
Chebyshev approximation (GSL) More... | |
class | chi_fit_funct |
Standard fitting function based on one-dimensional data with a numerical Jacobian. More... | |
class | cli |
Configurable command-line interface. More... | |
class | cli_readline |
An extension to o2scl::cli which uses readline. More... | |
struct | cmd_line_arg |
A command-line argument for o2scl::cli. More... | |
class | columnify |
Create nicely formatted columns from a table of strings. More... | |
class | comm_option_fptr |
Function pointer for o2scl::cli command function. More... | |
class | comm_option_funct |
Base for o2scl::cli command function. More... | |
class | comm_option_mfptr |
Member function pointer for o2scl::cli command function. More... | |
struct | comm_option_s |
Command for interactive mode in o2scl::cli. More... | |
class | const_matrix_column_gen |
Generic object which represents a column of a const matrix. More... | |
class | const_matrix_row_gen |
Generic object which represents a row of a const matrix. More... | |
class | const_matrix_view |
A simple matrix view object. More... | |
class | const_matrix_view_table |
View a o2scl::table object as a matrix. More... | |
class | const_matrix_view_table_transpose |
View a o2scl::table object as a matrix. More... | |
class | const_vector_range_gen |
Experimental const vector range object. More... | |
class | contour |
Calculate contour lines from a two-dimensional data set. More... | |
class | contour_line |
A contour line. More... | |
class | convert_units |
Convert units. More... | |
class | cubic_complex |
Solve a cubic polynomial with complex coefficients and complex roots [abstract base]. More... | |
class | cubic_complex_std |
Solve a cubic with complex coefficients and complex roots. More... | |
class | cubic_real |
Solve a cubic polynomial with real coefficients and real roots [abstract base]. More... | |
class | cubic_real_coeff |
Solve a cubic polynomial with real coefficients and complex roots [abstract base]. More... | |
class | cubic_real_coeff_cern |
Solve a cubic with real coefficients and complex roots (CERNLIB) More... | |
class | cubic_real_coeff_gsl |
Solve a cubic with real coefficients and complex roots (GSL) More... | |
class | deriv_base |
Numerical differentiation base [abstract base]. More... | |
class | deriv_cern |
Numerical differentiation routine (CERNLIB) More... | |
class | deriv_eqi |
Derivatives for equally-spaced abscissas. More... | |
class | deriv_gsl |
Numerical differentiation (GSL) More... | |
class | diff_evo |
Multidimensional minimization by the differential evolution method. More... | |
class | diff_evo_adapt |
Multidimensional minimization by the differential evolution method. More... | |
class | edge_crossings |
Edges for the contour class. More... | |
class | err_hnd_cpp |
Error handler to throw C++ exceptions. More... | |
class | err_hnd_gsl |
The error handler. More... | |
class | err_hnd_type |
Class defining an error handler [abstract base]. More... | |
class | exc_exception |
Generic exception. More... | |
class | exc_invalid_argument |
Invalid argument exception. More... | |
class | exc_ios_failure |
I/O failure error exception. More... | |
class | exc_logic_error |
Logic error exception. More... | |
class | exc_overflow_error |
Overflow error runtime exception. More... | |
class | exc_range_error |
Range error runtime exception. More... | |
class | exc_runtime_error |
Generic runtime error exception. More... | |
class | expval_base |
Expectation value base class. More... | |
class | expval_matrix |
Matrix expectation value. More... | |
class | expval_scalar |
Scalar expectation value. More... | |
class | expval_vector |
Vector expectation value. More... | |
class | fermi_dirac_integ_tl |
Fermi-Dirac integral. More... | |
class | fermion_nr_integ_gsl |
Compute the fermion integrals for a non-relativistic particle using the GSL functions. More... | |
class | fit_base |
Non-linear least-squares fitting [abstract base]. More... | |
class | fit_bayes |
Fit a function to data using Bayesian methods. More... | |
class | fit_fix_pars |
Multidimensional fitting class fixing some parameters and varying others. More... | |
class | fit_funct_strings |
String fitting function. More... | |
class | fit_linear |
Linear least-squares fitting class (GSL) More... | |
class | fit_min |
Non-linear least-squares fitting class with generic minimizer. More... | |
class | fit_nonlin |
Non-linear least-squares fitting class (GSL) More... | |
class | fit_nonlin_b |
Base routines for the nonlinear fitting classes. More... | |
class | format_float |
Format a floating point number into a Latex or HTML string. More... | |
class | funct2_string |
Two-dimensional function from a string. More... | |
class | funct_gsl |
A wrapper to specify o2scl::funct objects to GSL. More... | |
class | funct_string |
One-dimensional function from a string. More... | |
class | gen_fit_funct |
Generalized fitting function [abstract base]. More... | |
class | gen_test_number |
Generate number sequence for testing. More... | |
class | gradient |
Class for automatically computing gradients [abstract base]. More... | |
class | gradient_gsl |
Simple automatic computation of gradient by finite differencing. More... | |
class | gsl_matrix_wrap |
A simple convenience wrapper for GSL matrix objects. More... | |
class | gsl_tolerance |
Convergence test similar to gsl_root_test_interval() for root_toms748. More... | |
class | gsl_vector_wrap |
A simple convenience wrapper for GSL vector objects. More... | |
class | hist |
A one-dimensional histogram class. More... | |
class | hist_2d |
A two-dimensional histogram class. More... | |
class | index_spec |
Index specification. More... | |
class | inte |
Base integration class [abstract base]. More... | |
class | inte_adapt_cern |
Adaptive integration (CERNLIB) More... | |
class | inte_cauchy_cern |
Cauchy principal value integration (CERNLIB) More... | |
class | inte_cheb_gsl |
Chebyshev integration base class (GSL) More... | |
class | inte_cubature_base |
Base class for integration routines from the Cubature library. More... | |
class | inte_exp_sinh_boost |
Exp-sinh integration class (Boost) More... | |
class | inte_gauss56_cern |
5,6-point Gaussian quadrature (CERNLIB) More... | |
class | inte_gauss56_coeffs_cpp_dec_float_50 |
Integration weights and abcissas for o2scl::inte_gauss56_cern in long double precision. More... | |
class | inte_gauss56_coeffs_double |
Integration weights and abcissas for o2scl::inte_gauss56_cern in double precision. More... | |
class | inte_gauss56_coeffs_long_double |
Integration weights and abcissas for o2scl::inte_gauss56_cern in long double precision. More... | |
class | inte_gauss_cern |
Gaussian quadrature (CERNLIB) More... | |
class | inte_gauss_coeffs_cpp_dec_float_50 |
Integration weights and abcissas for o2scl::inte_gauss_cern and o2scl::inte_cauchy_cern for the cpp_dec_float_50 type. More... | |
class | inte_gauss_coeffs_double |
Integration weights and abcissas for o2scl::inte_gauss_cern and o2scl::inte_cauchy_cern in double precision. More... | |
class | inte_gauss_coeffs_long_double |
Integration weights and abcissas for o2scl::inte_gauss_cern and o2scl::inte_cauchy_cern in long double precision. More... | |
class | inte_gen |
Generalized multi-dimensional integration [abstract base]. More... | |
class | inte_gsl |
GSL integration base. More... | |
class | inte_hcubature |
Adaptive multidimensional integration on hyper-rectangles using cubature rules from the Cubature library. More... | |
class | inte_il |
Integrate over ![]() | |
class | inte_iu |
Integrate over ![]() | |
class | inte_kronrod_boost |
Gauss-Kronrod integration class (Boost) More... | |
class | inte_kronrod_gsl |
Basic Gauss-Kronrod integration class (GSL) More... | |
class | inte_multi |
Multi-dimensional integration over a hypercube [abstract base]. More... | |
class | inte_pcubature |
Integration by p-adaptive cubature from the Cubature library. More... | |
class | inte_qag_gsl |
Adaptive numerical integration of a function (without singularities) on a bounded interval (GSL) More... | |
class | inte_qagi_gsl |
Integrate a function over the interval ![]() | |
class | inte_qagil_gsl |
Integrate a function over the interval ![]() | |
class | inte_qagiu_gsl |
Integrate a function over the interval ![]() | |
class | inte_qags_gsl |
Integrate a function with a singularity (GSL) More... | |
class | inte_qawc_gsl |
Adaptive Cauchy principal value integration (GSL) More... | |
class | inte_qawf_gsl_cos |
Adaptive integration a function with finite limits of integration (GSL) More... | |
class | inte_qawf_gsl_sin |
Adaptive integration for oscillatory integrals (GSL) More... | |
class | inte_qawo_gsl_cos |
Adaptive integration a function with finite limits of integration (GSL) More... | |
class | inte_qawo_gsl_sin |
Adaptive integration for oscillatory integrals (GSL) More... | |
class | inte_qaws_gsl |
Adaptive integration with with algebraic-logarithmic singularities at the end-points (GSL) More... | |
class | inte_qng_gsl |
Non-adaptive integration from a to b (GSL) More... | |
class | inte_singular_gsl |
Base class for integrating a function with a singularity (GSL) More... | |
class | inte_sinh_sinh_boost |
Sinh-sinh integration class (Boost) More... | |
class | inte_tanh_sinh_boost |
Tanh-sinh integration class (Boost) More... | |
class | inte_transform_gsl |
Integrate a function with a singularity (GSL) [abstract base]. More... | |
class | inte_workspace_gsl |
Integration workspace for the GSL integrators. More... | |
class | interp |
Interpolation class for general vectors. More... | |
class | interp2_base |
Two-dimensional interpolation base class [abstract]. More... | |
class | interp2_direct |
Bilinear or bicubic two-dimensional interpolation. More... | |
class | interp2_eqi |
Two-dimensional interpolation for equally-spaced intervals. More... | |
class | interp2_neigh |
Nearest-neighbor interpolation in two dimensions. More... | |
class | interp2_planar |
Interpolate among two independent variables with planes. More... | |
class | interp2_seq |
Two-dimensional interpolation class by successive one-dimensional interpolation. More... | |
class | interp_akima |
Akima spline interpolation (GSL) More... | |
class | interp_akima_peri |
Akima spline interpolation with periodic boundary conditions (GSL) More... | |
class | interp_array |
A specialization of interp for C-style double arrays. More... | |
class | interp_array_vec |
A specialization of o2scl::interp_vec for C-style arrays. More... | |
class | interp_base |
Base low-level interpolation class [abstract base]. More... | |
class | interp_cspline |
Cubic spline interpolation (GSL) More... | |
class | interp_cspline_peri |
Cubic spline interpolation with periodic boundary conditions (GSL) More... | |
class | interp_krige |
Interpolation by Kriging with a user-specified covariance function. More... | |
class | interp_krige_optim |
One-dimensional interpolation using an optimized covariance function. More... | |
class | interp_linear |
Linear interpolation (GSL) More... | |
class | interp_monotonic |
Monotonicity-preserving interpolation. More... | |
class | interp_nearest_neigh |
Nearest-neighbor interpolation. More... | |
class | interp_steffen |
Steffen's monotonicity-preserving interpolation. More... | |
class | interp_vec |
Interpolation class for pre-specified vector. More... | |
class | interpm_idw |
Multi-dimensional interpolation by inverse distance weighting. More... | |
class | interpm_krige |
Multi-dimensional interpolation by kriging. More... | |
class | interpm_krige_nn |
Multi-dimensional interpolation by kriging with nearest-neighbor. More... | |
class | interpm_krige_optim |
One-dimensional interpolation using an optimized covariance function. More... | |
class | jacobian |
Base for providing a numerical jacobian [abstract base]. More... | |
class | jacobian_exact |
A direct calculation of the jacobian using a deriv_base object. More... | |
class | jacobian_gsl |
Simple automatic Jacobian. More... | |
class | lib_settings_class |
A class to manage global library settings. More... | |
class | matrix_column_gen |
Generic object which represents a column of a matrix. More... | |
class | matrix_row_gen |
Generic object which represents a row of a matrix. More... | |
class | matrix_row_gen_ctor |
Matrix row object with a constructor and resize method. More... | |
class | matrix_swap_table |
Swap part of a o2scl::table object into a matrix. More... | |
class | matrix_view |
A simple matrix view object. More... | |
class | matrix_view_omit_column |
Construct a view of a matrix omitting one specified column. More... | |
class | matrix_view_omit_row |
Construct a view of a matrix omtting a specified row. More... | |
class | matrix_view_table |
View a o2scl::table object as a matrix. More... | |
class | matrix_view_table_transpose |
View a o2scl::table object as a matrix. More... | |
class | matrix_view_transpose |
Construct a view of the transpose of a matrix. More... | |
class | matrix_view_vec_vec |
View a o2scl::table object as a matrix. More... | |
class | mcarlo |
Monte-Carlo integration [abstract base]. More... | |
class | mcarlo_miser |
Multidimensional integration using the MISER Monte Carlo algorithm (GSL) More... | |
class | mcarlo_plain |
Multidimensional integration using plain Monte Carlo (GSL) More... | |
class | mcarlo_vegas |
Multidimensional integration using Vegas Monte Carlo (GSL) More... | |
class | mcmc_para_base |
A generic MCMC simulation class. More... | |
class | mcmc_para_cli |
MCMC class with a command-line interface. More... | |
class | mcmc_para_old_base |
A generic MCMC simulation class. More... | |
class | mcmc_para_old_cli |
MCMC class with a command-line interface. More... | |
class | mcmc_para_old_table |
A generic MCMC simulation class writing data to a o2scl::table_units object. More... | |
class | mcmc_para_table |
A generic MCMC simulation class writing data to a o2scl::table_units object. More... | |
class | min_base |
One-dimensional minimization [abstract base]. More... | |
class | min_bkt_base |
One-dimensional bracketing minimization [abstract base]. More... | |
class | min_brent_boost |
One-dimensional minimization using Brent's method (GSL) More... | |
class | min_brent_gsl |
One-dimensional minimization using Brent's method (GSL) More... | |
class | min_cern |
One-dimensional minimization (CERNLIB) More... | |
class | min_de_base |
One-dimensional minimization using derivatives [abstract base]. More... | |
class | min_quad_golden |
Minimization of a function using the safeguarded step-length algorithm of Gill and Murray [GSL]. More... | |
class | mm_funct_strings |
Array of multi-dimensional functions in an array of strings. More... | |
class | mmin_base |
Multidimensional minimization [abstract base]. More... | |
class | mmin_bfgs2 |
Multidimensional minimization by the BFGS algorithm (GSL) More... | |
class | mmin_conf |
Multidimensional minimization by the Fletcher-Reeves conjugate gradient algorithm (GSL) More... | |
class | mmin_conp |
Multidimensional minimization by the Polak-Ribiere conjugate gradient algorithm (GSL) More... | |
class | mmin_constr |
Constrained multidimensional minimization (OOL) [abstract base]. More... | |
class | mmin_constr_gencan |
Constrained minimization by the "GENCAN" method (OOL) More... | |
class | mmin_constr_pgrad |
Constrained minimization by the projected gradient method (OOL) More... | |
class | mmin_constr_spg |
Constrained minimization by the spectral projected gradient method (OOL) More... | |
class | mmin_fix_params |
Multidimensional minimizer fixing some parameters and varying others. More... | |
class | mmin_gsl_base |
Base minimization routines for mmin_conf and mmin_conp. More... | |
class | mmin_linmin_gsl |
The line minimizer for mmin_bfgs2. More... | |
class | mmin_simp2 |
Multidimensional minimization by the Simplex method (v2) (GSL) More... | |
class | mmin_wrap_gsl |
Virtual base for the mmin_bfgs2 wrapper. More... | |
class | mmin_wrapper_gsl |
Wrapper class for the mmin_bfgs2 minimizer. More... | |
class | mroot |
Multidimensional root-finding [abstract base]. More... | |
class | mroot_broyden |
Multidimensional root-finding using Broyden's method (GSL) More... | |
class | mroot_cern |
Multi-dimensional mroot-finding routine (CERNLIB) More... | |
class | mroot_hybrids |
Multidimensional root-finding algorithm using Powell's Hybrid method (GSL) More... | |
class | mroot_hybrids_arma_qr_econ |
A version of mroot_hybrids which uses Armadillo for the QR decomposition. More... | |
class | mroot_hybrids_base |
Base functions for mroot_hybrids. More... | |
class | mroot_hybrids_eigen |
A version of mroot_hybrids which uses Eigen for the QR decomposition. More... | |
class | multi_funct_strings |
A multi-dimensional function from a string. More... | |
class | ode_bsimp_gsl |
Bulirsch-Stoer implicit ODE stepper (GSL) More... | |
class | ode_bv_mshoot |
Solve boundary-value ODE problems by multishooting with a generic nonlinear solver. More... | |
class | ode_bv_multishoot |
Solve a ODE boundary value problem by multishooting. More... | |
class | ode_bv_shoot |
Solve boundary-value ODE problems by shooting from one boundary to the other. More... | |
class | ode_bv_shoot_grid |
Solve boundary-value ODE problems by shooting from one boundary to the other on a grid. More... | |
class | ode_bv_solve |
Base class for boundary-value ODE solvers. More... | |
class | ode_control_gsl |
Control structure for astep_gsl. More... | |
class | ode_funct_strings |
One-dimensional function from strings. More... | |
class | ode_it_solve |
ODE solver using a generic linear solver to solve finite-difference equations. More... | |
class | ode_iv_solve |
Solve an initial-value ODE problems given an adaptive ODE stepper. More... | |
class | ode_iv_solve_grid |
Solve an initial-value ODE problems on a grid given an adaptive ODE stepper. More... | |
class | ode_iv_table |
Solve an initial-value ODE problem and store the result in a table object. More... | |
class | ode_rk8pd_gsl |
Embedded Runge-Kutta Prince-Dormand ODE stepper (GSL) More... | |
class | ode_rkck_gsl |
Cash-Karp embedded Runge-Kutta ODE stepper (GSL) More... | |
class | ode_rkf45_gsl |
Runge-Kutta-Fehlberg embedded Runge-Kutta ODE stepper (GSL) More... | |
class | ode_step |
ODE stepper base [abstract base]. More... | |
class | permutation |
A class for representing permutations. More... | |
class | pinside |
Test line intersection and point inside polygon. More... | |
class | poly_complex |
Solve a general polynomial with complex coefficients [abstract base]. More... | |
class | poly_real_coeff |
Solve a general polynomial with real coefficients and complex roots [abstract base]. More... | |
class | poly_real_coeff_gsl |
Solve a general polynomial with real coefficients (GSL) More... | |
class | polylog |
Polylogarithms (approximate) ![]() | |
class | prob_cond_mdim |
A multi-dimensional conditional probability density function. More... | |
class | prob_cond_mdim_fixed_step |
Conditional probability for a random walk inside a hypercube. More... | |
class | prob_cond_mdim_gaussian |
A multi-dimensional Gaussian conditional probability density function. More... | |
class | prob_cond_mdim_indep |
A multi-dimensional conditional probability density function independent of the input. More... | |
class | prob_dens_frange |
A one-dimensional probability density over a finite range. More... | |
class | prob_dens_func |
A one-dimensional probability density function. More... | |
class | prob_dens_gaussian |
A one-dimensional Gaussian probability density. More... | |
class | prob_dens_hist |
Probability density function based on a histogram. More... | |
class | prob_dens_lognormal |
Lognormal density function. More... | |
class | prob_dens_mdim |
A multi-dimensional probability density function. More... | |
class | prob_dens_mdim_amr |
Probability distribution from an adaptive mesh created using a matrix of points. More... | |
class | prob_dens_mdim_biv_gaussian |
A bivariate gaussian probability distribution. More... | |
class | prob_dens_mdim_bound_gaussian |
Gaussian distribution bounded by a hypercube. More... | |
class | prob_dens_mdim_factor |
A multidimensional distribution formed by the product of several one-dimensional distributions. More... | |
class | prob_dens_mdim_gaussian |
A multi-dimensional Gaussian probability density function using a Cholesky decomposition. More... | |
class | prob_dens_positive |
A one-dimensional probability density over the positive real numbers. More... | |
class | prob_dens_uniform |
A uniform one-dimensional probability density over a finite range. More... | |
class | quadratic_complex |
Solve a quadratic polynomial with complex coefficients and complex roots [abstract base]. More... | |
class | quadratic_complex_std |
Solve a quadratic with complex coefficients and complex roots. More... | |
class | quadratic_real |
Solve a quadratic polynomial with real coefficients and real roots [abstract base]. More... | |
class | quadratic_real_coeff |
Solve a quadratic polynomial with real coefficients and complex roots [abstract base]. More... | |
class | quadratic_real_coeff_gsl |
Solve a quadratic with real coefficients and complex roots (GSL) More... | |
class | quartic_complex |
Solve a quartic polynomial with complex coefficients and complex roots [abstract base]. More... | |
class | quartic_complex_simple |
Solve a quartic with complex coefficients and complex roots. More... | |
class | quartic_real |
Solve a quartic polynomial with real coefficients and real roots [abstract base]. More... | |
class | quartic_real_coeff |
Solve a quartic polynomial with real coefficients and complex roots [abstract base]. More... | |
class | quartic_real_coeff_cern |
Solve a quartic with real coefficients and complex roots (CERNLIB) More... | |
class | quartic_real_gsl |
Solve a quartic with real coefficients and real roots (GSL) More... | |
class | quartic_real_gsl2 |
Solve a quartic with real coefficients and real roots (GSL) More... | |
class | quartic_real_simple |
Solve a quartic with real coefficients and real roots. More... | |
class | rng_gsl |
Random number generator (GSL) More... | |
class | rng_gsl_uniform_real |
An alternative RNG type used to design templates for either GSL or STL random number generators. More... | |
class | root |
One-dimensional solver [abstract base]. More... | |
class | root_bkt |
One-dimensional bracketing solver [abstract base]. More... | |
class | root_bkt_cern |
One-dimensional root-finding routine (CERNLIB) More... | |
class | root_brent_gsl |
One-dimensional root-finding (GSL) More... | |
class | root_cern |
One-dimensional version of cern_mroot. More... | |
class | root_de |
One-dimensional with solver with derivatives [abstract base]. More... | |
class | root_robbins_monro |
One-dimensional root-finding for noisy functions. More... | |
class | root_stef |
Steffenson equation solver (GSL) More... | |
class | root_toms748 |
Bracketing solver based the Boost implementation of TOMS 748. More... | |
class | search_vec |
Searching class for monotonic data with caching. More... | |
class | search_vec_ext |
An extended search_vec which is allowed to return the last element. More... | |
class | series_acc |
Series acceleration by Levin u-transform (GSL) More... | |
class | slack_messenger |
Object to send messages to Slack using curl. More... | |
class | smooth_func |
Smooth a function by averaging in a neighborhood of points defined by a Sobol sequence. More... | |
class | smooth_gsl |
Smooth a GSL vector using GSL bsplines. More... | |
class | table |
Data table class. More... | |
class | table3d |
A data structure containing one or more slices of two-dimensional data points defined on a grid. More... | |
class | table_units |
Data table class with units. More... | |
class | tensor |
Tensor class with arbitrary dimensions. More... | |
class | tensor1 |
Rank 1 tensor. More... | |
class | tensor2 |
Rank 2 tensor. More... | |
class | tensor3 |
Rank 3 tensor. More... | |
class | tensor4 |
Rank 4 tensor. More... | |
class | tensor_grid |
Tensor class with arbitrary dimensions with a grid. More... | |
class | tensor_grid1 |
Rank 1 tensor with a grid. More... | |
class | tensor_grid2 |
Rank 2 tensor with a grid. More... | |
class | tensor_grid3 |
Rank 3 tensor with a grid. More... | |
class | tensor_grid4 |
Rank 4 tensor with a grid. More... | |
class | test_mgr |
A class to manage testing and record success and failure. More... | |
class | Token |
Token class for o2scl::calculator. More... | |
struct | TokenBase |
Token base data type for o2scl::calculator. More... | |
class | uniform_grid |
A class representing a uniform linear or logarithmic grid. More... | |
class | uniform_grid_end |
Linear grid with fixed number of bins and fixed endpoint. More... | |
class | uniform_grid_end_width |
Linear grid with fixed endpoint and fixed bin size. More... | |
class | uniform_grid_log_end |
Logarithmic grid with fixed number of bins and fixed endpoint. More... | |
class | uniform_grid_log_end_width |
Logarithmic grid with fixed endpoint and fixed bin size. More... | |
class | uniform_grid_log_width |
Logarithmic grid with fixed number of bins and fixed bin size. More... | |
class | uniform_grid_width |
Linear grid with fixed number of bins and fixed bin size. More... | |
class | uniform_prior |
An unnormalized uniform prior distribution for several variables. More... | |
class | vec_index |
A class to assign string labels to array indices. More... | |
class | vector_index_vector |
Trivial index vector. More... | |
class | vector_index_vector_size |
Index vector with a size method. More... | |
class | vector_range_gen |
Experimental vector range object. More... | |
Typedefs | |
typedef std::function< double(double)> | funct |
One-dimensional function typedef in src/base/funct.h. | |
typedef std::function< long double(long double)> | funct_ld |
One-dimensional function typedef in src/base/funct.h. | |
typedef std::function< boost::multiprecision::cpp_dec_float_50(boost::multiprecision::cpp_dec_float_50)> | funct_cdf50 |
One-dimensional function typedef in src/base/funct.h. More... | |
typedef std::function< int(size_t, const boost::numeric::ublas::vector< double > &, boost::numeric::ublas::vector< double > &) > | mm_funct |
Array of multi-dimensional functions typedef in src/base/mm_funct.h. | |
typedef std::function< double(size_t, const boost::numeric::ublas::vector< double > &)> | multi_funct |
Multi-dimensional function typedef in src/base/multi_funct.h. | |
typedef std::queue< TokenBase * > | TokenQueue_t |
A typedef for a queue of tokens for o2scl::calculator. | |
typedef boost::numeric::ublas::range | ub_range |
A ublas::range typedef for o2scl::tensor_grid and related classes in src/base/tensor_grid.h. | |
typedef boost::numeric::ublas::vector_range< boost::numeric::ublas::vector< double > > | ubvector_range |
A ublas::vector_range typedef for o2scl::tensor_grid and related classes in src/base/tensor_grid.h. | |
typedef boost::numeric::ublas::vector_range< boost::numeric::ublas::vector< size_t > > | ubvector_size_t_range |
A ublas::vector_range typedef (size_t version) for o2scl::tensor_grid and related classes in src/base/tensor_grid.h. | |
typedef std::function< double(size_t, const boost::numeric::ublas::vector< double > &, double)> | fit_funct |
Array of multi-dimensional functions typedef (C++11 version) in src/fit/fit_base.h. | |
typedef boost::numeric::ublas::vector< double > | ubvector |
typedef boost::numeric::ublas::matrix< double > | ubmatrix |
typedef std::function< int(size_t, boost::numeric::ublas::vector< double > &, boost::numeric::ublas::vector< double > &)> | grad_funct |
Array of multi-dimensional functions typedef in src/min/mmin.h. | |
typedef std::function< int(size_t, const boost::numeric::ublas::vector< double > &, const boost::numeric::ublas::vector< double > &, boost::numeric::ublas::vector< double > &)> | ool_hfunct |
Hessian product function for o2scl::mmin_constr. | |
typedef std::function< int(double, size_t, const boost::numeric::ublas::vector< double > &, boost::numeric::ublas::vector< double > &)> | ode_funct |
Ordinary differential equation function in src/ode/ode_funct.h. | |
typedef std::function< double(size_t, double, boost::numeric::ublas::matrix_row< boost::numeric::ublas::matrix< double > > &)> | ode_it_funct |
Function for iterative solving of ODEs. | |
typedef matrix_row_gen_ctor< boost::numeric::ublas::matrix< double > > | solve_grid_mat_row |
typedef std::function< int(double, size_t, const solve_grid_mat_row &, solve_grid_mat_row &)> | ode_funct_solve_grid |
typedef std::function< int(double, size_t, const boost::numeric::ublas::vector< double > &, boost::numeric::ublas::matrix< double > &, boost::numeric::ublas::vector< double > &) > | ode_jac_funct |
Functor for ODE Jacobians in src/ode/ode_jac_funct.h. | |
typedef cheb_approx_tl< double > | cheb_approx |
Double-precision version of o2scl::cheb_approx_tl. | |
typedef fermi_dirac_integ_tl< inte_iu< funct, inte_adapt_cern< funct, inte_gauss56_cern< funct, double, inte_gauss56_coeffs_double >, 100, double >, double >, double > | fermi_dirac_integ_double |
Double-precision version of o2scl::fermi_dirac_integ_tl. | |
typedef fermi_dirac_integ_tl< inte_iu< funct_ld, inte_adapt_cern< funct_ld, inte_gauss56_cern< funct_ld, long double, inte_gauss56_coeffs_long_double >, 1000, long double >, long double >, long double > | fermi_dirac_integ_long_double |
Long double version of o2scl::fermi_dirac_integ_tl. | |
typedef std::function< int(size_t, boost::numeric::ublas::vector< double > &, size_t, boost::numeric::ublas::vector< double > &, boost::numeric::ublas::matrix< double > &) > | jac_funct |
Jacobian function (not necessarily square) in src/root/jacobian.h. | |
Variables | |
err_hnd_type * | err_hnd |
The global error handler pointer. | |
err_hnd_gsl | alt_err_hnd |
An alternate GSL-like error handler. | |
err_hnd_cpp | def_err_hnd |
The default error handler. | |
lib_settings_class | o2scl_settings |
The global library settings object. More... | |
By default, all O2scl classes and functions which are not listed as being in one of O2scl 's smaller specialized namespaces are in this namespace.
This namespace documentation is in the file src/base/lib_settings.h
typedef std::function<boost::multiprecision::cpp_dec_float_50 (boost::multiprecision::cpp_dec_float_50)> o2scl::funct_cdf50 |
anonymous enum |
The errors associated with the integers between -2 and 32 are based on GSL, the rest are specific to O2scl .
anonymous enum |
int o2scl::array_2d_out | ( | std::ostream & | os, |
size_t | nrows, | ||
size_t | ncols, | ||
mat_t & | A | ||
) |
The type mat_t
can be any 2d-array type which allows individual element access using [size_t][size_t]
This outputs all of the matrix elements using output settings specified by os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.
This function outputs the matrix assuming the first index is the row index and the second index is the column index. For the opposite convention, use array_2d_trans_out().
Definition at line 419 of file columnify.h.
int o2scl::array_2d_trans_out | ( | std::ostream & | os, |
size_t | nrows, | ||
size_t | ncols, | ||
mat_t & | A | ||
) |
The type mat_t
can be any 2d-array type which allows individual element access using [size_t][size_t]
This outputs all of the matrix elements using output settings specified by os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.
This function outputs the matrix assuming the first index is the column index and the second index is the row index. For the opposite convention, use array_2d_out().
Definition at line 463 of file columnify.h.
std::string o2scl::binary_to_hex | ( | std::string | s | ) |
This function proceeds from left to right, ignoring parts of the string that do not consist of squences of four '1's or '0's.
double o2scl::bose_function | ( | double | E, |
double | mu, | ||
double | T, | ||
double | limit = 40.0 |
||
) |
This function computes a Bose-Einstein distribution function using an expansion to ensure accurate results when is near zero.
limit
is too large, depending on the machine precision.This function is used in the o2scl::boson_rel
class in O2scl_part .
std::string o2scl::btos | ( | bool | b | ) |
This returns "1"
for true and "0"
for false.
const boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<dat_t> > o2scl::const_vector_range | ( | boost::numeric::ublas::vector< dat_t > & | v, |
size_t | start, | ||
size_t | last | ||
) |
const boost::numeric::ublas::vector_range<boost::numeric::ublas::vector_range <boost::numeric::ublas::vector<dat_t> > > o2scl::const_vector_range | ( | boost::numeric::ublas::vector_range< boost::numeric::ublas::vector< dat_t > > & | v, |
size_t | start, | ||
size_t | last | ||
) |
const boost::numeric::ublas::vector_range<const boost::numeric::ublas::vector<dat_t> > o2scl::const_vector_range | ( | const boost::numeric::ublas::vector< dat_t > & | v, |
size_t | start, | ||
size_t | last | ||
) |
const boost::numeric::ublas::vector_range<const boost::numeric::ublas::vector_range <boost::numeric::ublas::vector<dat_t> > > o2scl::const_vector_range | ( | const boost::numeric::ublas::vector_range< boost::numeric::ublas::vector< dat_t > > & | v, |
size_t | start, | ||
size_t | last | ||
) |
const boost::numeric::ublas::vector_range<const boost::numeric::ublas::vector_range <const boost::numeric::ublas::vector<dat_t> > > o2scl::const_vector_range | ( | const boost::numeric::ublas::vector_range< const boost::numeric::ublas::vector< dat_t > > & | v, |
size_t | start, | ||
size_t | last | ||
) |
const dat_t* o2scl::const_vector_range | ( | const dat_t * | v, |
size_t | start, | ||
size_t | last | ||
) |
|
inline |
Defining
center
,
width
,
height
, this returns the value if
and
if
. The value near
or
is
(the value of the function exactly at these points is zero) and the value at
or
is
.
It is important to note that, for large distances of x
from center
, this only scales linearly. If you are trying to constrain a function which decreases more than linearly by making x
far from center
, then a minimizer may ignore this constraint.
|
inline |
Defining
center
,
width
,
height
,
tightness
, and
exp_arg_limit
, this returns the value
This function is continuous and differentiable. Note that if , then the function returns zero.
The exponential is handled gracefully by assuming that anything smaller than is zero. This creates a small discontinuity which can be removed with the sufficiently large value of
.
It is important to note that, for large distances of x
from center
, this scales quadratically. If you are trying to constrain a function which decreases faster than quadratically by making x
far from center
, then a minimizer may ignore this constraint.
In the limit , this function converges towards the squared value of constraint(), except exactly at the points
and
.
|
inline |
Defining
center
,
width
,
height
,
tightness
, and
exp_arg_limit
, this returns and has the advantage of being a continuous and differentiable function. The value of the function exactly at
is
, but for
just below
the function is
and just above
the function is quite small.
The exponential is handled gracefully by assuming that anything smaller than is zero. This creates a small discontinuity which can be removed with the sufficiently large value of
.
It is important to note that, for large distances of x
from center
, this only scales linearly. If you are trying to constrain a function which decreases more than linearly by making x
far from center
, then a minimizer may ingore this constraint.
In the limit , this function converges towards lower_bound(), except exactly at the point
.
size_t o2scl::count_words | ( | std::string | str | ) |
Words are defined as groups of characters separated by whitespace, where whitespace is any combination of adjacent spaces, tabs, carriage returns, etc. On most systems, whitespace is usually defined as any character corresponding to the integers 9 (horizontal tab), 10 (line feed), 11 (vertical tab), 12 (form feed), 13 (carriage return), and 32 (space bar). The test program misc_ts
enumerates the characters between 0 and 255 (inclusive) that count as whitespace for this purpose.
std::string o2scl::dtos | ( | const fp_t & | x, |
int | prec = 6 , |
||
bool | auto_prec = false |
||
) |
If auto_prec
is false, then the number is converted to a string in the ios::scientific
mode, otherwise, neither the scientific or fixed mode flags are set and the number is converted to a string in "automatic" mode.
Definition at line 77 of file string_conv.h.
|
inline |
double o2scl::fermi_function | ( | double | E, |
double | mu, | ||
double | T, | ||
double | limit = 40.0 |
||
) |
This calculates a Fermi-Dirac distribution function guaranteeing that numbers larger than and smaller than
will be avoided. The default value of
limit=40
ensures accuracy to within 1 part in compared to the maximum of the distribution (which is unity).
Note that this function may return Inf or NAN if limit
is too large, depending on the machine precision.
double o2scl::function_to_double | ( | std::string | s | ) |
This function removes all quotes and apostrophes from the string and then uses o2scl::calculator to convert strings like "-1.0e-3", "1.0/3.0" and "exp(cos(-1.0e-2))" to floating point numbers.
int o2scl::function_to_double_nothrow | ( | std::string | s, |
double & | result | ||
) |
This function removes all quotes and apostrophes from the string and then uses o2scl::calculator to convert strings like "-1.0e-3", "1.0/3.0" and "exp(cos(-1.0e-2))" to floating point numbers.
int o2scl::glob_wrapper | ( | std::string | pattern, |
std::vector< std::string > & | matches | ||
) |
bool o2scl::has_minus_sign | ( | double * | x | ) |
This function returns true if the number pointed to by x
has a minus sign, determining this by converting the number to a string. It is useful, for example, in distinguishing "-0.0" from "+0.0".
void o2scl::HSVtoRGB | ( | double | h, |
double | s, | ||
double | v, | ||
double & | r, | ||
double & | g, | ||
double & | b | ||
) |
Taken from Nathan Schaller's webpage at http://www.cs.rit.edu/~ncs/color/t_convert.html
The inputs should be in the ranges ,
, and
. The output values
r
, g
, and b
are .
If s == 0, then h = -1 (undefined)
bool o2scl::is_number | ( | std::string | s | ) |
true
for some numbers and may return false
for some non-numbers. void o2scl::linear_or_log | ( | vec_t & | x, |
vec2_t & | y, | ||
bool & | log_x, | ||
bool & | log_y | ||
) |
void o2scl::linear_or_log | ( | vec_t & | y, |
bool & | log_y | ||
) |
double o2scl::linear_or_log_chi2 | ( | const vec_t & | x, |
const vec2_t & | y | ||
) |
Principally used by linear_or_log() .
|
inline |
Defining
center
,
width
,
height
, this returns if
and zero otherwise. The value at
is
, while the value at
is
.
It is important to note that, for large distances of x
from center
, this only scales linearly. If you are trying to constrain a function which decreases more than linearly by making x
far from center
, then a minimizer may ignore this constraint.
mat_column_t o2scl::matrix_column | ( | mat_t & | M, |
size_t | column | ||
) |
This class template works with combinations of ublas matrix
and matrix_column
objects, arma::mat
and arma::colvec
, and Eigen::MatrixXd
and Eigen::VectorXd
.
"o2scl::"
must often be specified, otherwise some compilers will use argument dependent lookup and get (justifiably) confused with matrix_column in the ublas namespace.void o2scl::matrix_copy | ( | mat_t & | src, |
mat2_t & | dest | ||
) |
void o2scl::matrix_copy | ( | size_t | M, |
size_t | N, | ||
mat_t & | src, | ||
mat2_t & | dest | ||
) |
Copy the first (M,N)
elements of src
to dest
. It is assumed that the memory allocation for dest
has already been performed.
This function will work for any class vec2_t
which has an operator[][] which returns a reference to the corresponding element and class vec_t
with an operator[][] which returns either a reference or the value of the corresponding element.
void o2scl::matrix_lookup | ( | const mat_t & | A, |
double | x0, | ||
size_t & | i, | ||
size_t & | j | ||
) |
void o2scl::matrix_lookup | ( | size_t | m, |
size_t | n, | ||
const mat_t & | A, | ||
double | x0, | ||
size_t & | i, | ||
size_t & | j | ||
) |
int o2scl::matrix_out | ( | std::ostream & | os, |
const mat_t & | A | ||
) |
The type mat_t
can be any matrix type which allows individual element access using operator()(size_t,size_t)
and access to the number of columns and rows using A.size1()
and A.size2()
.
This outputs all of the matrix elements using output settings specified by os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.
This function outputs the matrix assuming the first index is the row index and the second index is the column index. For the opposite convention, use matrix_trans_out().
Definition at line 294 of file columnify.h.
int o2scl::matrix_out | ( | std::ostream & | os, |
size_t | nrows, | ||
size_t | ncols, | ||
const mat_t & | A | ||
) |
The type mat_t
can be any matrix type which allows individual element access using operator()(size_t,size_t)
.
This outputs all of the matrix elements using output settings specified by os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.
This function outputs the matrix assuming the first index is the row index and the second index is the column index. For the opposite convention, use matrix_trans_out().
Definition at line 254 of file columnify.h.
mat_row_t o2scl::matrix_row | ( | mat_t & | M, |
size_t | row | ||
) |
This class template works with combinations of ublas matrix
and matrix_row
objects, arma::mat
and arma::rowvec
, and Eigen::MatrixXd
and Eigen::VectorXd
.
"o2scl::"
must often be specified, otherwise some compilers will use argument dependent lookup and get (justifiably) confused with matrix_row in the ublas namespace.void o2scl::matrix_swap | ( | mat_t & | m, |
size_t | i1, | ||
size_t | j1, | ||
size_t | i2, | ||
size_t | j2 | ||
) |
void o2scl::matrix_swap | ( | size_t | M, |
size_t | N, | ||
mat_t & | v1, | ||
mat2_t & | v2 | ||
) |
void o2scl::matrix_swap_cols | ( | size_t | M, |
mat_t & | m, | ||
size_t | j1, | ||
size_t | j2 | ||
) |
void o2scl::matrix_swap_cols_double | ( | size_t | M, |
mat_t & | m, | ||
size_t | j1, | ||
size_t | j2 | ||
) |
void o2scl::matrix_swap_double | ( | mat_t & | m, |
size_t | i1, | ||
size_t | j1, | ||
size_t | i2, | ||
size_t | j2 | ||
) |
void o2scl::matrix_swap_double | ( | size_t | M, |
size_t | N, | ||
mat_t & | m1, | ||
mat2_t & | m2 | ||
) |
void o2scl::matrix_swap_rows | ( | size_t | N, |
mat_t & | m, | ||
size_t | i1, | ||
size_t | i2 | ||
) |
void o2scl::matrix_swap_rows_double | ( | size_t | N, |
mat_t & | m, | ||
size_t | i1, | ||
size_t | i2 | ||
) |
int o2scl::matrix_trans_out | ( | std::ostream & | os, |
const mat_t & | A | ||
) |
The type mat_t
can be any matrix type which allows individual element access using operator()(size_t,size_t)
and access to the number of columns and rows using A.size1()
and A.size2()
.
This outputs all of the matrix elements using output settings specified by os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.
This function outputs the matrix assuming the first index is the column index and the second index is the row index. For the opposite convention, use matrix_out().
Definition at line 374 of file columnify.h.
int o2scl::matrix_trans_out | ( | std::ostream & | os, |
size_t | nrows, | ||
size_t | ncols, | ||
const mat_t & | A | ||
) |
The type mat_t
can be any matrix type which allows individual element access using operator()(size_t,size_t)
.
This outputs all of the matrix elements using output settings specified by os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.
This function outputs the matrix assuming the first index is the column index and the second index is the row index. For the opposite convention, use matrix_out().
Definition at line 334 of file columnify.h.
void o2scl::matrix_transpose | ( | mat_t & | src | ) |
void o2scl::matrix_transpose | ( | mat_t & | src, |
mat2_t & | dest | ||
) |
void o2scl::matrix_transpose | ( | size_t | m, |
size_t | n, | ||
mat_t & | src | ||
) |
void o2scl::matrix_transpose | ( | size_t | m, |
size_t | n, | ||
mat_t & | src, | ||
mat2_t & | dest | ||
) |
bool o2scl::o2isfinite | ( | const double | x | ) |
AWS, 11/11/19: Older compilers seem to require std::isfinite(), but then this causes problems making generic code which can use boost multiprecision arithmetic, so this function attempts to solve those problems.
std::ostream& o2scl::operator<< | ( | std::ostream & | os, |
const permutation & | p | ||
) |
A space is output between the permutation elements but no space or endline character is output after the last element.
If the size is zero, this function outputs nothing and does not call the error handler.
std::string o2scl::pipe_cmd_string | ( | std::string | cmd, |
int | nmax = 80 |
||
) |
This function always throws exceptions if it fails.
int o2scl::pipe_cmd_string | ( | std::string | cmd, |
std::string & | result, | ||
bool | err_on_fail = true , |
||
int | nmax = 80 |
||
) |
err_on_fail
is false, it will return a nonzero value).std::string o2scl::ptos | ( | void * | p | ) |
This uses an ostringstream
to convert a pointer to a string and is architecture-dependent.
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 | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
void o2scl::remove_whitespace | ( | std::string & | s | ) |
This function removes all characters in s
which correspond to the integer values 9, 10, 11, 12, 13, or 32.
void o2scl::rewrap_keep_endlines | ( | std::string | str, |
std::vector< std::string > & | sv, | ||
size_t | ncol = 79 |
||
) |
This function is used to format the help output in o2scl::cli .
void o2scl::RGBtoHSV | ( | double | r, |
double | g, | ||
double | b, | ||
double & | h, | ||
double & | s, | ||
double & | v | ||
) |
Taken from Nathan Schaller's webpage at http://www.cs.rit.edu/~ncs/color/t_convert.html
The inputs should be in the ranges ,
, and
. The output values
r
, g
, and b
are .
If s == 0, then h = -1 (undefined)
void o2scl::screenify | ( | size_t | nin, |
const string_arr_t & | in_cols, | ||
std::vector< std::string > & | out_cols, | ||
size_t | max_size = 80 |
||
) |
Given a string array in_cols
of size nin
, screenify() reformats the array into columns creating a new string array out_cols
.
For example, for an array of 10 strings
test1 test_of_string2 test_of_string3 test_of_string4 test5 test_of_string6 test_of_string77 test_of_string8 test_of_string9 test_of_string10
screenify() will create an array of 3 new strings:
test1 test_of_string4 test_of_string77 test_of_string10 test_of_string2 test5 test_of_string8 test_of_string3 test_of_string6 test_of_string9
If the value of max_size
is less than the length of the longest input string (plus one for a space character), then the output strings may have a larger length than max_size
.
size_t o2scl::size_of_exponent | ( | double | x | ) |
This returns 2 or 3, depending on whether or not the absolute magnitude of the exponent is greater than or equal to 100. It uses stringstream
to convert the number to a string and counts the number of characters directly.
void o2scl::split_string | ( | std::string | str, |
std::vector< std::string > & | sv | ||
) |
This function separates a string into words, and handles words that begin with a "</tt> by adding more words until finding
one which ends with another <tt>"
. Strings like
get parsed as "this", "is", "a", "test" and strings like
get parsed as "this is", "a", "test".
This is used to reformat command descriptions and help text for the screen width in cli::comm_option_help(), to process lines read from a file in cli::comm_option_run(), and to process input in cli::run_interactive().
"""test" test2"
test3"
.Replace with a better algorithm
Add user-specified delimiters?
bool o2scl::stob | ( | std::string | s, |
bool | err_on_fail = true |
||
) |
This returns true if only if the string has at least one character and the first non-whitespace character is either t
, T
, or one of the numbers 1 through 9.
If err_on_fail
is true and the conversion fails, this function calls the error handler, otherwise this function just returns false.
double o2scl::stod | ( | std::string | s | ) |
This function is now just a wrapper for std::stod
.
std::stod()
in C++11, you may have to explicitly provide the namespace, i.e. o2scl::stod()
in your code. int o2scl::stoi | ( | std::string | s | ) |
This function is now just a wrapper for std::stoi
.
size_t o2scl::stoszt | ( | std::string | s | ) |
If err_on_fail
is true and the conversion fails, this function calls the error handler, otherwise this function just returns zero.
int o2scl::stoszt_nothrow | ( | std::string | s, |
size_t & | result | ||
) |
If err_on_fail
is true and the conversion fails, this function calls the error handler, otherwise this function just returns zero.
double o2scl::vector_absdev | ( | const vec_t & | data | ) |
This function computes
where the value of is mean as computed from vector_mean().
This function produces the same results as gsl_stats_absdev()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 411 of file vec_stats.h.
double o2scl::vector_absdev | ( | const vec_t & | data, |
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_absdev_m()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 369 of file vec_stats.h.
double o2scl::vector_absdev | ( | size_t | n, |
const vec_t & | data | ||
) |
This function computes
where the value of is mean as computed from vector_mean().
This function produces the same results as gsl_stats_absdev()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 390 of file vec_stats.h.
double o2scl::vector_absdev | ( | size_t | n, |
const vec_t & | data, | ||
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_absdev_m()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 340 of file vec_stats.h.
size_t o2scl::vector_autocorr_tau | ( | const vec_t & | ac_vec, |
resize_vec_t & | five_tau_over_M | ||
) |
Representing the lag-k correlation coefficient by , Goodman defines
Then the autocorrelation length is the value of for which
This function computes the value of and stores it in the
five_tau_over_M
vector and then returns the first value of for which the vector is less than or equal to 1.0. If this function returns 0, then
is greater than 1.0 for all
, and this can be a sign that the autocorrelation length is too long to accurately resolve.
On completion, the vector five_tau_over_m
will have one less element than the vector ac_vec
.
Definition at line 1857 of file vec_stats.h.
void o2scl::vector_autocorr_vector | ( | const vec_t & | data, |
resize_vec_t & | ac_vec | ||
) |
This constructs a vector ac_vec
for which the kth entry stores the lag-k autocorrelation. This function chooses where
is the length of the
data
vector. The vector ac_vec
is resized to accomodate exactly values, from 0 to
.
Definition at line 1820 of file vec_stats.h.
double o2scl::vector_bin_size_freedman | ( | vec_t & | v | ) |
This function computes the optimal bin size of a histogram using the expression
where is the
quantile of the data (note this is quantile not quartile). This function sorts the vector in order to obtain the result.
From Freedman81 .
n
is less than or equal to 1, this function returns 0.0 without calling the error handler. Definition at line 1074 of file vec_stats.h.
double o2scl::vector_bin_size_scott | ( | const vec_t & | v | ) |
This function computes the optimal bin size of a histogram using the expression
From Scott79 .
n
is less than or equal to 1, this function returns 0.0 without calling the error handler. Definition at line 1006 of file vec_stats.h.
int o2scl::vector_bound_fracint | ( | size_t | n, |
vec_t & | x, | ||
vec2_t & | y, | ||
double | frac, | ||
double & | low, | ||
double & | high, | ||
int | boundaries = 0 , |
||
int | verbose = 0 , |
||
bool | err_on_fail = true |
||
) |
int o2scl::vector_bound_int | ( | size_t | n, |
vec_t & | x, | ||
vec2_t & | y, | ||
double | frac, | ||
double & | low, | ||
double & | high, | ||
int | boundaries = 0 , |
||
int | verbose = 0 , |
||
bool | err_on_fail = true |
||
) |
size_t o2scl::vector_bsearch | ( | const data_t | x0, |
const vec_t & | x | ||
) |
This function calls o2scl::vector_bsearch_inc() or o2scl::vector_bsearch_dec() depending on the ordering of x
.
size_t o2scl::vector_bsearch | ( | const data_t | x0, |
const vec_t & | x, | ||
size_t | lo, | ||
size_t | hi | ||
) |
This wrapper just calls o2scl::vector_bsearch_inc() or o2scl::vector_bsearch_dec() depending on the ordering of x
.
size_t o2scl::vector_bsearch_dec | ( | const data_t | x0, |
const vec_t & | x, | ||
size_t | lo, | ||
size_t | hi | ||
) |
This function performs a binary search of between x[lo]
and x[hi]
(inclusive). It returns
lo
if x0
> x[lo]
i
if x[i]
>= x0
> x[i+1]
for lo
<= i
< hi
hi-1
if x0
<= x
[hi-1]
The element at x[hi]
is never referenced by this function. The parameter hi
can be either the index of the last element (e.g. n-1
for a vector of size n
with starting index 0
), or the index of one element (e.g. n
for a vector of size n
and a starting index 0
) for a depending on whether or not the user wants to allow the function to return the index of the last element.
The operation of this function is undefined if the data is not strictly monotonic, i.e. if some of the data elements are equal.
This function will call the error handler if lo
is greater than hi
.
size_t o2scl::vector_bsearch_inc | ( | const data_t | x0, |
const vec_t & | x, | ||
size_t | lo, | ||
size_t | hi | ||
) |
This function performs a binary search of between x[lo]
and x[hi]
. It returns
lo
if x0
< x[lo]
i
if x[i]
<= x0
< x[i+2]
for lo
<= i
< hi
hi-1
if x0
>= x
[hi-1]
This function is designed to find the interval containing x0
, not the index of the element closest to x0. To perform the latter operation, you can use vector_lookup().
The element at x[hi]
is never referenced by this function. The parameter hi
can be either the index of the last element (e.g. n-1
for a vector of size n
with starting index 0
), or the index of one element (e.g. n
for a vector of size n
and a starting index 0
) for a depending on whether or not the user wants to allow the function to return the index of the last element.
This function operates in the same way as gsl_interp_bsearch()
.
The operation of this function is undefined if the data is not strictly monotonic, i.e. if some of the data elements are equal.
This function will call the error handler if lo
is greater than hi
.
double o2scl::vector_chi_squared | ( | const vec_t & | obs, |
const vec2_t & | exp, | ||
const vec3_t & | err | ||
) |
This function computes
where are the observed values,
are the expected values, and
are the errors.
Definition at line 977 of file vec_stats.h.
double o2scl::vector_chi_squared | ( | size_t | n, |
const vec_t & | obs, | ||
const vec2_t & | exp, | ||
const vec3_t & | err | ||
) |
This function computes
where are the observed values,
are the expected values, and
are the errors.
Definition at line 956 of file vec_stats.h.
void o2scl::vector_copy | ( | const vec_t & | src, |
vec2_t & | dest | ||
) |
void o2scl::vector_copy | ( | size_t | N, |
const vec_t & | src, | ||
vec2_t & | dest | ||
) |
Copy the first N
elements of src
to dest
. It is assumed that the memory allocation for dest
has already been performed.
This function will work for any class vec2_t
which has an operator[] which returns a reference to the corresponding element and class vec_t
with an operator[] which returns either a reference or the value of the corresponding element.
void o2scl::vector_copy_jackknife | ( | const vec_t & | src, |
size_t | iout, | ||
vec2_t & | dest | ||
) |
This funciton is used in o2scl::interp_krige_optim::qual_fun() .
void o2scl::vector_copy_jackknife | ( | size_t | sz, |
const vec_t & | src, | ||
size_t | iout, | ||
vec2_t & | dest | ||
) |
This funciton is used in o2scl::interp_krige_optim::qual_fun() .
double o2scl::vector_correlation | ( | const vec_t & | data1, |
const vec2_t & | data2 | ||
) |
This function computes the Pearson correlation coefficient between data1
and data2
.
This function produces the same results as gsl_stats_correlation()
.
If n
is zero, this function will call the error handler.
Definition at line 786 of file vec_stats.h.
double o2scl::vector_correlation | ( | size_t | n, |
const vec_t & | data1, | ||
const vec2_t & | data2 | ||
) |
This function computes the Pearson correlation coefficient between data1
and data2
.
This function produces the same results as gsl_stats_correlation()
.
If n
is zero, this function will call the error handler.
Definition at line 722 of file vec_stats.h.
double o2scl::vector_covariance | ( | const vec_t & | data1, |
const vec2_t & | data2 | ||
) |
This function computes
where and
are the averages of
data1
and data2
and are computed automatically using vector_mean().
This function produces the same results as gsl_stats_covariance()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 697 of file vec_stats.h.
double o2scl::vector_covariance | ( | const vec_t & | data1, |
const vec2_t & | data2, | ||
double | mean1, | ||
double | mean2 | ||
) |
This function computes
where and
are specified in
mean1
and mean2
, respectively.
This function produces the same results as gsl_stats_covariance_m()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 643 of file vec_stats.h.
double o2scl::vector_covariance | ( | size_t | n, |
const vec_t & | data1, | ||
const vec2_t & | data2 | ||
) |
This function computes
where and
are the averages of
data1
and data2
and are computed automatically using vector_mean().
This function produces the same results as gsl_stats_covariance()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 666 of file vec_stats.h.
double o2scl::vector_covariance | ( | size_t | n, |
const vec_t & | data1, | ||
const vec2_t & | data2, | ||
double | mean1, | ||
double | mean2 | ||
) |
This function computes
where and
are specified in
mean1
and mean2
, respectively.
This function produces the same results as gsl_stats_covariance_m()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 615 of file vec_stats.h.
void o2scl::vector_find_level | ( | double | level, |
size_t | n, | ||
vec_t & | x, | ||
vec2_t & | y, | ||
std::vector< double > & | locs | ||
) |
This function performs inverse linear interpolation of the data defined by x
and y
, finding all points in x
which have the property . All points for which this relation holds are put into the vector
locs
. The previous information contained in vector locs
before the function call is destroyed.
This is the 1-dimensional analog of finding contour levels as the contour class does for 2 dimensions.
This function will call the error handler if n
is less than two.
This function is inclusive of the endpoints, so that if either y[0]
and/or y[n-1]
is equal to level, then x[0]
and/or x[n-1]
are added to locs
, respectively.
fp_t o2scl::vector_integ_durand | ( | size_t | n, |
vec_t & | v | ||
) |
This function falls back to the equivalent of vector_integ_threept() for 3 points.
Definition at line 255 of file vector_derint.h.
fp_t o2scl::vector_integ_extended4 | ( | size_t | n, |
vec_t & | v | ||
) |
This function falls back to the equivalent of vector_integ_threept() for 3 points.
Definition at line 226 of file vector_derint.h.
fp_t o2scl::vector_integ_extended8 | ( | size_t | n, |
vec_t & | v | ||
) |
This function falls back to vector_integ_extended4() for less than 8 points.
Definition at line 279 of file vector_derint.h.
fp_t o2scl::vector_integ_threept | ( | size_t | n, |
vec_t & | v | ||
) |
Definition at line 193 of file vector_derint.h.
double o2scl::vector_integ_xy_interp | ( | size_t | n, |
const vec_t & | x, | ||
const vec2_t & | y, | ||
size_t | interp_type = itp_linear |
||
) |
Assuming vectors y
and x
define a function then this computes
using interpolation to approximate the result.
See also vector_deriv_interp() and vector_deriv2_interp() in vector_derint.h .
int o2scl::vector_invert_enclosed_sum | ( | double | sum, |
size_t | n, | ||
vec_t & | x, | ||
vec2_t & | y, | ||
double & | lev, | ||
int | boundaries = 0 , |
||
int | verbose = 0 , |
||
bool | err_on_fail = true |
||
) |
Defining a new function, which takes as input any y-value,
from the function
(specified with the parameters
x
and y
) and outputs the integral of the function over all regions where
. This function inverts
, taking the value of an integral as input, and returns the corresponding y-value in the variable
lev
.
This function is particularly useful, for example, in computing the region which defines 68% around a peak of data, thus providing confidence limits.
By default, this function does not allow any enclosed regions to go beyond the x region specified by the data. In some cases, it is useful to fix the boundaries to zero to ensure the integral is well-defined. If boundaries
is set to 1, then the LHS boundary is set to zero, if boundaries
is set to 2, then the RHS boundary is set to zero, and if boundaries
is set to 3, then both boundaries are set to zero.
Even if the boundaries are set to zero, the region enclosing a particular integral may not be well-defined, and this function can fail to find a region given a specified value of sum
. Linear interpolation is used to describe the function , and the precision of this function is limited by this assumption. This function may also sometimes fail if
sum
is very close to the minimum or maximum value of the function .
bool o2scl::vector_is_finite | ( | size_t | n, |
vec_t & | data | ||
) |
bool o2scl::vector_is_finite | ( | vec_t & | data | ) |
int o2scl::vector_is_monotonic | ( | size_t | n, |
vec_t & | data | ||
) |
If n
is zero or one, this function will return 0 without calling the error handler. If all the vector's elements are equal, this function will return 3. Otherwise, if the vector is not monotonic, then this function will return 0. Finally, if the vector is nondecreasing (increasing or equal intervals), this function will return 1, and if the vector is nonincreasing (decreasing or equal intervals), this function will return 2. This function assumes that simple comparison operators have been defined for the type of each vector element.
int o2scl::vector_is_monotonic | ( | vec_t & | data | ) |
If n
is zero or one, this function will return 0 without calling the error handler. If all the vector's elements are equal, this function will return 3. Otherwise, if the vector is not monotonic, then this function will return 0. Finally, if the vector is nondecreasing (increasing or equal intervals), this function will return 1, and if the vector is nonincreasing (decreasing or equal intervals), this function will return 2. This function assumes that simple comparison operators have been defined for the type of each vector element.
int o2scl::vector_is_strictly_monotonic | ( | size_t | n, |
vec_t & | data | ||
) |
If n
is zero this function will return 0 without calling the error handler. Also, if the vector is not monotonic, this function will return 0. If the vector is strictly monotonic, then this function will return 1 if it is increasing and 2 if it is decreasing.
int o2scl::vector_is_strictly_monotonic | ( | vec_t & | data | ) |
If n
is zero this function will return 0 without calling the error handler. Also, if the vector is not monotonic, this function will return 0. If the vector is strictly monotonic, then this function will return 1 if it is increasing and 2 if it is decreasing.
double o2scl::vector_kurtosis | ( | const vec_t & | data | ) |
This function computes
where the values of and
are computed using vector_mean() and vector_stddev().
This function produces the same results as gsl_stats_kurtosis()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 591 of file vec_stats.h.
double o2scl::vector_kurtosis | ( | const vec_t & | data, |
double | mean, | ||
double | stddev | ||
) |
This function computes
where the values of and
are given in
mean
and stddev
.
This function produces the same results as gsl_stats_kurtosis_m_sd()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 548 of file vec_stats.h.
double o2scl::vector_kurtosis | ( | size_t | n, |
const vec_t & | data | ||
) |
This function computes
where the values of and
are computed using vector_mean() and vector_stddev().
This function produces the same results as gsl_stats_kurtosis()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 569 of file vec_stats.h.
double o2scl::vector_kurtosis | ( | size_t | n, |
const vec_t & | data, | ||
double | mean, | ||
double | stddev | ||
) |
This function computes
where the values of and
are given in
mean
and stddev
.
This function produces the same results as gsl_stats_kurtosis_m_sd()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 521 of file vec_stats.h.
double o2scl::vector_lag1_autocorr | ( | const vec_t & | data | ) |
This function computes
This function produces the same results as gsl_stats_lag1_autocorrelation()
.
If n
is less than 2, this function will call the error handler.
Definition at line 1715 of file vec_stats.h.
double o2scl::vector_lag1_autocorr | ( | const vec_t & | data, |
double | mean | ||
) |
This function computes
This function produces the same results as gsl_stats_lag1_autocorrelation_m()
.
If n
is less than 2, this function will call the error handler.
Definition at line 1673 of file vec_stats.h.
double o2scl::vector_lag1_autocorr | ( | size_t | n, |
const vec_t & | data | ||
) |
This function computes
This function produces the same results as gsl_stats_lag1_autocorrelation()
.
If n
is less than 2, this function will call the error handler.
Definition at line 1694 of file vec_stats.h.
double o2scl::vector_lag1_autocorr | ( | size_t | n, |
const vec_t & | data, | ||
double | mean | ||
) |
This function computes
This function produces the same results as gsl_stats_lag1_autocorrelation_m()
.
If n
is less than 2, this function will call the error handler.
Definition at line 1637 of file vec_stats.h.
double o2scl::vector_lagk_autocorr | ( | const vec_t & | data, |
size_t | k | ||
) |
This function computes
If n<=k
, this function will call the error handler.
Definition at line 1806 of file vec_stats.h.
double o2scl::vector_lagk_autocorr | ( | const vec_t & | data, |
size_t | k, | ||
double | mean | ||
) |
This function computes
If n<=k
, this function will call the error handler.
Definition at line 1768 of file vec_stats.h.
double o2scl::vector_lagk_autocorr | ( | size_t | n, |
const vec_t & | data, | ||
size_t | k | ||
) |
This function computes
If n<=k
, this function will call the error handler.
Definition at line 1787 of file vec_stats.h.
double o2scl::vector_lagk_autocorr | ( | size_t | n, |
const vec_t & | data, | ||
size_t | k, | ||
double | mean | ||
) |
This function computes
If n<=k
, this function will call the error handler.
Definition at line 1733 of file vec_stats.h.
void o2scl::vector_largest | ( | size_t | n, |
vec_t & | data, | ||
size_t | k, | ||
vec_t & | largest | ||
) |
Given a vector data
of size n
this sets the first k
entries of the vector largest
to the k largest entries from vector data
in descending order. The vector largest
must be allocated beforehand to hold at least k
elements.
This works similarly to the GSL function gsl_sort_largest()
.
If k
is zero, then this function does nothing and returns o2scl::success .
void o2scl::vector_largest | ( | vec_t & | data, |
size_t | k, | ||
vec_t & | largest | ||
) |
Given a vector data
, this function sets the first k
entries of the vector largest
to the k largest entries from vector data
in ascending order. The vector largest
is resized if necessary to hold at least k
elements.
This works similarly to the GSL function gsl_sort_largest()
.
If k
is zero, then this function does nothing and returns o2scl::success .
size_t o2scl::vector_level_count | ( | double | level, |
size_t | n, | ||
vec_t & | x, | ||
vec2_t & | y | ||
) |
This function counts the number of times the function where the function is defined by the vectors
x
and y
.
The value returned is exactly the same as the size of the locs
vector computed by vector_find_level().
This function will call the error handler if n
is less than two.
If one of the entries in y
is either larger or smaller than its neighbors (i.e. if the function has an extremum), and if the value of
level
is exactly equal to the extremum, then this is counted as 1 level crossing. The same applies if either the first or last entry in y
is exactly equal to level
. Finite-precision errors may affect the result of this function when level
is nearly equal to one of the value in the vector y
.
size_t o2scl::vector_lookup | ( | const vec_t & | x, |
double | x0 | ||
) |
This function finds the element in vector x
which is closest to x0
. It ignores all elements in x
which are not finite. If the vector is empty, or if all of the elements in x
are not finite, then the error handler will be called.
This function works for all classes vec_t
with a size()
method and where an operator[] is defined which returns a double (either as a value or a reference).
size_t o2scl::vector_lookup | ( | size_t | n, |
const vec_t & | x, | ||
double | x0 | ||
) |
The function finds the element among the first n
elements of x
which is closest to the value x0
. It ignores all elements in x
which are not finite. If the vector is empty, or if all of the first n
elements in x
are not finite, then the error handler will be called.
This function works for all classes vec_t
where an operator[] is defined which returns a double (either as a value or a reference).
double o2scl::vector_mean | ( | const vec_t & | data | ) |
This function uses size()
to determine the vector size and produces the same results as gsl_stats_mean()
.
If the vector size is zero, this function will return zero.
Definition at line 70 of file vec_stats.h.
double o2scl::vector_mean | ( | size_t | n, |
const vec_t & | data | ||
) |
This function produces the same results as gsl_stats_mean()
.
If n
is zero, this function will return zero.
Definition at line 55 of file vec_stats.h.
double o2scl::vector_median_sorted | ( | const vec_t & | data | ) |
This function returns the median of sorted data (either ascending or descending), assuming the data has already been sorted. When the data set has an odd number of elements, the median is the value of the element at index , otherwise, the median is taken to be the average of the elements at indices
and
.
This function produces the same results as gsl_stats_median_from_sorted_data()
.
No checks are made to ensure the data is sorted. If n
is zero, this function will return zero without calling the error handler.
Definition at line 940 of file vec_stats.h.
double o2scl::vector_median_sorted | ( | size_t | n, |
const vec_t & | data | ||
) |
This function returns the median of sorted data (either ascending or descending), assuming the data has already been sorted. When the data set has an odd number of elements, the median is the value of the element at index , otherwise, the median is taken to be the average of the elements at indices
and
.
This function produces the same results as gsl_stats_median_from_sorted_data()
.
No checks are made to ensure the data is sorted. If n
is zero, this function will return zero without calling the error handler.
Definition at line 911 of file vec_stats.h.
data_t o2scl::vector_norm | ( | size_t | n, |
const vec_t & | x | ||
) |
This function is a more generic version of o2scl_cblas::dnrm2 .
double o2scl::vector_norm_double | ( | size_t | n, |
const vec_t & | x | ||
) |
This function is a more generic version of o2scl_cblas::dnrm2 .
void o2scl::vector_out | ( | std::ostream & | os, |
const vec_t & | v, | ||
bool | endline = false |
||
) |
No trailing space is output after the last element, and an endline is output only if endline
is set to true
. If the parameter n
is zero, this function silently does nothing.
This works with any class vec_t
which has an operator[] which returns either the value of or a reference to the ith element and the element type has its own output operator which has been defined.
void o2scl::vector_out | ( | std::ostream & | os, |
size_t | n, | ||
const vec_t & | v, | ||
bool | endline = false |
||
) |
No trailing space is output after the last element, and an endline is output only if endline
is set to true
. If the parameter n
is zero, this function silently does nothing.
This works with any class vec_t
which has an operator[] which returns either the value of or a reference to the ith element and the element type has its own output operator which has been defined.
double o2scl::vector_pvariance | ( | const vec_t & | data1, |
const vec2_t & | data2 | ||
) |
This function computes
where is the number of elements in vector
and
is the variance of vector
.
From http://en.wikipedia.org/wiki/Pooled_variance, "Under the assumption of equal population variances, the pooled sample variance provides a higher precision estimate of variance than the individual sample variances."
This function produces the same results as gsl_stats_pvariance()
.
Definition at line 834 of file vec_stats.h.
double o2scl::vector_pvariance | ( | size_t | n1, |
const vec_t & | data1, | ||
size_t | n2, | ||
const vec2_t & | data2 | ||
) |
This function computes
where is the number of elements in vector
and
is the variance of vector
.
From http://en.wikipedia.org/wiki/Pooled_variance, "Under the assumption of equal population variances, the pooled sample variance provides a higher precision estimate of variance than the individual sample variances."
This function produces the same results as gsl_stats_pvariance()
.
Definition at line 809 of file vec_stats.h.
double o2scl::vector_quantile_sorted | ( | const vec_t & | data, |
const double | f | ||
) |
This function returns the quantile f
of data which has already been sorted in ascending order. The quantile, , is found by interpolation using
where and
.
This function produces the same results as gsl_stats_quantile_from_sorted_data()
.
No checks are made to ensure the data is sorted, or to ensure that . If
n
is zero, this function will return zero without calling the error handler.
Definition at line 890 of file vec_stats.h.
double o2scl::vector_quantile_sorted | ( | size_t | n, |
const vec_t & | data, | ||
const double | f | ||
) |
This function returns the quantile f
of data which has already been sorted in ascending order. The quantile, , is found by interpolation using
where and
.
This function produces the same results as gsl_stats_quantile_from_sorted_data()
.
No checks are made to ensure the data is sorted, or to ensure that . If
n
is zero, this function will return zero without calling the error handler.
Definition at line 859 of file vec_stats.h.
boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<dat_t> > o2scl::vector_range | ( | boost::numeric::ublas::vector< dat_t > & | v, |
size_t | start, | ||
size_t | last | ||
) |
boost::numeric::ublas::vector_range<boost::numeric::ublas::vector_range <boost::numeric::ublas::vector<dat_t> > > o2scl::vector_range | ( | boost::numeric::ublas::vector_range< boost::numeric::ublas::vector< dat_t > > & | v, |
size_t | start, | ||
size_t | last | ||
) |
dat_t* o2scl::vector_range | ( | dat_t * | v, |
size_t | start, | ||
size_t | last | ||
) |
std::vector<dat_t> o2scl::vector_range_copy | ( | const std::vector< dat_t > & | v, |
size_t | start, | ||
size_t | last | ||
) |
The element with index start
in the original vector will become the first argument in the new vector, and the new vector will have size last-start
.
const std::vector<dat_t> o2scl::vector_range_copy | ( | const std::vector< dat_t > & | v, |
size_t | start, | ||
size_t | last | ||
) |
The element with index start
in the original vector will become the first argument in the new vector, and the new vector will have size last-start
.
void o2scl::vector_refine | ( | size_t | n, |
const vec_t & | index, | ||
vec2_t & | data, | ||
size_t | factor, | ||
size_t | interp_type = itp_linear |
||
) |
void o2scl::vector_reverse | ( | size_t | n, |
vec_t & | data | ||
) |
void o2scl::vector_reverse | ( | vec_t & | data | ) |
void o2scl::vector_reverse_double | ( | size_t | n, |
vec_t & | data | ||
) |
void o2scl::vector_reverse_double | ( | vec_t & | data | ) |
void o2scl::vector_rotate | ( | size_t | n, |
vec_t & | data, | ||
size_t | k | ||
) |
This is a generic template function which will work for any types data_t
and vec_t
for which
data_t
has an operator=
vec_t::operator[]
returns a reference to an object of type data_t
This function is used, for example, in o2scl::pinside.
drot()
. double o2scl::vector_skew | ( | const vec_t & | data | ) |
This function computes
where the values of and
are computed using vector_mean() and vector_stddev().
This function produces the same results as gsl_stats_skew()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 500 of file vec_stats.h.
double o2scl::vector_skew | ( | const vec_t & | data, |
double | mean, | ||
double | stddev | ||
) |
This function computes
where the values of and
are given in
mean
and stddev
.
This function produces the same results as gsl_stats_skew_m_sd()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 457 of file vec_stats.h.
double o2scl::vector_skew | ( | size_t | n, |
const vec_t & | data | ||
) |
This function computes
where the values of and
are computed using vector_mean() and vector_stddev().
This function produces the same results as gsl_stats_skew()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 478 of file vec_stats.h.
double o2scl::vector_skew | ( | size_t | n, |
const vec_t & | data, | ||
double | mean, | ||
double | stddev | ||
) |
This function computes
where the values of and
are given in
mean
and stddev
.
This function produces the same results as gsl_stats_skew_m_sd()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 431 of file vec_stats.h.
void o2scl::vector_smallest | ( | size_t | n, |
vec_t & | data, | ||
size_t | k, | ||
vec_t & | smallest | ||
) |
Given a vector data
of size n
, this function sets the first k
entries of the vector smallest
to the k smallest entries from vector data
in ascending order. The vector smallest
must be allocated beforehand to hold at least k
elements.
This works similarly to the GSL function gsl_sort_smallest()
.
If k
is zero, then this function does nothing and returns o2scl::success .
void o2scl::vector_smallest | ( | vec_t & | data, |
size_t | k, | ||
vec_t & | smallest | ||
) |
Given a vector data
, this function sets the first k
entries of the vector smallest
to the k smallest entries from vector data
in ascending order. The vector smallest
is resized if necessary to hold at least k
elements.
This works similarly to the GSL function gsl_sort_smallest()
.
If k
is zero, then this function does nothing and returns o2scl::success .
void o2scl::vector_smallest_index | ( | size_t | n, |
const vec_t & | data, | ||
size_t | k, | ||
vec_size_t & | index | ||
) |
Given a vector data
, this function sets the first k
entries of the vector smallest
equal to the indexes of the k smallest entries from vector data
in ascending order. The vector smallest
is resized if necessary to hold at least k
elements.
If k
is zero or n
is zero or , then this function calls the error handler.
void o2scl::vector_sort | ( | size_t | n, |
vec_t & | data | ||
) |
This is a generic sorting template function using a heapsort algorithm. It will work for any types data_t
and vec_t
for which
data_t
has a non-const version of operator=
data_t
has a less than operator to compare elementsvec_t::operator[]
returns a non-const reference to an object of type data_t
In particular, it will work with the STL template class std::vector
, and arrays and pointers of numeric, character, and string objects.
For example,
data_t
, and function templates cannot handle default template types. For this reason, the function template o2scl::vector_sort_double() was also created which provides the convenience of not requiring the user to specify the vector template type.n
is zero, this function will do nothing and will not call the error handler.This works similarly to the GSL function gsl_sort_vector()
.
void o2scl::vector_sort_double | ( | size_t | n, |
vec_t & | data | ||
) |
This function is just a wrapper for
See the documentation of o2scl::vector_sort() for more details.
void o2scl::vector_sort_index | ( | const vec_t & | data, |
vec_size_t & | order | ||
) |
This function takes a vector data
and arranges a list of indices in order
, which give a sorted version of the vector. The value order[i]
gives the index of entry in in data
which corresponds to the i
th value in the sorted vector. The vector data
is unchanged by this function, and the initial values in order
are ignored. Before calling this function, order
must already be allocated as a vector of size n
.
For example, after calling this function, a sorted version the vector can be output with
To create a permutation which stores as its i
th element, the index of data[i]
in the sorted vector, you can invert the permutation created by this function.
This is a generic sorting template function. It will work for any types vec_t
and vec_size_t
for which
vec_t
has an operator[]
, andvec_size_t
has an operator[]
which returns a size_t
. One possible type for vec_size_t
is o2scl::permutation.This works similarly to the GSL function gsl_sort_index()
.
void o2scl::vector_sort_index | ( | size_t | n, |
const vec_t & | data, | ||
vec_size_t & | order | ||
) |
This function takes a vector data
and arranges a list of indices in order
, which give a sorted version of the vector. The value order[i]
gives the index of entry in in data
which corresponds to the i
th value in the sorted vector. The vector data
is unchanged by this function, and the initial values in order
are ignored. Before calling this function, order
must already be allocated as a vector of size n
.
For example, after calling this function, a sorted version the vector can be output with
To create a permutation which stores as its i
th element, the index of data[i]
in the sorted vector, you can invert the permutation created by this function.
This is a generic sorting template function. It will work for any types vec_t
and vec_size_t
for which
vec_t
has an operator[]
, andvec_size_t
has an operator[]
which returns a size_t
. One possible type for vec_size_t
is o2scl::permutation.This works similarly to the GSL function gsl_sort_index()
.
double o2scl::vector_sorted_quantile | ( | size_t | n, |
const vec_t & | v, | ||
double | f | ||
) |
This is a generic version of gsl_stats_quantile_from_sorted_data()
.
If f
is less than 0 or greater than 1, the error handler is called. If n
is zero, this function returns zero without calling the error handler.
Definition at line 1020 of file vec_stats.h.
double o2scl::vector_stddev | ( | const vec_t & | data | ) |
This function computes
where is the mean computed with vector_mean().
This function produces the same results as gsl_stats_sd()
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 278 of file vec_stats.h.
double o2scl::vector_stddev | ( | const vec_t & | data, |
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_sd_m()
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 322 of file vec_stats.h.
double o2scl::vector_stddev | ( | size_t | n, |
const vec_t & | data | ||
) |
This function computes
where is the mean computed with vector_mean().
This function produces the same results as gsl_stats_sd()
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 253 of file vec_stats.h.
double o2scl::vector_stddev | ( | size_t | n, |
const vec_t & | data, | ||
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_sd_m()
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 296 of file vec_stats.h.
double o2scl::vector_stddev_fmean | ( | const vec_t & | data, |
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_sd_with_fixed_mean()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 236 of file vec_stats.h.
double o2scl::vector_stddev_fmean | ( | size_t | n, |
const vec_t & | data, | ||
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_sd_with_fixed_mean()
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 215 of file vec_stats.h.
data_t o2scl::vector_sum | ( | size_t | n, |
vec_t & | data | ||
) |
data_t o2scl::vector_sum | ( | vec_t & | data | ) |
double o2scl::vector_sum_double | ( | size_t | n, |
vec_t & | data | ||
) |
double o2scl::vector_sum_double | ( | vec_t & | data | ) |
void o2scl::vector_swap | ( | size_t | N, |
vec_t & | v1, | ||
vec2_t & | v2 | ||
) |
void o2scl::vector_swap | ( | vec_t & | v, |
size_t | i, | ||
size_t | j | ||
) |
void o2scl::vector_swap | ( | vec_t & | v1, |
vec2_t & | v2 | ||
) |
This function swaps the elements of v1
and v2
, one element at a time.
std::swap
than this function, which is provided only in cases where one knows one is going to be forced to use a vector type without a properly defined std::swap
method. void o2scl::vector_swap_double | ( | size_t | N, |
vec_t & | v1, | ||
vec2_t & | v2 | ||
) |
void o2scl::vector_swap_double | ( | vec_t & | v, |
size_t | i, | ||
size_t | j | ||
) |
This function swaps the element i
and element j
of vector v1
.
This function is used in o2scl_linalg::QRPT_decomp() .
void o2scl::vector_swap_double | ( | vec_t & | v1, |
vec2_t & | v2 | ||
) |
This function swaps the elements of v1
and v2
, one element at a time.
std::swap
than this function, which is provided only in cases where one knows one is going to be forced to use a vector type without a properly defined std::swap
method. double o2scl::vector_variance | ( | const vec_t & | data | ) |
This function computes
where is the mean computed with vector_mean().
This function produces the same results as gsl_stats_variance
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 196 of file vec_stats.h.
double o2scl::vector_variance | ( | const vec_t & | data, |
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_variance_m
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 154 of file vec_stats.h.
double o2scl::vector_variance | ( | size_t | n, |
const vec_t & | data | ||
) |
This function computes
where is the mean computed with vector_mean().
This function produces the same results as gsl_stats_variance
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 171 of file vec_stats.h.
double o2scl::vector_variance | ( | size_t | n, |
const vec_t & | data, | ||
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_variance_m
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 128 of file vec_stats.h.
double o2scl::vector_variance_fmean | ( | const vec_t & | data, |
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_variance_with_fixed_mean()
. If the vector size is zero, this function will return zero.
Definition at line 109 of file vec_stats.h.
double o2scl::vector_variance_fmean | ( | size_t | n, |
const vec_t & | data, | ||
double | mean | ||
) |
This function computes
where the value of is given in
mean
.
This function produces the same results as gsl_stats_variance_with_fixed_mean()
. IF n
is zero, this function returns zero.
Definition at line 87 of file vec_stats.h.
double o2scl::wvector_absdev | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wabsdev()
.
Definition at line 1494 of file vec_stats.h.
double o2scl::wvector_absdev | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wabsdev_m()
.
Definition at line 1470 of file vec_stats.h.
double o2scl::wvector_absdev | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wabsdev()
.
Definition at line 1481 of file vec_stats.h.
double o2scl::wvector_absdev | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wabsdev_m()
.
Definition at line 1449 of file vec_stats.h.
double o2scl::wvector_covariance | ( | const vec_t & | data1, |
const vec2_t & | data2, | ||
const vec3_t & | weights | ||
) |
Definition at line 1379 of file vec_stats.h.
double o2scl::wvector_covariance | ( | size_t | n, |
const vec_t & | data1, | ||
const vec2_t & | data2, | ||
const vec3_t & | weights | ||
) |
Definition at line 1354 of file vec_stats.h.
double o2scl::wvector_factor | ( | const vec_t & | weights | ) |
This function is used internally in wvector_variance(size_t n, vec_t &data, const vec2_t &weights, double wmean) and wvector_stddev(size_t n, vec_t &data, const vec2_t &weights, double wmean) .
Definition at line 1162 of file vec_stats.h.
double o2scl::wvector_factor | ( | size_t | n, |
const vec_t & | weights | ||
) |
This function is used internally in wvector_variance(size_t n, vec_t &data, const vec2_t &weights, double wmean) and wvector_stddev(size_t n, vec_t &data, const vec2_t &weights, double wmean) .
Definition at line 1139 of file vec_stats.h.
double o2scl::wvector_kurtosis | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wkurtosis()
.
Definition at line 1612 of file vec_stats.h.
double o2scl::wvector_kurtosis | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean, | ||
double | wsd | ||
) |
This function produces the same results as gsl_stats_wkurtosis_m_sd()
.
Definition at line 1585 of file vec_stats.h.
double o2scl::wvector_kurtosis | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wkurtosis()
.
Definition at line 1598 of file vec_stats.h.
double o2scl::wvector_kurtosis | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean, | ||
double | wsd | ||
) |
This function produces the same results as gsl_stats_wkurtosis_m_sd()
.
Definition at line 1563 of file vec_stats.h.
double o2scl::wvector_mean | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function computes
This function produces the same results as gsl_stats_wmean()
.
Definition at line 1128 of file vec_stats.h.
double o2scl::wvector_mean | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function computes
This function produces the same results as gsl_stats_wmean()
.
Definition at line 1097 of file vec_stats.h.
double o2scl::wvector_skew | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wskew()
.
Definition at line 1552 of file vec_stats.h.
double o2scl::wvector_skew | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean, | ||
double | wsd | ||
) |
This function produces the same results as gsl_stats_wskew_m_sd()
.
Definition at line 1527 of file vec_stats.h.
double o2scl::wvector_skew | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wskew()
.
Definition at line 1539 of file vec_stats.h.
double o2scl::wvector_skew | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean, | ||
double | wsd | ||
) |
This function produces the same results as gsl_stats_wskew_m_sd()
.
Definition at line 1505 of file vec_stats.h.
double o2scl::wvector_stddev | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wsd()
.
Definition at line 1314 of file vec_stats.h.
double o2scl::wvector_stddev | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wsd_m()
.
Definition at line 1341 of file vec_stats.h.
double o2scl::wvector_stddev | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wsd()
.
Definition at line 1301 of file vec_stats.h.
double o2scl::wvector_stddev | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wsd_m()
.
Definition at line 1325 of file vec_stats.h.
double o2scl::wvector_stddev_fmean | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wsd_with_fixed_mean()
.
Definition at line 1288 of file vec_stats.h.
double o2scl::wvector_stddev_fmean | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wsd_with_fixed_mean()
.
Definition at line 1276 of file vec_stats.h.
double o2scl::wvector_sumsq | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wtss()
.
Definition at line 1439 of file vec_stats.h.
double o2scl::wvector_sumsq | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wtss_m()
.
Definition at line 1413 of file vec_stats.h.
double o2scl::wvector_sumsq | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wtss()
.
Definition at line 1425 of file vec_stats.h.
double o2scl::wvector_sumsq | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wtss_m()
.
Definition at line 1392 of file vec_stats.h.
double o2scl::wvector_variance | ( | const vec_t & | data, |
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wvariance()
.
Definition at line 1265 of file vec_stats.h.
double o2scl::wvector_variance | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wvariance_m()
.
Definition at line 1239 of file vec_stats.h.
double o2scl::wvector_variance | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights | ||
) |
This function produces the same results as gsl_stats_wvariance()
.
Definition at line 1251 of file vec_stats.h.
double o2scl::wvector_variance | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function produces the same results as gsl_stats_wvariance_m()
.
Definition at line 1222 of file vec_stats.h.
double o2scl::wvector_variance_fmean | ( | const vec_t & | data, |
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function computes
This function produces the same results as gsl_stats_wvariance_with_fixed_mean()
.
Definition at line 1210 of file vec_stats.h.
double o2scl::wvector_variance_fmean | ( | size_t | n, |
const vec_t & | data, | ||
const vec2_t & | weights, | ||
double | wmean | ||
) |
This function computes
This function produces the same results as gsl_stats_wvariance_with_fixed_mean()
.
Definition at line 1180 of file vec_stats.h.
lib_settings_class o2scl::o2scl_settings |
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).