Classes | Typedefs | Enumerations | Variables
o2scl Namespace Reference

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 $ (-\infty,b] $. More...
 
class  inte_iu
 Integrate over $ [a,\infty) $. More...
 
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 $ (-\infty,\infty) $ (GSL) More...
 
class  inte_qagil_gsl
 Integrate a function over the interval $ (-\infty, b] $ (GSL) More...
 
class  inte_qagiu_gsl
 Integrate a function over the interval $ [a, \infty) $ (GSL) More...
 
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) $ Li_n(x)$. More...
 
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.
 

Enumerations

enum  {
  success =0, gsl_failure =-1, gsl_continue =-2, exc_edom =1,
  exc_erange =2, exc_efault =3, exc_einval =4, exc_efailed =5,
  exc_efactor =6, exc_esanity =7, exc_enomem =8, exc_ebadfunc =9,
  exc_erunaway =10, exc_emaxiter =11, exc_ezerodiv =12, exc_ebadtol =13,
  exc_etol =14, exc_eundrflw =15, exc_eovrflw =16, exc_eloss =17,
  exc_eround =18, exc_ebadlen =19, exc_enotsqr =20, exc_esing =21,
  exc_ediverge =22, exc_eunsup =23, exc_eunimpl =24, exc_ecache =25,
  exc_etable =26, exc_enoprog =27, exc_enoprogj =28, exc_etolf =29,
  exc_etolx =30, exc_etolg =31, exc_eof =32, exc_enotfound =33,
  exc_ememtype =34, exc_efilenotfound =35, exc_eindex =36, exc_outsidecons =37
}
 The integer error definitions in src/base/err_hnd.h. More...
 
enum  {
  itp_linear =1, itp_cspline =2, itp_cspline_peri =3, itp_akima =4,
  itp_akima_peri =5, itp_monotonic =6, itp_steffen =7, itp_nearest_neigh =8
}
 Interpolation types in src/base/interp.h. More...
 
enum  tokType { NONE, OP, VAR, NUM }
 Token list for o2scl::calculator.
 

Variables

err_hnd_typeerr_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...
 

Detailed Description

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 Documentation

◆ funct_cdf50

typedef std::function<boost::multiprecision::cpp_dec_float_50 (boost::multiprecision::cpp_dec_float_50)> o2scl::funct_cdf50

This typedef is only present if O2SCL_LD_TYPES is defined during compilation.

Definition at line 62 of file funct.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The errors associated with the integers between -2 and 32 are based on GSL, the rest are specific to O2scl .

Enumerator
success 

Success.

gsl_failure 

Failure.

gsl_continue 

iteration has not converged

exc_edom 

input domain error, e.g sqrt(-1)

exc_erange 

output range error, e.g. exp(1e100)

exc_efault 

invalid pointer

exc_einval 

invalid argument supplied by user

exc_efailed 

generic failure

exc_efactor 

factorization failed

exc_esanity 

sanity check failed - shouldn't happen

exc_enomem 

malloc failed

exc_ebadfunc 

problem with user-supplied function

exc_erunaway 

iterative process is out of control

exc_emaxiter 

exceeded max number of iterations

exc_ezerodiv 

tried to divide by zero

exc_ebadtol 

user specified an invalid tolerance

exc_etol 

failed to reach the specified tolerance

exc_eundrflw 

underflow

exc_eovrflw 

overflow

exc_eloss 

loss of accuracy

exc_eround 

failed because of roundoff error

exc_ebadlen 

matrix, vector lengths are not conformant

exc_enotsqr 

matrix not square

exc_esing 

apparent singularity detected

exc_ediverge 

integral or series is divergent

exc_eunsup 

requested feature is not supported by the hardware

exc_eunimpl 

requested feature not (yet) implemented

exc_ecache 

cache limit exceeded

exc_etable 

table limit exceeded

exc_enoprog 

iteration is not making progress toward solution

exc_enoprogj 

jacobian evaluations are not improving the solution

exc_etolf 

cannot reach the specified tolerance in f

exc_etolx 

cannot reach the specified tolerance in x

exc_etolg 

cannot reach the specified tolerance in gradient

exc_eof 

end of file

exc_enotfound 

Generic "not found" result.

exc_ememtype 

Incorrect type for memory object.

exc_efilenotfound 

File not found.

exc_eindex 

Invalid index for array or matrix.

exc_outsidecons 

Outside constraint region.

Definition at line 45 of file err_hnd.h.

◆ anonymous enum

anonymous enum
Enumerator
itp_linear 

Linear.

itp_cspline 

Cubic spline for natural boundary conditions.

itp_cspline_peri 

Cubic spline for periodic boundary conditions.

itp_akima 

Akima spline for natural boundary conditions.

itp_akima_peri 

Akima spline for periodic boundary conditions.

itp_monotonic 

Monotonicity-preserving interpolation (unfinished)

itp_steffen 

Steffen's monotonic method.

itp_nearest_neigh 

Nearest-neighbor lookup.

Definition at line 69 of file interp.h.

Function Documentation

◆ array_2d_out()

template<class mat_t >
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().

Idea for Future:
If all of the matrix elements are positive integers and scientific mode is not set, then we can avoid printing the extra spaces.

Definition at line 419 of file columnify.h.

◆ array_2d_trans_out()

template<class mat_t >
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.

Idea for Future:
If all of the matrix elements are positive integers and scientific mode is not set, then we can avoid printing the extra spaces.

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.

◆ binary_to_hex()

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.

◆ bose_function()

double o2scl::bose_function ( double  E,
double  mu,
double  T,
double  limit = 40.0 
)

$ \left[\exp\left(E/T-\mu/T\right)-1\right]^{-1} $

This function computes a Bose-Einstein distribution function using an expansion to ensure accurate results when $ (E-\mu)/T $ is near zero.

Note
This function may return Inf or NAN if limit is too large, depending on the machine precision.

This function is used in the o2scl::boson_rel class in O2scl_part .

◆ btos()

std::string o2scl::btos ( bool  b)

This returns "1" for true and "0" for false.

◆ const_vector_range() [1/6]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3264 of file vector.h.

◆ const_vector_range() [2/6]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3329 of file vector.h.

◆ const_vector_range() [3/6]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3283 of file vector.h.

◆ const_vector_range() [4/6]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3353 of file vector.h.

◆ const_vector_range() [5/6]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3377 of file vector.h.

◆ const_vector_range() [6/6]

template<class dat_t >
const dat_t* o2scl::const_vector_range ( const dat_t *  v,
size_t  start,
size_t  last 
)
Note
In this case, the return type is the same as the type of the first parameter.

Definition at line 3231 of file vector.h.

◆ constraint()

double o2scl::constraint ( double  x,
double  center,
double  width,
double  height 
)
inline

Defining $ c= $ center, $ w= $ width, $ h= $ height, this returns the value $ h (1+|x-c-w|/w) $ if $ x>c+w $ and $ h (1+|x-c+w|/w) $ if $ x<c-w $ . The value near $ x=c-w $ or $ x=c+w $ is $ h $ (the value of the function exactly at these points is zero) and the value at $ x=c-2w $ or $ x=c+2w $ is $ 2 h $ .

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.

Definition at line 360 of file min.h.

◆ cont_constraint()

double o2scl::cont_constraint ( double  x,
double  center,
double  width,
double  height,
double  tightness = 40.0,
double  exp_arg_limit = 50.0 
)
inline

Defining $ c= $ center, $ w= $ width, $ h= $ height, $ t= $ tightness, and $ \ell= $ exp_arg_limit, this returns the value

\[ h \left(\frac{x-c}{w}\right)^2 \left[ 1+ e^{t\left(x-c+w\right)\left(c+w-x\right)/w^2} \right]^{-1} \]

This function is continuous and differentiable. Note that if $ x=c $ , then the function returns zero.

The exponential is handled gracefully by assuming that anything smaller than $ \exp(-\ell) $ is zero. This creates a small discontinuity which can be removed with the sufficiently large value of $ \ell $.

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 $ t \rightarrow \infty $, this function converges towards the squared value of constraint(), except exactly at the points $ x=c-w $ and $ x=c+w $.

Definition at line 401 of file min.h.

◆ cont_lower_bound()

double o2scl::cont_lower_bound ( double  x,
double  center,
double  width,
double  height,
double  tightness = 40.0,
double  exp_arg_limit = 50.0 
)
inline

Defining $ c= $ center, $ w= $ width, $ h= $ height, $ t= $ tightness, and $ \ell= $ exp_arg_limit, this returns $ h(c-x+w)/(w+w\exp(t(x-c)/w)) $ and has the advantage of being a continuous and differentiable function. The value of the function exactly at $ x=c $ is $ h/2 $, but for $ x $ just below $ c $ the function is $ h $ and just above $ c $ the function is quite small.

The exponential is handled gracefully by assuming that anything smaller than $ \exp(-\ell) $ is zero. This creates a small discontinuity which can be removed with the sufficiently large value of $ \ell $.

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 $ t \rightarrow \infty $, this function converges towards lower_bound(), except exactly at the point $ x=c $.

Definition at line 462 of file min.h.

◆ count_words()

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.

Idea for Future:
Make consistent with split_string().

◆ dtos()

template<class fp_t >
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.

◆ error_update()

void o2scl::error_update ( int &  ret,
int  err 
)
inline

If ret is zero, this sets ret to the value err, and if ret is nonzero this function does nothing.

Definition at line 326 of file err_hnd.h.

◆ fermi_function()

double o2scl::fermi_function ( double  E,
double  mu,
double  T,
double  limit = 40.0 
)

$ \left[1+\exp\left(E/T-\mu/T\right)\right]^{-1} $

This calculates a Fermi-Dirac distribution function guaranteeing that numbers larger than $ \exp(\mathrm{limit}) $ and smaller than $ \exp(-\mathrm{limit}) $ will be avoided. The default value of limit=40 ensures accuracy to within 1 part in $ 10^{17} $ 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.

◆ function_to_double()

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.

◆ function_to_double_nothrow()

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.

◆ glob_wrapper()

int o2scl::glob_wrapper ( std::string  pattern,
std::vector< std::string > &  matches 
)
Warning
This function may not work on all operating systems.
Idea for Future:
Fix for openSUSE (see https://github.com/awsteiner/o2scl/issues/8 )

◆ has_minus_sign()

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".

◆ HSVtoRGB()

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 $ h \in [0,360] $, $ s \in [0,1] $, and $ v \in [0,1] $. The output values r, g, and b are $ \in [0,1] $.

If s == 0, then h = -1 (undefined)

◆ is_number()

bool o2scl::is_number ( std::string  s)
Note
The test employed is not exhaustive and this function may return true for some numbers and may return false for some non-numbers.

◆ linear_or_log() [1/2]

template<class vec_t , class vec2_t >
void o2scl::linear_or_log ( vec_t &  x,
vec2_t &  y,
bool &  log_x,
bool &  log_y 
)
Note
Experimental.

This function attempts to guess whether the data stored in x and y might be best plotted on a log scale. This algorithm will fail for poorly sampled or highly oscillatory data.

Definition at line 2666 of file interp.h.

◆ linear_or_log() [2/2]

template<class vec_t >
void o2scl::linear_or_log ( vec_t &  y,
bool &  log_y 
)
Note
Experimental.
Idea for Future:
There is a bit of extra calculation because the rebin function creates a second new x vector with a uniform grid, so this could be streamlined.

Definition at line 2766 of file interp.h.

◆ linear_or_log_chi2()

template<class vec_t , class vec2_t >
double o2scl::linear_or_log_chi2 ( const vec_t &  x,
const vec2_t &  y 
)

Principally used by linear_or_log() .

Definition at line 2630 of file interp.h.

◆ lower_bound()

double o2scl::lower_bound ( double  x,
double  center,
double  width,
double  height 
)
inline

Defining $ c= $ center, $ w= $ width, $ h= $ height, this returns $ h(1+|x-c|/w) $ if $ x<c $ and zero otherwise. The value at $ x=c $ is $ h $ , while the value at $ x=c-w $ is $ 2 h $ .

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.

Definition at line 428 of file min.h.

◆ matrix_column()

template<class mat_t , class mat_column_t >
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.

Note
When calling this function with ublas objects, the namespace prefix "o2scl::" must often be specified, otherwise some compilers will use argument dependent lookup and get (justifiably) confused with matrix_column in the ublas namespace.
The template parameters must be explicitly specified when calling this template function.

Definition at line 3051 of file vector.h.

◆ matrix_copy() [1/2]

template<class mat_t , class mat2_t >
void o2scl::matrix_copy ( mat_t &  src,
mat2_t &  dest 
)

Copy src to dest, resizing dest if it is too small.

This function will work for any classes mat_t and mat2_t which have suitably defined operator(), size(), and resize() methods.

Definition at line 176 of file vector.h.

◆ matrix_copy() [2/2]

template<class mat_t , class mat2_t >
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.

Definition at line 201 of file vector.h.

◆ matrix_lookup() [1/2]

template<class mat_t >
void o2scl::matrix_lookup ( const mat_t &  A,
double  x0,
size_t &  i,
size_t &  j 
)

Return the location (i,j) of the element closest to x0.

Definition at line 1866 of file vector.h.

◆ matrix_lookup() [2/2]

template<class mat_t >
void o2scl::matrix_lookup ( size_t  m,
size_t  n,
const mat_t &  A,
double  x0,
size_t &  i,
size_t &  j 
)

Return the location (i,j) of the element closest to x0.

Definition at line 1827 of file vector.h.

◆ matrix_out() [1/2]

template<class mat_t >
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.

◆ matrix_out() [2/2]

template<class mat_t >
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.

◆ matrix_row()

template<class mat_t , class mat_row_t >
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.

Note
When calling this function with ublas objects, the namespace prefix "o2scl::" must often be specified, otherwise some compilers will use argument dependent lookup and get (justifiably) confused with matrix_row in the ublas namespace.
The template parameters must be explicitly specified when calling this template function.

Definition at line 2593 of file vector.h.

◆ matrix_swap() [1/2]

template<class mat_t , class data_t >
void o2scl::matrix_swap ( mat_t &  m,
size_t  i1,
size_t  j1,
size_t  i2,
size_t  j2 
)

This function swaps the element (i1,j1) and element (i2,j2) of matrix m1.

Definition at line 571 of file vector.h.

◆ matrix_swap() [2/2]

template<class mat_t , class mat2_t , class data_t >
void o2scl::matrix_swap ( size_t  M,
size_t  N,
mat_t &  v1,
mat2_t &  v2 
)

This function swaps the elements of v1 and v2, one element at a time.

Definition at line 542 of file vector.h.

◆ matrix_swap_cols()

template<class mat_t , class data_t >
void o2scl::matrix_swap_cols ( size_t  M,
mat_t &  m,
size_t  j1,
size_t  j2 
)

This function swaps the element (i1,j1) and element (i2,j2) of matrix m1.

Definition at line 595 of file vector.h.

◆ matrix_swap_cols_double()

template<class mat_t >
void o2scl::matrix_swap_cols_double ( size_t  M,
mat_t &  m,
size_t  j1,
size_t  j2 
)

This function swaps the element i and element j of matrix v1.

Definition at line 612 of file vector.h.

◆ matrix_swap_double() [1/2]

template<class mat_t >
void o2scl::matrix_swap_double ( mat_t &  m,
size_t  i1,
size_t  j1,
size_t  i2,
size_t  j2 
)

This function swaps the element i and element j of matrix v1.

Definition at line 584 of file vector.h.

◆ matrix_swap_double() [2/2]

template<class mat_t , class mat2_t , class data_t >
void o2scl::matrix_swap_double ( size_t  M,
size_t  N,
mat_t &  m1,
mat2_t &  m2 
)

This function swaps the elements of m1 and m2, one element at a time.

Definition at line 561 of file vector.h.

◆ matrix_swap_rows()

template<class mat_t , class data_t >
void o2scl::matrix_swap_rows ( size_t  N,
mat_t &  m,
size_t  i1,
size_t  i2 
)

This function swaps the element (i1,j1) and element (i2,j2) of matrix m1.

Definition at line 623 of file vector.h.

◆ matrix_swap_rows_double()

template<class mat_t >
void o2scl::matrix_swap_rows_double ( size_t  N,
mat_t &  m,
size_t  i1,
size_t  i2 
)

This function swaps the element i and element j of matrix v1.

Definition at line 640 of file vector.h.

◆ matrix_trans_out() [1/2]

template<class mat_t >
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.

◆ matrix_trans_out() [2/2]

template<class mat_t >
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.

◆ matrix_transpose() [1/4]

template<class mat_t , class data_t >
void o2scl::matrix_transpose ( mat_t &  src)

Transpose the matrix src . If the matrix is not square, only the upper-left square part of the matrix will be transposed.

This function will work for any classes mat_t and mat2_t which have suitably defined operator(), size(), and resize() methods.

Definition at line 262 of file vector.h.

◆ matrix_transpose() [2/4]

template<class mat_t , class mat2_t >
void o2scl::matrix_transpose ( mat_t &  src,
mat2_t &  dest 
)

Copy the transpose of src to dest, resizing dest if it is too small.

This function will work for any classes mat_t and mat2_t which have suitably defined operator(), size(), and resize() methods.

Definition at line 222 of file vector.h.

◆ matrix_transpose() [3/4]

template<class mat_t , class data_t >
void o2scl::matrix_transpose ( size_t  m,
size_t  n,
mat_t &  src 
)

Copy the transpose of the first m rows and the first cols of the matrix src into the matrix dest

This function will work for any classes mat_t and mat2_t which has a suitably defined operator() method.

Definition at line 287 of file vector.h.

◆ matrix_transpose() [4/4]

template<class mat_t , class mat2_t >
void o2scl::matrix_transpose ( size_t  m,
size_t  n,
mat_t &  src,
mat2_t &  dest 
)

Copy the transpose of the first m rows and the first cols of the matrix src into the matrix dest

This function will work for any classes mat_t and mat2_t which has a suitably defined operator() method.

Definition at line 243 of file vector.h.

◆ o2isfinite()

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.

◆ operator<<()

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.

◆ pipe_cmd_string() [1/2]

std::string o2scl::pipe_cmd_string ( std::string  cmd,
int  nmax = 80 
)

This function always throws exceptions if it fails.

Note
The result string may contain a carriage return at the end.

◆ pipe_cmd_string() [2/2]

int o2scl::pipe_cmd_string ( std::string  cmd,
std::string &  result,
bool  err_on_fail = true,
int  nmax = 80 
)
Note
This function uses popen() and may not work properly on some systems. If HAVE_POPEN was not defined during O2scl's compilation, then this function will throw an exception (or if err_on_fail is false, it will return a nonzero value).
The result string may contain a carriage return at the end.

◆ ptos()

std::string o2scl::ptos ( void *  p)

This uses an ostringstream to convert a pointer to a string and is architecture-dependent.

◆ quadratic_extremum_coeffs()

template<class data_t >
void o2scl::quadratic_extremum_coeffs ( const data_t  x1,
const data_t  x2,
const data_t  x3,
const data_t  y1,
const data_t  y2,
const data_t  y3,
data_t &  a,
data_t &  b,
data_t &  c 
)

This function should work for any floating-point data type, but will suffer from problems due to lack of precision in some cases.

Definition at line 556 of file misc.h.

◆ quadratic_extremum_x()

template<class data_t >
data_t o2scl::quadratic_extremum_x ( const data_t  x1,
const data_t  x2,
const data_t  x3,
const data_t  y1,
const data_t  y2,
const data_t  y3 
)

This function should work for any floating-point data type, but will suffer from problems due to lack of precision in some cases.

Definition at line 401 of file misc.h.

◆ quadratic_extremum_xy()

template<class data_t >
void o2scl::quadratic_extremum_xy ( const data_t  x1,
const data_t  x2,
const data_t  x3,
const data_t  y1,
const data_t  y2,
const data_t  y3,
data_t &  x,
data_t &  y 
)

This function should work for any floating-point data type, but will suffer from problems due to lack of precision in some cases.

Definition at line 522 of file misc.h.

◆ quadratic_extremum_y()

template<class data_t >
data_t o2scl::quadratic_extremum_y ( const data_t  x1,
const data_t  x2,
const data_t  x3,
const data_t  y1,
const data_t  y2,
const data_t  y3 
)

This function should work for any floating-point data type, but will suffer from problems due to lack of precision in some cases.

Definition at line 492 of file misc.h.

◆ quadratic_extremum_y_full()

template<class data_t >
void o2scl::quadratic_extremum_y_full ( const data_t  x1,
const data_t  x2,
const data_t  x3,
const data_t  y1,
const data_t  y2,
const data_t  y3,
const data_t &  xmin,
const data_t &  ymin,
const data_t &  a,
const data_t &  b,
const data_t &  c,
const data_t &  den 
)

This function provides the three coefficients of the quadratic, a, b, and c, and the denominator den.

This function should work for any floating-point data type, but will suffer from problems due to lack of precision in some cases.

Definition at line 458 of file misc.h.

◆ remove_whitespace()

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.

◆ rewrap_keep_endlines()

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 .

◆ RGBtoHSV()

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 $ h \in [0,360] $, $ s \in [0,1] $, and $ v \in [0,1] $. The output values r, g, and b are $ \in [0,1] $.

If s == 0, then h = -1 (undefined)

◆ screenify()

template<class string_arr_t >
void o2scl::screenify ( size_t  nin,
const string_arr_t &  in_cols,
std::vector< std::string > &  out_cols,
size_t  max_size = 80 
)

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.

Definition at line 200 of file misc.h.

◆ size_of_exponent()

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.

◆ split_string()

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

this is a test

get parsed as "this", "is", "a", "test" and strings like

"this is" a test

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().

Note
The parsing algorithm here is simple-minded and can produce unexpected results in several ways. For example, it may not properly handle nested quotes, like """test" test2" test3".
Idea for Future:

Replace with a better algorithm

Add user-specified delimiters?

◆ stob()

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.

◆ stod()

double o2scl::stod ( std::string  s)

This function is now just a wrapper for std::stod.

Warning
Because of the presence of std::stod() in C++11, you may have to explicitly provide the namespace, i.e. o2scl::stod() in your code.

◆ stoi()

int o2scl::stoi ( std::string  s)

This function is now just a wrapper for std::stoi.

◆ stoszt()

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.

◆ stoszt_nothrow()

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.

◆ vector_absdev() [1/4]

template<class vec_t >
double o2scl::vector_absdev ( const vec_t &  data)

This function computes

\[ \sum_i | x_i - \mu | \]

where the value of $ \mu $ 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.

◆ vector_absdev() [2/4]

template<class vec_t >
double o2scl::vector_absdev ( const vec_t &  data,
double  mean 
)

This function computes

\[ \sum_i | x_i - \mu | \]

where the value of $ \mu $ 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.

◆ vector_absdev() [3/4]

template<class vec_t >
double o2scl::vector_absdev ( size_t  n,
const vec_t &  data 
)

This function computes

\[ \sum_i | x_i - \mu | \]

where the value of $ \mu $ 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.

◆ vector_absdev() [4/4]

template<class vec_t >
double o2scl::vector_absdev ( size_t  n,
const vec_t &  data,
double  mean 
)

This function computes

\[ \sum_i | x_i - \mu | \]

where the value of $ \mu $ 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.

◆ vector_autocorr_tau()

template<class vec_t , class resize_vec_t >
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 $ \hat{C}(k) $, Goodman defines

\[ \hat{\tau}(M) = 1 + 2 \sum_{s=1}^{M} \frac{\hat{C}(k)}{\hat{C}(0)} \]

Then the autocorrelation length is the value of $ \hat{\tau}(M) $ for which

\[ 5 \hat{\tau}(M)/M \leq 1 \]

This function computes the value of $ 5 \hat{\tau}(M)/M $ and stores it in the five_tau_over_M vector and then returns the first value of $ M $ for which the vector is less than or equal to 1.0. If this function returns 0, then $ 5 \hat{\tau}(M)/M $ is greater than 1.0 for all $ M $, 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.

◆ vector_autocorr_vector()

template<class vec_t , class resize_vec_t >
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 $ k_{\mathrm{max}} =n/2 $ where $ n $ is the length of the data vector. The vector ac_vec is resized to accomodate exactly $ k_{\mathrm{max}} $ values, from 0 to $ k_{\mathrm{max}}-1 $.

Definition at line 1820 of file vec_stats.h.

◆ vector_bin_size_freedman()

template<class vec_t >
double o2scl::vector_bin_size_freedman ( vec_t &  v)

This function computes the optimal bin size $ \Delta_b $ of a histogram using the expression

\[ \Delta_b = \frac{2\left(q_{0.75}-q_{0.25}\right)}{n^{1/3}} \]

where $ q_{i} $ is the $ i $ quantile of the data (note this is quantile not quartile). This function sorts the vector in order to obtain the result.

From Freedman81 .

Note
If 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.

◆ vector_bin_size_scott()

template<class vec_t >
double o2scl::vector_bin_size_scott ( const vec_t &  v)

This function computes the optimal bin size $ \Delta_b $ of a histogram using the expression

\[ \Delta_b = \frac{3.5 \sigma}{n^{1/3}} \]

From Scott79 .

Note
If 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.

◆ vector_bound_fracint()

template<class vec_t , class vec2_t >
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 
)

This function finds the boundaries of the region which has integral equal to frac times the full integral from the lower x limit to the upper x limit.

Definition at line 2494 of file interp.h.

◆ vector_bound_int()

template<class vec_t , class vec2_t >
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 
)

This function finds the boundaries of the region which has integral equal to frac times the full integral from the lower x limit to the upper x limit.

Definition at line 2521 of file interp.h.

◆ vector_bsearch() [1/2]

template<class vec_t , class data_t >
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.

Definition at line 1993 of file vector.h.

◆ vector_bsearch() [2/2]

template<class vec_t , class data_t >
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.

Definition at line 1977 of file vector.h.

◆ vector_bsearch_dec()

template<class vec_t , class data_t >
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.

Definition at line 1951 of file vector.h.

◆ vector_bsearch_inc()

template<class vec_t , class data_t >
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.

Definition at line 1906 of file vector.h.

◆ vector_chi_squared() [1/2]

template<class vec_t , class vec2_t , class vec3_t >
double o2scl::vector_chi_squared ( const vec_t &  obs,
const vec2_t &  exp,
const vec3_t &  err 
)

This function computes

\[ \sum_i \left( \frac{\mathrm{obs}_i - \mathrm{exp}_i} {\mathrm{err}_i}\right)^2 \]

where $ \mathrm{obs} $ are the observed values, $ \mathrm{exp} $ are the expected values, and $ \mathrm{err} $ are the errors.

Definition at line 977 of file vec_stats.h.

◆ vector_chi_squared() [2/2]

template<class vec_t , class vec2_t , class vec3_t >
double o2scl::vector_chi_squared ( size_t  n,
const vec_t &  obs,
const vec2_t &  exp,
const vec3_t &  err 
)

This function computes

\[ \sum_i \left( \frac{\mathrm{obs}_i - \mathrm{exp}_i} {\mathrm{err}_i}\right)^2 \]

where $ \mathrm{obs} $ are the observed values, $ \mathrm{exp} $ are the expected values, and $ \mathrm{err} $ are the errors.

Definition at line 956 of file vec_stats.h.

◆ vector_copy() [1/2]

template<class vec_t , class vec2_t >
void o2scl::vector_copy ( const vec_t &  src,
vec2_t &  dest 
)

Copy src to dest, resizing dest if it is too small to hold src.size() elements.

This function will work for any classes vec_t and vec2_t which have suitably defined operator[], size(), and resize() methods.

Definition at line 124 of file vector.h.

◆ vector_copy() [2/2]

template<class vec_t , class vec2_t >
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.

Definition at line 153 of file vector.h.

◆ vector_copy_jackknife() [1/2]

template<class vec_t , class vec2_t >
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() .

Definition at line 2379 of file vector.h.

◆ vector_copy_jackknife() [2/2]

template<class vec_t , class vec2_t >
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() .

Definition at line 2403 of file vector.h.

◆ vector_correlation() [1/2]

template<class vec_t , class vec2_t >
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.

◆ vector_correlation() [2/2]

template<class vec_t , class vec2_t >
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.

◆ vector_covariance() [1/4]

template<class vec_t , class vec2_t >
double o2scl::vector_covariance ( const vec_t &  data1,
const vec2_t &  data2 
)

This function computes

\[ \frac{1}{n-1} \sum_i \left(x_i - {\bar{x}}\right) \left(y_i - {\bar{y}}\right) \]

where $ {\bar{x}} $ and $ {\bar{y}} $ 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.

◆ vector_covariance() [2/4]

template<class vec_t , class vec2_t >
double o2scl::vector_covariance ( const vec_t &  data1,
const vec2_t &  data2,
double  mean1,
double  mean2 
)

This function computes

\[ \frac{1}{n-1} \sum_i \left(x_i - {\bar{x}}\right) \left(y_i - {\bar{y}}\right) \]

where $ {\bar{x}} $ and $ {\bar{y}} $ 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.

◆ vector_covariance() [3/4]

template<class vec_t , class vec2_t >
double o2scl::vector_covariance ( size_t  n,
const vec_t &  data1,
const vec2_t &  data2 
)

This function computes

\[ \frac{1}{n-1} \sum_i \left(x_i - {\bar{x}}\right) \left(y_i - {\bar{y}}\right) \]

where $ {\bar{x}} $ and $ {\bar{y}} $ 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.

◆ vector_covariance() [4/4]

template<class vec_t , class vec2_t >
double o2scl::vector_covariance ( size_t  n,
const vec_t &  data1,
const vec2_t &  data2,
double  mean1,
double  mean2 
)

This function computes

\[ \frac{1}{n-1} \sum_i \left(x_i - {\bar{x}}\right) \left(y_i - {\bar{y}}\right) \]

where $ {\bar{x}} $ and $ {\bar{y}} $ 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.

◆ vector_find_level()

template<class vec_t , class vec2_t >
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 $ \mathrm{level} = y(x) $. 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.

Definition at line 2225 of file interp.h.

◆ vector_integ_durand()

template<class vec_t , class fp_t = double>
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.

◆ vector_integ_extended4()

template<class vec_t , class fp_t = double>
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.

◆ vector_integ_extended8()

template<class vec_t , class fp_t = double>
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.

◆ vector_integ_threept()

template<class vec_t , class fp_t = double>
fp_t o2scl::vector_integ_threept ( size_t  n,
vec_t &  v 
)
Note
This function uses an untested hack I wrote for even n.

Definition at line 193 of file vector_derint.h.

◆ vector_integ_xy_interp()

template<class vec_t , class vec2_t >
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 $ y(x) $ then this computes

\[ \int_{x_0}^{x^{n-1}} y(x)~dx \]

using interpolation to approximate the result.

See also vector_deriv_interp() and vector_deriv2_interp() in vector_derint.h .

Definition at line 2141 of file interp.h.

◆ vector_invert_enclosed_sum()

template<class vec_t , class vec2_t >
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, $ g(y_0) $ which takes as input any y-value, $ y_0 $ from the function $ y(x) $ (specified with the parameters x and y) and outputs the integral of the function $ y(x) $ over all regions where $ y(x) > y_0 $. This function inverts $ g(y) $, 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 $ 1~\sigma $ 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 $ g $, 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 $ g $.

Definition at line 2295 of file interp.h.

◆ vector_is_finite() [1/2]

template<class vec_t >
bool o2scl::vector_is_finite ( size_t  n,
vec_t &  data 
)

If n is zero, this will return true without throwing an exception.

The corresponding tests for matrix functions are in clbas_base.h .

Definition at line 2152 of file vector.h.

◆ vector_is_finite() [2/2]

template<class vec_t >
bool o2scl::vector_is_finite ( vec_t &  data)

If n is zero, this will return true without throwing an exception.

The corresponding tests for matrix functions are in clbas_base.h .

Definition at line 2167 of file vector.h.

◆ vector_is_monotonic() [1/2]

template<class vec_t >
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.

Definition at line 2019 of file vector.h.

◆ vector_is_monotonic() [2/2]

template<class vec_t >
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.

Definition at line 2087 of file vector.h.

◆ vector_is_strictly_monotonic() [1/2]

template<class vec_t >
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.

Definition at line 2101 of file vector.h.

◆ vector_is_strictly_monotonic() [2/2]

template<class vec_t >
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.

Definition at line 2139 of file vector.h.

◆ vector_kurtosis() [1/4]

template<class vec_t >
double o2scl::vector_kurtosis ( const vec_t &  data)

This function computes

\[ -3 + \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^4 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_kurtosis() [2/4]

template<class vec_t >
double o2scl::vector_kurtosis ( const vec_t &  data,
double  mean,
double  stddev 
)

This function computes

\[ -3 + \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^4 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_kurtosis() [3/4]

template<class vec_t >
double o2scl::vector_kurtosis ( size_t  n,
const vec_t &  data 
)

This function computes

\[ -3 + \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^4 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_kurtosis() [4/4]

template<class vec_t >
double o2scl::vector_kurtosis ( size_t  n,
const vec_t &  data,
double  mean,
double  stddev 
)

This function computes

\[ -3 + \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^4 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_lag1_autocorr() [1/4]

template<class vec_t >
double o2scl::vector_lag1_autocorr ( const vec_t &  data)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-1} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

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.

◆ vector_lag1_autocorr() [2/4]

template<class vec_t >
double o2scl::vector_lag1_autocorr ( const vec_t &  data,
double  mean 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-1} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

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.

◆ vector_lag1_autocorr() [3/4]

template<class vec_t >
double o2scl::vector_lag1_autocorr ( size_t  n,
const vec_t &  data 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-1} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

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.

◆ vector_lag1_autocorr() [4/4]

template<class vec_t >
double o2scl::vector_lag1_autocorr ( size_t  n,
const vec_t &  data,
double  mean 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-1} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

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.

◆ vector_lagk_autocorr() [1/4]

template<class vec_t >
double o2scl::vector_lagk_autocorr ( const vec_t &  data,
size_t  k 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-k} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

If n<=k, this function will call the error handler.

Definition at line 1806 of file vec_stats.h.

◆ vector_lagk_autocorr() [2/4]

template<class vec_t >
double o2scl::vector_lagk_autocorr ( const vec_t &  data,
size_t  k,
double  mean 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-k} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

If n<=k, this function will call the error handler.

Definition at line 1768 of file vec_stats.h.

◆ vector_lagk_autocorr() [3/4]

template<class vec_t >
double o2scl::vector_lagk_autocorr ( size_t  n,
const vec_t &  data,
size_t  k 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-k} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

If n<=k, this function will call the error handler.

Definition at line 1787 of file vec_stats.h.

◆ vector_lagk_autocorr() [4/4]

template<class vec_t >
double o2scl::vector_lagk_autocorr ( size_t  n,
const vec_t &  data,
size_t  k,
double  mean 
)

This function computes

\[ \left[ \sum_i \left(x_i - \mu\right) \left(x_{i-k} - \mu \right) \right] \left[ \sum_i \left(x_i - \mu\right)^2 \right]^{-1} \]

If n<=k, this function will call the error handler.

Definition at line 1733 of file vec_stats.h.

◆ vector_largest() [1/2]

template<class vec_t , class data_t >
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().

Note
This $ {\cal O}(k N) $ algorithm is useful only when $ k << N $.

If k is zero, then this function does nothing and returns o2scl::success .

Definition at line 1058 of file vector.h.

◆ vector_largest() [2/2]

template<class vec_t , class data_t >
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().

Note
This $ {\cal O}(k N) $ algorithm is useful only when $ k << N $.

If k is zero, then this function does nothing and returns o2scl::success .

Definition at line 1109 of file vector.h.

◆ vector_level_count()

template<class vec_t , class vec2_t >
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 $ y(x) = \mathrm{level} $ 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 $ y(x) $ 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.

Definition at line 2042 of file interp.h.

◆ vector_lookup() [1/2]

template<class vec_t >
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).

Definition at line 1817 of file vector.h.

◆ vector_lookup() [2/2]

template<class vec_t >
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).

Definition at line 1780 of file vector.h.

◆ vector_mean() [1/2]

template<class vec_t >
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.

◆ vector_mean() [2/2]

template<class vec_t >
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.

◆ vector_median_sorted() [1/2]

template<class vec_t >
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 $ (n-1)/2 $, otherwise, the median is taken to be the average of the elements at indices $ (n-1)/2 $ and $ n/2 $ .

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.

◆ vector_median_sorted() [2/2]

template<class vec_t >
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 $ (n-1)/2 $, otherwise, the median is taken to be the average of the elements at indices $ (n-1)/2 $ and $ n/2 $ .

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.

◆ vector_norm()

template<class vec_t , class data_t >
data_t o2scl::vector_norm ( size_t  n,
const vec_t &  x 
)

This function is a more generic version of o2scl_cblas::dnrm2 .

Definition at line 2252 of file vector.h.

◆ vector_norm_double()

template<class vec_t >
double o2scl::vector_norm_double ( size_t  n,
const vec_t &  x 
)

This function is a more generic version of o2scl_cblas::dnrm2 .

Definition at line 2296 of file vector.h.

◆ vector_out() [1/2]

template<class vec_t >
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.

Definition at line 3172 of file vector.h.

◆ vector_out() [2/2]

template<class vec_t >
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.

Definition at line 3145 of file vector.h.

◆ vector_pvariance() [1/2]

template<class vec_t , class vec2_t >
double o2scl::vector_pvariance ( const vec_t &  data1,
const vec2_t &  data2 
)

This function computes

\[ s_{p}^2 = \frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2} \]

where $ n_i $ is the number of elements in vector $ i $ and $ s_i^2 $ is the variance of vector $ i $.

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.

◆ vector_pvariance() [2/2]

template<class vec_t , class vec2_t >
double o2scl::vector_pvariance ( size_t  n1,
const vec_t &  data1,
size_t  n2,
const vec2_t &  data2 
)

This function computes

\[ s_{p}^2 = \frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2} \]

where $ n_i $ is the number of elements in vector $ i $ and $ s_i^2 $ is the variance of vector $ i $.

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.

◆ vector_quantile_sorted() [1/2]

template<class vec_t >
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, $ q $ , is found by interpolation using

\[ q = \left(1-\delta\right) x_i \delta x_{i+1} \]

where $ i = \mathrm{floor}[ (n-1)f ] $ and $ \delta = (n-1)f -i $ .

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 $ 0 \leq 0 \leq 1 $. If n is zero, this function will return zero without calling the error handler.

Definition at line 890 of file vec_stats.h.

◆ vector_quantile_sorted() [2/2]

template<class vec_t >
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, $ q $ , is found by interpolation using

\[ q = \left(1-\delta\right) x_i \delta x_{i+1} \]

where $ i = \mathrm{floor}[ (n-1)f ] $ and $ \delta = (n-1)f -i $ .

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 $ 0 \leq 0 \leq 1 $. If n is zero, this function will return zero without calling the error handler.

Definition at line 859 of file vec_stats.h.

◆ vector_range() [1/3]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3246 of file vector.h.

◆ vector_range() [2/3]

template<class dat_t >
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 
)

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 .

Note
In this case, the return type is not the same as the type of the first parameter.

Definition at line 3305 of file vector.h.

◆ vector_range() [3/3]

template<class dat_t >
dat_t* o2scl::vector_range ( dat_t *  v,
size_t  start,
size_t  last 
)
Note
In this case, the return type is the same as the type of the first parameter.

Definition at line 3221 of file vector.h.

◆ vector_range_copy() [1/2]

template<class dat_t >
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 .

Note
In this case, the return type is the same as the type of the first parameter.
Unlike the ublas and pointer cases, this forces a copy.

Definition at line 3621 of file vector.h.

◆ vector_range_copy() [2/2]

template<class dat_t >
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 .

Note
In this case, the return type is the same as the type of the first parameter.
Unlike the ublas and pointer cases, this forces a copy.

Definition at line 3637 of file vector.h.

◆ vector_refine()

template<class vec_t , class vec2_t , class data_t >
void o2scl::vector_refine ( size_t  n,
const vec_t &  index,
vec2_t &  data,
size_t  factor,
size_t  interp_type = itp_linear 
)
Warning
Untested.

Definition at line 2740 of file interp.h.

◆ vector_reverse() [1/2]

template<class vec_t , class data_t >
void o2scl::vector_reverse ( size_t  n,
vec_t &  data 
)

If n is zero, this function will silently do nothing.

Definition at line 2456 of file vector.h.

◆ vector_reverse() [2/2]

template<class vec_t , class data_t >
void o2scl::vector_reverse ( vec_t &  data)

If the size() method returns zero, this function will silently do nothing.

Definition at line 2473 of file vector.h.

◆ vector_reverse_double() [1/2]

template<class vec_t >
void o2scl::vector_reverse_double ( size_t  n,
vec_t &  data 
)

If n is zero, this function will silently do nothing.

Definition at line 2491 of file vector.h.

◆ vector_reverse_double() [2/2]

template<class vec_t >
void o2scl::vector_reverse_double ( vec_t &  data)

If the size() method returns zero, this function will silently do nothing.

Definition at line 2507 of file vector.h.

◆ vector_rotate()

template<class vec_t , class data_t >
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.

Note
This function is not the same as a Givens rotation, which is typically referred to in BLAS routines as drot().

Definition at line 2437 of file vector.h.

◆ vector_skew() [1/4]

template<class vec_t >
double o2scl::vector_skew ( const vec_t &  data)

This function computes

\[ \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^3 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_skew() [2/4]

template<class vec_t >
double o2scl::vector_skew ( const vec_t &  data,
double  mean,
double  stddev 
)

This function computes

\[ \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^3 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_skew() [3/4]

template<class vec_t >
double o2scl::vector_skew ( size_t  n,
const vec_t &  data 
)

This function computes

\[ \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^3 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_skew() [4/4]

template<class vec_t >
double o2scl::vector_skew ( size_t  n,
const vec_t &  data,
double  mean,
double  stddev 
)

This function computes

\[ \frac{1}{N} \sum_i \left[ \frac{ \left(x_i - \mu \right)}{ \sigma }\right]^3 \]

where the values of $ \mu $ and $ \sigma $ 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.

◆ vector_smallest() [1/2]

template<class vec_t , class data_t >
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().

Note
This $ {\cal O}(k N) $ algorithm is useful only when $ k << N $.

If k is zero, then this function does nothing and returns o2scl::success .

Definition at line 920 of file vector.h.

◆ vector_smallest() [2/2]

template<class vec_t , class data_t >
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().

Note
This $ {\cal O}(k N) $ algorithm is useful only when $ k << N $.

If k is zero, then this function does nothing and returns o2scl::success .

Definition at line 971 of file vector.h.

◆ vector_smallest_index()

template<class vec_t , class data_t , class vec_size_t >
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.

Note
This $ {\cal O}(k N) $ algorithm is useful only when $ k << N $.

If k is zero or n is zero or $ k > n$, then this function calls the error handler.

Definition at line 993 of file vector.h.

◆ vector_sort()

template<class vec_t , class data_t >
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 elements
  • vec_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,

std::string list[3]={"dog","cat","fox"};
vector_sort<std::string[3],std::string>(3,list);
Note
With this function template alone, the user cannot avoid explicitly specifying the template types for this function because there is no parameter of type 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.
This sorting routine is not stable, i.e. equal elements have arbtrary final ordering
If 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().

Definition at line 705 of file vector.h.

◆ vector_sort_double()

template<class vec_t >
void o2scl::vector_sort_double ( size_t  n,
vec_t &  data 
)

This function is just a wrapper for

vector_sort<vec_t,double>(n,data);

See the documentation of o2scl::vector_sort() for more details.

Definition at line 895 of file vector.h.

◆ vector_sort_index() [1/2]

template<class vec_t , class vec_size_t >
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 ith 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

size_t n=5;
double data[5]={3.1,4.1,5.9,2.6,3.5};
permutation order(n);
vector_sort_index(n,data,order);
for(size_t i=0;i<n;i++) {
cout << data[order[i]] << endl;
}

To create a permutation which stores as its ith 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[], and
  • vec_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().

Definition at line 880 of file vector.h.

◆ vector_sort_index() [2/2]

template<class vec_t , class vec_size_t >
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 ith 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

size_t n=5;
double data[5]={3.1,4.1,5.9,2.6,3.5};
permutation order(n);
vector_sort_index(n,data,order);
for(size_t i=0;i<n;i++) {
cout << data[order[i]] << endl;
}

To create a permutation which stores as its ith 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[], and
  • vec_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().

Definition at line 800 of file vector.h.

◆ vector_sorted_quantile()

template<class vec_t >
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.

◆ vector_stddev() [1/4]

template<class vec_t >
double o2scl::vector_stddev ( const vec_t &  data)

This function computes

\[ \sqrt{\frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2} \]

where $ \mu $ 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.

◆ vector_stddev() [2/4]

template<class vec_t >
double o2scl::vector_stddev ( const vec_t &  data,
double  mean 
)

This function computes

\[ \sqrt{\frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2} \]

where the value of $ \mu $ 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.

◆ vector_stddev() [3/4]

template<class vec_t >
double o2scl::vector_stddev ( size_t  n,
const vec_t &  data 
)

This function computes

\[ \sqrt{\frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2} \]

where $ \mu $ 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.

◆ vector_stddev() [4/4]

template<class vec_t >
double o2scl::vector_stddev ( size_t  n,
const vec_t &  data,
double  mean 
)

This function computes

\[ \sqrt{\frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2} \]

where the value of $ \mu $ 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.

◆ vector_stddev_fmean() [1/2]

template<class vec_t >
double o2scl::vector_stddev_fmean ( const vec_t &  data,
double  mean 
)

This function computes

\[ \sqrt{\frac{1}{N} \sum_{i} \left( x_i - \mu \right)^2} \]

where the value of $ \mu $ 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.

◆ vector_stddev_fmean() [2/2]

template<class vec_t >
double o2scl::vector_stddev_fmean ( size_t  n,
const vec_t &  data,
double  mean 
)

This function computes

\[ \sqrt{\frac{1}{N} \sum_{i} \left( x_i - \mu \right)^2} \]

where the value of $ \mu $ 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.

◆ vector_sum() [1/2]

template<class vec_t , class data_t >
data_t o2scl::vector_sum ( size_t  n,
vec_t &  data 
)

If n is zero, this will return 0 without throwing an exception.

Definition at line 2180 of file vector.h.

◆ vector_sum() [2/2]

template<class vec_t , class data_t >
data_t o2scl::vector_sum ( vec_t &  data)

If the vector has zero size, this will return 0 without calling the error handler.

Definition at line 2209 of file vector.h.

◆ vector_sum_double() [1/2]

template<class vec_t >
double o2scl::vector_sum_double ( size_t  n,
vec_t &  data 
)

If n is zero, this will return 0 without throwing an exception.

Definition at line 2223 of file vector.h.

◆ vector_sum_double() [2/2]

template<class vec_t >
double o2scl::vector_sum_double ( vec_t &  data)

If the vector has zero size, this will return 0 without calling the error handler.

Definition at line 2237 of file vector.h.

◆ vector_swap() [1/3]

template<class vec_t , class vec2_t , class data_t >
void o2scl::vector_swap ( size_t  N,
vec_t &  v1,
vec2_t &  v2 
)

This function swaps the elements of v1 and v2, one element at a time.

Definition at line 420 of file vector.h.

◆ vector_swap() [2/3]

template<class vec_t , class data_t >
void o2scl::vector_swap ( vec_t &  v,
size_t  i,
size_t  j 
)

This function swaps the element i and element j of vector v1.

Definition at line 516 of file vector.h.

◆ vector_swap() [3/3]

template<class vec_t , class vec2_t , class data_t >
void o2scl::vector_swap ( vec_t &  v1,
vec2_t &  v2 
)

This function swaps the elements of v1 and v2, one element at a time.

Note
It is almost always better to use 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.

Definition at line 456 of file vector.h.

◆ vector_swap_double() [1/3]

template<class vec_t , class vec2_t >
void o2scl::vector_swap_double ( size_t  N,
vec_t &  v1,
vec2_t &  v2 
)

This function swaps the elements of v1 and v2, one element at a time.

Definition at line 490 of file vector.h.

◆ vector_swap_double() [2/3]

template<class vec_t >
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() .

Definition at line 531 of file vector.h.

◆ vector_swap_double() [3/3]

template<class vec_t , class vec2_t >
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.

Note
It is almost always better to use 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.

Definition at line 506 of file vector.h.

◆ vector_variance() [1/4]

template<class vec_t >
double o2scl::vector_variance ( const vec_t &  data)

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]

where $ \mu $ 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.

◆ vector_variance() [2/4]

template<class vec_t >
double o2scl::vector_variance ( const vec_t &  data,
double  mean 
)

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]

where the value of $ \mu $ 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.

◆ vector_variance() [3/4]

template<class vec_t >
double o2scl::vector_variance ( size_t  n,
const vec_t &  data 
)

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]

where $ \mu $ 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.

◆ vector_variance() [4/4]

template<class vec_t >
double o2scl::vector_variance ( size_t  n,
const vec_t &  data,
double  mean 
)

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]

where the value of $ \mu $ 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.

◆ vector_variance_fmean() [1/2]

template<class vec_t >
double o2scl::vector_variance_fmean ( const vec_t &  data,
double  mean 
)

This function computes

\[ \frac{1}{N} \sum_{i} \left( x_i - \mu \right)^2 \]

where the value of $ \mu $ 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.

◆ vector_variance_fmean() [2/2]

template<class vec_t >
double o2scl::vector_variance_fmean ( size_t  n,
const vec_t &  data,
double  mean 
)

This function computes

\[ \frac{1}{N} \sum_{i} \left( x_i - \mu \right)^2 \]

where the value of $ \mu $ 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.

◆ wvector_absdev() [1/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_absdev() [2/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_absdev() [3/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_absdev() [4/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_covariance() [1/2]

template<class vec_t , class vec2_t , class vec3_t >
double o2scl::wvector_covariance ( const vec_t &  data1,
const vec2_t &  data2,
const vec3_t &  weights 
)
Note
Experimental

Definition at line 1379 of file vec_stats.h.

◆ wvector_covariance() [2/2]

template<class vec_t , class vec2_t , class vec3_t >
double o2scl::wvector_covariance ( size_t  n,
const vec_t &  data1,
const vec2_t &  data2,
const vec3_t &  weights 
)
Note
Experimental

Definition at line 1354 of file vec_stats.h.

◆ wvector_factor() [1/2]

template<class vec_t >
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.

◆ wvector_factor() [2/2]

template<class vec_t >
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.

◆ wvector_kurtosis() [1/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_kurtosis() [2/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_kurtosis() [3/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_kurtosis() [4/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_mean() [1/2]

template<class vec_t , class vec2_t >
double o2scl::wvector_mean ( const vec_t &  data,
const vec2_t &  weights 
)

This function computes

\[ \left( \sum_i w_i x_i \right) \left( \sum_i w_i \right)^{-1} \]

This function produces the same results as gsl_stats_wmean().

Definition at line 1128 of file vec_stats.h.

◆ wvector_mean() [2/2]

template<class vec_t , class vec2_t >
double o2scl::wvector_mean ( size_t  n,
const vec_t &  data,
const vec2_t &  weights 
)

This function computes

\[ \left( \sum_i w_i x_i \right) \left( \sum_i w_i \right)^{-1} \]

This function produces the same results as gsl_stats_wmean().

Definition at line 1097 of file vec_stats.h.

◆ wvector_skew() [1/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_skew() [2/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_skew() [3/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_skew() [4/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_stddev() [1/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_stddev() [2/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_stddev() [3/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_stddev() [4/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_stddev_fmean() [1/2]

template<class vec_t , class vec2_t >
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.

◆ wvector_stddev_fmean() [2/2]

template<class vec_t , class vec2_t >
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.

◆ wvector_sumsq() [1/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_sumsq() [2/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_sumsq() [3/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_sumsq() [4/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_variance() [1/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_variance() [2/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_variance() [3/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_variance() [4/4]

template<class vec_t , class vec2_t >
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.

◆ wvector_variance_fmean() [1/2]

template<class vec_t , class vec2_t >
double o2scl::wvector_variance_fmean ( const vec_t &  data,
const vec2_t &  weights,
double  wmean 
)

This function computes

\[ \left[ \sum_i w_i \left(x_i-\mu\right)^2 \right] \left[ \sum_i w_i \right]^{-1} \]

This function produces the same results as gsl_stats_wvariance_with_fixed_mean().

Definition at line 1210 of file vec_stats.h.

◆ wvector_variance_fmean() [2/2]

template<class vec_t , class vec2_t >
double o2scl::wvector_variance_fmean ( size_t  n,
const vec_t &  data,
const vec2_t &  weights,
double  wmean 
)

This function computes

\[ \left[ \sum_i w_i \left(x_i-\mu\right)^2 \right] \left[ \sum_i w_i \right]^{-1} \]

This function produces the same results as gsl_stats_wvariance_with_fixed_mean().

Definition at line 1180 of file vec_stats.h.

Variable Documentation

◆ o2scl_settings

lib_settings_class o2scl::o2scl_settings

This global object is used by polylog and some of the O2scl_eos classes to find data files. It may also be used by the end-user to probe details of the O2scl installation.

o2scl::vector_sort_index
void vector_sort_index(size_t n, const vec_t &data, vec_size_t &order)
Create a permutation which sorts the first n elements of a vector (in increasing order)
Definition: vector.h:800

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