Assorted generic vector functions. More...
#include <iostream>
#include <cmath>
#include <string>
#include <fstream>
#include <sstream>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_sys.h>
#include <gsl/gsl_matrix.h>
#include <o2scl/misc.h>
#include <o2scl/uniform_grid.h>
#include <armadillo>
#include <eigen3/Eigen/Dense>
Go to the source code of this file.
Classes | |
class | o2scl::gsl_vector_wrap |
A simple convenience wrapper for GSL vector objects. More... | |
class | o2scl::gsl_matrix_wrap |
A simple convenience wrapper for GSL matrix objects. More... | |
class | o2scl::vector_index_vector< data_t > |
Trivial index vector. More... | |
class | o2scl::vector_index_vector_size< data_t > |
Index vector with a size method. More... | |
class | o2scl::matrix_row_gen< mat_t > |
Generic object which represents a row of a matrix. More... | |
class | o2scl::matrix_row_gen_ctor< mat_t > |
Matrix row object with a constructor and resize method. More... | |
class | o2scl::matrix_view_transpose< mat_t > |
Construct a view of the transpose of a matrix. More... | |
class | o2scl::matrix_view_omit_row< mat_t > |
Construct a view of a matrix omtting a specified row. More... | |
class | o2scl::matrix_view_omit_column< mat_t > |
Construct a view of a matrix omitting one specified column. More... | |
class | o2scl::const_matrix_row_gen< mat_t > |
Generic object which represents a row of a const matrix. More... | |
class | o2scl::const_matrix_view |
A simple matrix view object. More... | |
class | o2scl::matrix_view |
A simple matrix view object. More... | |
class | o2scl::matrix_view_vec_vec< vec1_t, vec2_t > |
View a o2scl::table object as a matrix. More... | |
class | o2scl::matrix_column_gen< mat_t > |
Generic object which represents a column of a matrix. More... | |
class | o2scl::const_matrix_column_gen< mat_t > |
Generic object which represents a column of a const matrix. More... | |
class | o2scl::const_vector_range_gen< vec_t > |
Experimental const vector range object. More... | |
class | o2scl::vector_range_gen< vec_t > |
Experimental vector range object. More... | |
class | o2scl::const_vector_range_gen< vec_t > |
Experimental const vector range object. More... | |
class | boost::numeric::ublas::vector< T, A > |
The default vector type from uBlas. More... | |
class | boost::numeric::ublas::matrix< T, F, A > |
The default matrix type from uBlas. More... | |
Namespaces | |
o2scl | |
The main O2scl namespace. | |
boost | |
Placeholder documentation of some related Boost objects. | |
boost::numeric | |
Documentation of Boost::numeric objects. | |
boost::numeric::ublas | |
Documentation of uBlas objects. | |
Functions | |
Copying vectors and matrices in src/base/vector.h | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_copy (const vec_t &src, vec2_t &dest) |
Simple vector copy. More... | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_copy (size_t N, const vec_t &src, vec2_t &dest) |
Simple vector copy of the first N elements. More... | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_copy (mat_t &src, mat2_t &dest) |
Simple matrix copy. More... | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_copy (size_t M, size_t N, mat_t &src, mat2_t &dest) |
Simple matrix copy of the first ![]() | |
Tranpositions in src/base/vector.h | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_transpose (mat_t &src, mat2_t &dest) |
Simple transpose. More... | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_transpose (size_t m, size_t n, mat_t &src, mat2_t &dest) |
Simple transpose of the first ![]() | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_transpose (mat_t &src) |
Simple in-place transpose. More... | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_transpose (size_t m, size_t n, mat_t &src) |
Simple in-place transpose of the first ![]() | |
Upper and lower triangular functions in src/base/vector.h | |
template<class mat_t > | |
bool | o2scl::matrix_is_lower (mat_t &src) |
Simple test that a matrix is lower triangular. | |
template<class mat_t > | |
bool | o2scl::matrix_is_upper (mat_t &src) |
Simple test that a matrix is upper triangular. | |
template<class mat_t > | |
void | o2scl::matrix_make_lower (mat_t &src) |
Make a matrix lower triangular by setting the upper triangular entries to zero. | |
template<class mat_t > | |
void | o2scl::matrix_make_upper (mat_t &src) |
Make a matrix upper triangular by setting the lower triangular entries to zero. | |
template<class mat_t > | |
bool | o2scl::matrix_is_lower (size_t m, size_t n, mat_t &src) |
Simple test that a matrix is lower triangular for the first m rows and n columns. | |
template<class mat_t > | |
bool | o2scl::matrix_is_upper (size_t m, size_t n, mat_t &src) |
Simple test that a matrix is upper triangular for the first m rows and n columns. | |
template<class mat_t > | |
void | o2scl::matrix_make_lower (size_t m, size_t n, mat_t &src) |
Make the first m rows and n columns of a matrix lower triangular by setting the upper triangular entries to zero. | |
template<class mat_t > | |
void | o2scl::matrix_make_upper (size_t m, size_t n, mat_t &src) |
Make the first m rows and n columns of a matrix upper triangular by setting the lower triangular entries to zero. | |
Swapping parts of vectors and matrices in src/base/vector.h | |
template<class vec_t , class vec2_t , class data_t > | |
void | o2scl::vector_swap (size_t N, vec_t &v1, vec2_t &v2) |
Swap the first N elements of two vectors. More... | |
template<class vec_t , class vec2_t , class data_t > | |
void | o2scl::vector_swap (vec_t &v1, vec2_t &v2) |
Swap all elements in two vectors. More... | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_swap_double (size_t N, vec_t &v1, vec2_t &v2) |
Swap of of the first N elements of two double-precision vectors. More... | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_swap_double (vec_t &v1, vec2_t &v2) |
Swap of all the elements in two double-precision vectors. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_swap (vec_t &v, size_t i, size_t j) |
Swap two elements in a vector. More... | |
template<class vec_t > | |
void | o2scl::vector_swap_double (vec_t &v, size_t i, size_t j) |
Swap two elements in a double-precision vector. More... | |
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) |
Swap of the first ![]() | |
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) |
Swap of the first ![]() | |
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) |
Swap two elements in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_swap_double (mat_t &m, size_t i1, size_t j1, size_t i2, size_t j2) |
Swap two elements in a double-precision matrix. More... | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_swap_cols (size_t M, mat_t &m, size_t j1, size_t j2) |
Swap the first M rows of two columns in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_swap_cols_double (size_t M, mat_t &m, size_t j1, size_t j2) |
Swap the first M rows of two columns in a double-precision matrix. More... | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_swap_rows (size_t N, mat_t &m, size_t i1, size_t i2) |
Swap the first N columns of two rows in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_swap_rows_double (size_t N, mat_t &m, size_t i1, size_t i2) |
Swap the first N columns of two rows in a double-precision matrix. More... | |
Sorting vectors in src/base/vector.h | |
template<class vec_t , class data_t > | |
void | o2scl::sort_downheap (vec_t &data, size_t n, size_t k) |
Provide a downheap() function for vector_sort() | |
template<class vec_t , class data_t > | |
void | o2scl::vector_sort (size_t n, vec_t &data) |
Sort a vector (in increasing order) More... | |
template<class vec_t , class vec_size_t > | |
void | o2scl::sort_index_downheap (size_t N, const vec_t &data, vec_size_t &order, size_t k) |
Provide a downheap() function for vector_sort_index() | |
template<class vec_t , class vec_size_t > | |
void | o2scl::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) More... | |
template<class vec_t , class vec_size_t > | |
void | o2scl::vector_sort_index (const vec_t &data, vec_size_t &order) |
Create a permutation which sorts a vector (in increasing order) More... | |
template<class vec_t > | |
void | o2scl::vector_sort_double (size_t n, vec_t &data) |
Sort a vector of doubles (in increasing order) More... | |
Smallest or largest subset functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
void | o2scl::vector_smallest (size_t n, vec_t &data, size_t k, vec_t &smallest) |
Find the k smallest entries of the first n elements of a vector. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_smallest (vec_t &data, size_t k, vec_t &smallest) |
Find the k smallest entries of a vector of a vector. More... | |
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) |
Find the indexes of the k smallest entries among the first n entries of a vector. More... | |
template<class vec_t , class data_t , class vec_size_t > | |
void | o2scl::vector_smallest_index (const vec_t &data, size_t k, vec_size_t &index) |
Find the indexes of the k smallest entries of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_largest (size_t n, vec_t &data, size_t k, vec_t &largest) |
Find the k largest entries of the first n elements of a vector. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_largest (vec_t &data, size_t k, vec_t &largest) |
Find the k largest entries of a vector of a vector. More... | |
Vector minimum and maximum functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_value (size_t n, const vec_t &data) |
Compute the maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_value (const vec_t &data) |
Compute the maximum value of a vector. | |
template<class vec_t , class data_t > | |
size_t | o2scl::vector_max_index (size_t n, const vec_t &data) |
Compute the index which holds the maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_max (size_t n, const vec_t &data, size_t &index, data_t &val) |
Compute the maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_value (size_t n, const vec_t &data) |
Compute the minimum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_value (const vec_t &data) |
Compute the minimum value in a vector. | |
template<class vec_t , class data_t > | |
size_t | o2scl::vector_min_index (size_t n, const vec_t &data) |
Compute the index which holds the minimum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_min (size_t n, const vec_t &data, size_t &index, data_t &val) |
Compute the minimum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_minmax_value (size_t n, vec_t &data, data_t &min, data_t &max) |
Compute the minimum and maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_minmax_index (size_t n, vec_t &data, size_t &ix_min, size_t &ix_max) |
Compute the minimum and maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_minmax (size_t n, vec_t &data, size_t &ix_min, data_t &min, size_t &ix_max, data_t &max) |
Compute the minimum and maximum of the first n elements of a vector. | |
Extrema of vectors through quadratic fit in src/base/vector.h | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_quad (size_t n, const vec_t &data) |
Maximum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_quad (size_t n, const vec_t &x, const vec_t &y) |
Maximum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_quad_loc (size_t n, const vec_t &x, const vec_t &y) |
Location of vector maximum by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_quad (size_t n, const vec_t &data) |
Minimum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_quad (size_t n, const vec_t &x, const vec_t &y) |
Minimum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_quad_loc (size_t n, const vec_t &x, const vec_t &y) |
Location of vector minimum by quadratic fit. | |
Matrix minimum and maximum functions in src/base/vector.h | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_max_value (size_t m, const size_t n, const mat_t &data) |
Compute the maximum of the lower-left part of a matrix. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_max_value (const mat_t &data) |
Compute the maximum of a matrix. | |
template<class mat_t > | |
double | o2scl::matrix_max_value_double (const mat_t &data) |
Compute the maximum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_max_index (size_t m, size_t n, const mat_t &data, size_t &i_max, size_t &j_max, data_t &max) |
Compute the maximum of a matrix and return the indices of the maximum element. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_max_index (const mat_t &data, size_t &i_max, size_t &j_max, data_t &max) |
Compute the maximum of a matrix and return the indices of the maximum element. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_min_value (size_t m, size_t n, const mat_t &data) |
Compute the minimum of a matrix. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_min_value (const mat_t &data) |
Compute the minimum of a matrix. | |
template<class mat_t > | |
double | o2scl::matrix_min_value_double (const mat_t &data) |
Compute the minimum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_min_index (size_t n, size_t m, const mat_t &data, size_t &i_min, size_t &j_min, data_t &min) |
Compute the minimum of a matrix and return the indices of the minimum element. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_min_index (const mat_t &data, size_t &i_min, size_t &j_min, data_t &min) |
Compute the minimum of a matrix and return the indices of the minimum element. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_minmax (size_t n, size_t m, const mat_t &data, data_t &min, data_t &max) |
Compute the minimum and maximum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_minmax (const mat_t &data, data_t &min, data_t &max) |
Compute the minimum and maximum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_minmax_index (size_t n, size_t m, const mat_t &data, size_t &i_min, size_t &j_min, data_t &min, size_t &i_max, size_t &j_max, data_t &max) |
Compute the minimum and maximum of a matrix and return their locations. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_sum (size_t m, size_t n, const mat_t &data) |
Compute the sum of matrix elements. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_sum (const mat_t &data) |
Compute the sum of matrix elements. | |
Searching vectors and matrices in src/base/vector.h | |
template<class vec_t > | |
size_t | o2scl::vector_lookup (size_t n, const vec_t &x, double x0) |
Lookup the value x0 in the first n elements of vector x . More... | |
template<class vec_t > | |
size_t | o2scl::vector_lookup (const vec_t &x, double x0) |
Lookup element x0 in vector x . More... | |
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) |
Lookup an element in the first $(m,n)$ entries in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_lookup (const mat_t &A, double x0, size_t &i, size_t &j) |
Lookup an element in a matrix. More... | |
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) |
Binary search a part of an increasing vector for x0 . More... | |
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) |
Binary search a part of an decreasing vector for x0 . More... | |
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) |
Binary search a part of a monotonic vector for x0 . More... | |
template<class vec_t , class data_t > | |
size_t | o2scl::vector_bsearch (const data_t x0, const vec_t &x) |
Binary search a monotonic vector for x0 . More... | |
Ordering and finite tests in src/base/vector.h | |
template<class vec_t > | |
int | o2scl::vector_is_monotonic (size_t n, vec_t &data) |
Test if the first n elements of a vector are monotonic and increasing or decreasing. More... | |
template<class vec_t > | |
int | o2scl::vector_is_monotonic (vec_t &data) |
Test if the first n elements of a vector are monotonic and increasing or decreasing. More... | |
template<class vec_t > | |
int | o2scl::vector_is_strictly_monotonic (size_t n, vec_t &data) |
Test if the first n elements of a vector are strictly monotonic and determine if they are increasing or decreasing. More... | |
template<class vec_t > | |
int | o2scl::vector_is_strictly_monotonic (vec_t &data) |
Test if the first n elements of a vector are strictly monotonic and determine if they are increasing or decreasing. More... | |
template<class vec_t > | |
bool | o2scl::vector_is_finite (size_t n, vec_t &data) |
Test if the first n elements of a vector are finite. More... | |
template<class vec_t > | |
bool | o2scl::vector_is_finite (vec_t &data) |
Test if a vector is finite. More... | |
Miscellaneous mathematical functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_sum (size_t n, vec_t &data) |
Compute the sum of the first n elements of a vector. More... | |
template<class vec_t , class rvec_t > | |
void | o2scl::vector_diffs (const vec_t &v_data, rvec_t &v_diffs) |
Create a new vector containing the differences between adjacent entries. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_sum (vec_t &data) |
Compute the sum of all the elements of a vector. More... | |
template<class vec_t > | |
double | o2scl::vector_sum_double (size_t n, vec_t &data) |
Compute the sum of the first n elements of a vector of double-precision numbers. More... | |
template<class vec_t > | |
double | o2scl::vector_sum_double (vec_t &data) |
Compute the sum of all the elements of a vector of double-precision numbers. More... | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_norm (size_t n, const vec_t &x) |
Compute the norm of the first n entries of a vector of floating-point (single or double precision) numbers. More... | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_norm (const vec_t &x) |
Compute the norm of a vector of floating-point (single or double precision) numbers. | |
template<class vec_t > | |
double | o2scl::vector_norm_double (size_t n, const vec_t &x) |
Compute the norm of the first n entries of a vector of double precision numbers. More... | |
template<class vec_t > | |
double | o2scl::vector_norm_double (const vec_t &x) |
Compute the norm of a vector of double precision numbers. | |
Other vector and matrix functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
void | o2scl::vector_set_all (size_t N, vec_t &src, data_t val) |
Set the first N entries in a vector to a particular value. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_set_all (vec_t &src, data_t val) |
Set all entries in a vector to a particular value. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_set_all (size_t M, size_t N, mat_t &src, data_t val) |
Set the first (M,N) entries in a matrix to a particular value. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_set_all (mat_t &src, data_t val) |
Set all entries in a matrix to a particular value. | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_copy_jackknife (const vec_t &src, size_t iout, vec2_t &dest) |
From a given vector, create a new vector by removing a specified element. More... | |
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) |
From a given vector, create a new vector by removing a specified element. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_rotate (size_t n, vec_t &data, size_t k) |
"Rotate" a vector so that the kth element is now the beginning More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_reverse (size_t n, vec_t &data) |
Reverse the first n elements of a vector. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_reverse (vec_t &data) |
Reverse a vector. More... | |
template<class vec_t > | |
void | o2scl::vector_reverse_double (size_t n, vec_t &data) |
Reverse the first n elements in a vector of double precision numbers. More... | |
template<class vec_t > | |
void | o2scl::vector_reverse_double (vec_t &data) |
Reverse a vector of double precision numbers. More... | |
template<class mat_t , class mat_row_t > | |
mat_row_t | o2scl::matrix_row (mat_t &M, size_t row) |
Construct a row of a matrix. More... | |
template<class mat_t , class mat_column_t > | |
mat_column_t | o2scl::matrix_column (mat_t &M, size_t column) |
Construct a column of a matrix. More... | |
template<class vec_t > | |
void | o2scl::vector_out (std::ostream &os, size_t n, const vec_t &v, bool endline=false) |
Output the first n elements of a vector to a stream, os . More... | |
template<class vec_t > | |
void | o2scl::vector_out (std::ostream &os, const vec_t &v, bool endline=false) |
Output a vector to a stream. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_grid (uniform_grid< data_t > g, vec_t &v) |
Fill a vector with a specified grid. | |
template<class mat_t > | |
void | o2scl::matrix_set_identity (size_t M, size_t N, mat_t &m) |
Set a matrix to unity on the diagonal and zero otherwise. | |
template<class mat_t > | |
void | o2scl::matrix_set_identity (mat_t &m) |
Set a matrix to unity on the diagonal and zero otherwise. | |
Vector range classes and functions in src/base/vector.h | |
template<class dat_t > | |
dat_t * | o2scl::vector_range (dat_t *v, size_t start, size_t last) |
Vector range function for pointers. More... | |
template<class dat_t > | |
const dat_t * | o2scl::const_vector_range (const dat_t *v, size_t start, size_t last) |
Vector range function for const pointers. More... | |
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) |
Vector range function template for ublas vectors. More... | |
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) |
Const vector range function template for ublas vectors. More... | |
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) |
Const vector range function template for const ublas vectors. More... | |
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) |
Vector range function template for ublas vector ranges of ublas vectors. More... | |
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) |
Const vector range function template for ublas vector ranges of ublas vectors. More... | |
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) |
Const vector range function template for const ublas vector ranges of ublas vectors. More... | |
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) |
Const vector range function template for const ublas vector ranges of const ublas vectors. More... | |
template<class data_t > | |
vector_range_gen< std::vector< data_t > > | o2scl::vector_range (std::vector< data_t > &v, size_t start, size_t last) |
Create a o2scl::vector_range_gen object from a std::vector | |
template<class data_t > | |
const const_vector_range_gen< std::vector< data_t > > | o2scl::const_vector_range (const std::vector< data_t > &v, size_t start, size_t last) |
Create a o2scl::vector_range_gen object from a std::vector | |
template<class data_t > | |
const const_vector_range_gen< std::vector< data_t > > | o2scl::const_vector_range (std::vector< data_t > &v, size_t start, size_t last) |
Create a o2scl::vector_range_gen object from a std::vector | |
template<class vec_t > | |
vector_range_gen< vec_t > | o2scl::vector_range (vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a o2scl::vector_range_gen object from a vector range. | |
template<class vec_t > | |
const const_vector_range_gen< vec_t > | o2scl::const_vector_range (vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a const o2scl::vector_range_gen object from a vector range. | |
template<class vec_t > | |
const const_vector_range_gen< vec_t > | o2scl::const_vector_range (const vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a const o2scl::vector_range_gen object from a const vector range. | |
template<class vec_t > | |
const const_vector_range_gen< vec_t > | o2scl::const_vector_range (const const_vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a const o2scl::vector_range_gen object from a const vector range. | |
template<class dat_t > | |
std::vector< dat_t > | o2scl::vector_range_copy (const std::vector< dat_t > &v, size_t start, size_t last) |
Vector range function template for std::vector More... | |
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) |
Const vector range function template for std::vector More... | |
Armadillo specializations in src/base/vector.h | |
double | o2scl::matrix_max (const arma::mat &data) |
Armadillo version of matrix_max() | |
double | o2scl::matrix_min (const arma::mat &data) |
Armadillo version of matrix_min() | |
template<> | |
arma::subview_row< double > | o2scl::matrix_row< arma::mat, arma::subview_row< double > > (arma::mat &M, size_t row) |
Armadillo version of matrix_row() | |
template<> | |
arma::subview_col< double > | o2scl::matrix_column< arma::mat, arma::subview_col< double > > (arma::mat &M, size_t column) |
Armadillo version of matrix_column() | |
Eigen specializations in src/base/vector.h | |
double | o2scl::matrix_max (const Eigen::MatrixXd &data) |
Eigen version of matrix_max() | |
double | o2scl::matrix_min (const Eigen::MatrixXd &data) |
Eigen version of matrix_min() | |
template<> | |
Eigen::MatrixXd::RowXpr | o2scl::matrix_row< Eigen::MatrixXd, Eigen::MatrixXd::RowXpr > (Eigen::MatrixXd &M, size_t row) |
Eigen version of matrix_row() | |
template<> | |
Eigen::MatrixXd::ColXpr | o2scl::matrix_column< Eigen::MatrixXd, Eigen::MatrixXd::ColXpr > (Eigen::MatrixXd &M, size_t column) |
Eigen version of matrix_column() | |
Copying vectors and matrices in src/base/vector.h | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_copy (const vec_t &src, vec2_t &dest) |
Simple vector copy. More... | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_copy (size_t N, const vec_t &src, vec2_t &dest) |
Simple vector copy of the first N elements. More... | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_copy (mat_t &src, mat2_t &dest) |
Simple matrix copy. More... | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_copy (size_t M, size_t N, mat_t &src, mat2_t &dest) |
Simple matrix copy of the first ![]() | |
Tranpositions in src/base/vector.h | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_transpose (mat_t &src, mat2_t &dest) |
Simple transpose. More... | |
template<class mat_t , class mat2_t > | |
void | o2scl::matrix_transpose (size_t m, size_t n, mat_t &src, mat2_t &dest) |
Simple transpose of the first ![]() | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_transpose (mat_t &src) |
Simple in-place transpose. More... | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_transpose (size_t m, size_t n, mat_t &src) |
Simple in-place transpose of the first ![]() | |
Upper and lower triangular functions in src/base/vector.h | |
template<class mat_t > | |
bool | o2scl::matrix_is_lower (mat_t &src) |
Simple test that a matrix is lower triangular. | |
template<class mat_t > | |
bool | o2scl::matrix_is_upper (mat_t &src) |
Simple test that a matrix is upper triangular. | |
template<class mat_t > | |
void | o2scl::matrix_make_lower (mat_t &src) |
Make a matrix lower triangular by setting the upper triangular entries to zero. | |
template<class mat_t > | |
void | o2scl::matrix_make_upper (mat_t &src) |
Make a matrix upper triangular by setting the lower triangular entries to zero. | |
template<class mat_t > | |
bool | o2scl::matrix_is_lower (size_t m, size_t n, mat_t &src) |
Simple test that a matrix is lower triangular for the first m rows and n columns. | |
template<class mat_t > | |
bool | o2scl::matrix_is_upper (size_t m, size_t n, mat_t &src) |
Simple test that a matrix is upper triangular for the first m rows and n columns. | |
template<class mat_t > | |
void | o2scl::matrix_make_lower (size_t m, size_t n, mat_t &src) |
Make the first m rows and n columns of a matrix lower triangular by setting the upper triangular entries to zero. | |
template<class mat_t > | |
void | o2scl::matrix_make_upper (size_t m, size_t n, mat_t &src) |
Make the first m rows and n columns of a matrix upper triangular by setting the lower triangular entries to zero. | |
Swapping parts of vectors and matrices in src/base/vector.h | |
template<class vec_t , class vec2_t , class data_t > | |
void | o2scl::vector_swap (size_t N, vec_t &v1, vec2_t &v2) |
Swap the first N elements of two vectors. More... | |
template<class vec_t , class vec2_t , class data_t > | |
void | o2scl::vector_swap (vec_t &v1, vec2_t &v2) |
Swap all elements in two vectors. More... | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_swap_double (size_t N, vec_t &v1, vec2_t &v2) |
Swap of of the first N elements of two double-precision vectors. More... | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_swap_double (vec_t &v1, vec2_t &v2) |
Swap of all the elements in two double-precision vectors. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_swap (vec_t &v, size_t i, size_t j) |
Swap two elements in a vector. More... | |
template<class vec_t > | |
void | o2scl::vector_swap_double (vec_t &v, size_t i, size_t j) |
Swap two elements in a double-precision vector. More... | |
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) |
Swap of the first ![]() | |
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) |
Swap of the first ![]() | |
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) |
Swap two elements in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_swap_double (mat_t &m, size_t i1, size_t j1, size_t i2, size_t j2) |
Swap two elements in a double-precision matrix. More... | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_swap_cols (size_t M, mat_t &m, size_t j1, size_t j2) |
Swap the first M rows of two columns in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_swap_cols_double (size_t M, mat_t &m, size_t j1, size_t j2) |
Swap the first M rows of two columns in a double-precision matrix. More... | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_swap_rows (size_t N, mat_t &m, size_t i1, size_t i2) |
Swap the first N columns of two rows in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_swap_rows_double (size_t N, mat_t &m, size_t i1, size_t i2) |
Swap the first N columns of two rows in a double-precision matrix. More... | |
Sorting vectors in src/base/vector.h | |
template<class vec_t , class data_t > | |
void | o2scl::sort_downheap (vec_t &data, size_t n, size_t k) |
Provide a downheap() function for vector_sort() | |
template<class vec_t , class data_t > | |
void | o2scl::vector_sort (size_t n, vec_t &data) |
Sort a vector (in increasing order) More... | |
template<class vec_t , class vec_size_t > | |
void | o2scl::sort_index_downheap (size_t N, const vec_t &data, vec_size_t &order, size_t k) |
Provide a downheap() function for vector_sort_index() | |
template<class vec_t , class vec_size_t > | |
void | o2scl::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) More... | |
template<class vec_t , class vec_size_t > | |
void | o2scl::vector_sort_index (const vec_t &data, vec_size_t &order) |
Create a permutation which sorts a vector (in increasing order) More... | |
template<class vec_t > | |
void | o2scl::vector_sort_double (size_t n, vec_t &data) |
Sort a vector of doubles (in increasing order) More... | |
Smallest or largest subset functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
void | o2scl::vector_smallest (size_t n, vec_t &data, size_t k, vec_t &smallest) |
Find the k smallest entries of the first n elements of a vector. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_smallest (vec_t &data, size_t k, vec_t &smallest) |
Find the k smallest entries of a vector of a vector. More... | |
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) |
Find the indexes of the k smallest entries among the first n entries of a vector. More... | |
template<class vec_t , class data_t , class vec_size_t > | |
void | o2scl::vector_smallest_index (const vec_t &data, size_t k, vec_size_t &index) |
Find the indexes of the k smallest entries of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_largest (size_t n, vec_t &data, size_t k, vec_t &largest) |
Find the k largest entries of the first n elements of a vector. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_largest (vec_t &data, size_t k, vec_t &largest) |
Find the k largest entries of a vector of a vector. More... | |
Vector minimum and maximum functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_value (size_t n, const vec_t &data) |
Compute the maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_value (const vec_t &data) |
Compute the maximum value of a vector. | |
template<class vec_t , class data_t > | |
size_t | o2scl::vector_max_index (size_t n, const vec_t &data) |
Compute the index which holds the maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_max (size_t n, const vec_t &data, size_t &index, data_t &val) |
Compute the maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_value (size_t n, const vec_t &data) |
Compute the minimum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_value (const vec_t &data) |
Compute the minimum value in a vector. | |
template<class vec_t , class data_t > | |
size_t | o2scl::vector_min_index (size_t n, const vec_t &data) |
Compute the index which holds the minimum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_min (size_t n, const vec_t &data, size_t &index, data_t &val) |
Compute the minimum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_minmax_value (size_t n, vec_t &data, data_t &min, data_t &max) |
Compute the minimum and maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_minmax_index (size_t n, vec_t &data, size_t &ix_min, size_t &ix_max) |
Compute the minimum and maximum of the first n elements of a vector. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_minmax (size_t n, vec_t &data, size_t &ix_min, data_t &min, size_t &ix_max, data_t &max) |
Compute the minimum and maximum of the first n elements of a vector. | |
Extrema of vectors through quadratic fit in src/base/vector.h | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_quad (size_t n, const vec_t &data) |
Maximum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_quad (size_t n, const vec_t &x, const vec_t &y) |
Maximum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_max_quad_loc (size_t n, const vec_t &x, const vec_t &y) |
Location of vector maximum by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_quad (size_t n, const vec_t &data) |
Minimum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_quad (size_t n, const vec_t &x, const vec_t &y) |
Minimum of vector by quadratic fit. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_min_quad_loc (size_t n, const vec_t &x, const vec_t &y) |
Location of vector minimum by quadratic fit. | |
Matrix minimum and maximum functions in src/base/vector.h | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_max_value (size_t m, const size_t n, const mat_t &data) |
Compute the maximum of the lower-left part of a matrix. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_max_value (const mat_t &data) |
Compute the maximum of a matrix. | |
template<class mat_t > | |
double | o2scl::matrix_max_value_double (const mat_t &data) |
Compute the maximum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_max_index (size_t m, size_t n, const mat_t &data, size_t &i_max, size_t &j_max, data_t &max) |
Compute the maximum of a matrix and return the indices of the maximum element. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_max_index (const mat_t &data, size_t &i_max, size_t &j_max, data_t &max) |
Compute the maximum of a matrix and return the indices of the maximum element. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_min_value (size_t m, size_t n, const mat_t &data) |
Compute the minimum of a matrix. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_min_value (const mat_t &data) |
Compute the minimum of a matrix. | |
template<class mat_t > | |
double | o2scl::matrix_min_value_double (const mat_t &data) |
Compute the minimum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_min_index (size_t n, size_t m, const mat_t &data, size_t &i_min, size_t &j_min, data_t &min) |
Compute the minimum of a matrix and return the indices of the minimum element. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_min_index (const mat_t &data, size_t &i_min, size_t &j_min, data_t &min) |
Compute the minimum of a matrix and return the indices of the minimum element. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_minmax (size_t n, size_t m, const mat_t &data, data_t &min, data_t &max) |
Compute the minimum and maximum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_minmax (const mat_t &data, data_t &min, data_t &max) |
Compute the minimum and maximum of a matrix. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_minmax_index (size_t n, size_t m, const mat_t &data, size_t &i_min, size_t &j_min, data_t &min, size_t &i_max, size_t &j_max, data_t &max) |
Compute the minimum and maximum of a matrix and return their locations. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_sum (size_t m, size_t n, const mat_t &data) |
Compute the sum of matrix elements. | |
template<class mat_t , class data_t > | |
data_t | o2scl::matrix_sum (const mat_t &data) |
Compute the sum of matrix elements. | |
Searching vectors and matrices in src/base/vector.h | |
template<class vec_t > | |
size_t | o2scl::vector_lookup (size_t n, const vec_t &x, double x0) |
Lookup the value x0 in the first n elements of vector x . More... | |
template<class vec_t > | |
size_t | o2scl::vector_lookup (const vec_t &x, double x0) |
Lookup element x0 in vector x . More... | |
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) |
Lookup an element in the first $(m,n)$ entries in a matrix. More... | |
template<class mat_t > | |
void | o2scl::matrix_lookup (const mat_t &A, double x0, size_t &i, size_t &j) |
Lookup an element in a matrix. More... | |
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) |
Binary search a part of an increasing vector for x0 . More... | |
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) |
Binary search a part of an decreasing vector for x0 . More... | |
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) |
Binary search a part of a monotonic vector for x0 . More... | |
template<class vec_t , class data_t > | |
size_t | o2scl::vector_bsearch (const data_t x0, const vec_t &x) |
Binary search a monotonic vector for x0 . More... | |
Ordering and finite tests in src/base/vector.h | |
template<class vec_t > | |
int | o2scl::vector_is_monotonic (size_t n, vec_t &data) |
Test if the first n elements of a vector are monotonic and increasing or decreasing. More... | |
template<class vec_t > | |
int | o2scl::vector_is_monotonic (vec_t &data) |
Test if the first n elements of a vector are monotonic and increasing or decreasing. More... | |
template<class vec_t > | |
int | o2scl::vector_is_strictly_monotonic (size_t n, vec_t &data) |
Test if the first n elements of a vector are strictly monotonic and determine if they are increasing or decreasing. More... | |
template<class vec_t > | |
int | o2scl::vector_is_strictly_monotonic (vec_t &data) |
Test if the first n elements of a vector are strictly monotonic and determine if they are increasing or decreasing. More... | |
template<class vec_t > | |
bool | o2scl::vector_is_finite (size_t n, vec_t &data) |
Test if the first n elements of a vector are finite. More... | |
template<class vec_t > | |
bool | o2scl::vector_is_finite (vec_t &data) |
Test if a vector is finite. More... | |
Miscellaneous mathematical functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_sum (size_t n, vec_t &data) |
Compute the sum of the first n elements of a vector. More... | |
template<class vec_t , class rvec_t > | |
void | o2scl::vector_diffs (const vec_t &v_data, rvec_t &v_diffs) |
Create a new vector containing the differences between adjacent entries. | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_sum (vec_t &data) |
Compute the sum of all the elements of a vector. More... | |
template<class vec_t > | |
double | o2scl::vector_sum_double (size_t n, vec_t &data) |
Compute the sum of the first n elements of a vector of double-precision numbers. More... | |
template<class vec_t > | |
double | o2scl::vector_sum_double (vec_t &data) |
Compute the sum of all the elements of a vector of double-precision numbers. More... | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_norm (size_t n, const vec_t &x) |
Compute the norm of the first n entries of a vector of floating-point (single or double precision) numbers. More... | |
template<class vec_t , class data_t > | |
data_t | o2scl::vector_norm (const vec_t &x) |
Compute the norm of a vector of floating-point (single or double precision) numbers. | |
template<class vec_t > | |
double | o2scl::vector_norm_double (size_t n, const vec_t &x) |
Compute the norm of the first n entries of a vector of double precision numbers. More... | |
template<class vec_t > | |
double | o2scl::vector_norm_double (const vec_t &x) |
Compute the norm of a vector of double precision numbers. | |
Other vector and matrix functions in src/base/vector.h | |
template<class vec_t , class data_t > | |
void | o2scl::vector_set_all (size_t N, vec_t &src, data_t val) |
Set the first N entries in a vector to a particular value. | |
template<class vec_t , class data_t > | |
void | o2scl::vector_set_all (vec_t &src, data_t val) |
Set all entries in a vector to a particular value. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_set_all (size_t M, size_t N, mat_t &src, data_t val) |
Set the first (M,N) entries in a matrix to a particular value. | |
template<class mat_t , class data_t > | |
void | o2scl::matrix_set_all (mat_t &src, data_t val) |
Set all entries in a matrix to a particular value. | |
template<class vec_t , class vec2_t > | |
void | o2scl::vector_copy_jackknife (const vec_t &src, size_t iout, vec2_t &dest) |
From a given vector, create a new vector by removing a specified element. More... | |
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) |
From a given vector, create a new vector by removing a specified element. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_rotate (size_t n, vec_t &data, size_t k) |
"Rotate" a vector so that the kth element is now the beginning More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_reverse (size_t n, vec_t &data) |
Reverse the first n elements of a vector. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_reverse (vec_t &data) |
Reverse a vector. More... | |
template<class vec_t > | |
void | o2scl::vector_reverse_double (size_t n, vec_t &data) |
Reverse the first n elements in a vector of double precision numbers. More... | |
template<class vec_t > | |
void | o2scl::vector_reverse_double (vec_t &data) |
Reverse a vector of double precision numbers. More... | |
template<class mat_t , class mat_row_t > | |
mat_row_t | o2scl::matrix_row (mat_t &M, size_t row) |
Construct a row of a matrix. More... | |
template<class mat_t , class mat_column_t > | |
mat_column_t | o2scl::matrix_column (mat_t &M, size_t column) |
Construct a column of a matrix. More... | |
template<class vec_t > | |
void | o2scl::vector_out (std::ostream &os, size_t n, const vec_t &v, bool endline=false) |
Output the first n elements of a vector to a stream, os . More... | |
template<class vec_t > | |
void | o2scl::vector_out (std::ostream &os, const vec_t &v, bool endline=false) |
Output a vector to a stream. More... | |
template<class vec_t , class data_t > | |
void | o2scl::vector_grid (uniform_grid< data_t > g, vec_t &v) |
Fill a vector with a specified grid. | |
template<class mat_t > | |
void | o2scl::matrix_set_identity (size_t M, size_t N, mat_t &m) |
Set a matrix to unity on the diagonal and zero otherwise. | |
template<class mat_t > | |
void | o2scl::matrix_set_identity (mat_t &m) |
Set a matrix to unity on the diagonal and zero otherwise. | |
Vector range classes and functions in src/base/vector.h | |
template<class dat_t > | |
dat_t * | o2scl::vector_range (dat_t *v, size_t start, size_t last) |
Vector range function for pointers. More... | |
template<class dat_t > | |
const dat_t * | o2scl::const_vector_range (const dat_t *v, size_t start, size_t last) |
Vector range function for const pointers. More... | |
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) |
Vector range function template for ublas vectors. More... | |
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) |
Const vector range function template for ublas vectors. More... | |
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) |
Const vector range function template for const ublas vectors. More... | |
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) |
Vector range function template for ublas vector ranges of ublas vectors. More... | |
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) |
Const vector range function template for ublas vector ranges of ublas vectors. More... | |
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) |
Const vector range function template for const ublas vector ranges of ublas vectors. More... | |
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) |
Const vector range function template for const ublas vector ranges of const ublas vectors. More... | |
template<class data_t > | |
vector_range_gen< std::vector< data_t > > | o2scl::vector_range (std::vector< data_t > &v, size_t start, size_t last) |
Create a o2scl::vector_range_gen object from a std::vector | |
template<class data_t > | |
const const_vector_range_gen< std::vector< data_t > > | o2scl::const_vector_range (const std::vector< data_t > &v, size_t start, size_t last) |
Create a o2scl::vector_range_gen object from a std::vector | |
template<class data_t > | |
const const_vector_range_gen< std::vector< data_t > > | o2scl::const_vector_range (std::vector< data_t > &v, size_t start, size_t last) |
Create a o2scl::vector_range_gen object from a std::vector | |
template<class vec_t > | |
vector_range_gen< vec_t > | o2scl::vector_range (vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a o2scl::vector_range_gen object from a vector range. | |
template<class vec_t > | |
const const_vector_range_gen< vec_t > | o2scl::const_vector_range (vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a const o2scl::vector_range_gen object from a vector range. | |
template<class vec_t > | |
const const_vector_range_gen< vec_t > | o2scl::const_vector_range (const vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a const o2scl::vector_range_gen object from a const vector range. | |
template<class vec_t > | |
const const_vector_range_gen< vec_t > | o2scl::const_vector_range (const const_vector_range_gen< vec_t > &v, size_t start, size_t last) |
Recursively create a const o2scl::vector_range_gen object from a const vector range. | |
template<class dat_t > | |
std::vector< dat_t > | o2scl::vector_range_copy (const std::vector< dat_t > &v, size_t start, size_t last) |
Vector range function template for std::vector More... | |
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) |
Const vector range function template for std::vector More... | |
Armadillo specializations in src/base/vector.h | |
double | o2scl::matrix_max (const arma::mat &data) |
Armadillo version of matrix_max() | |
double | o2scl::matrix_min (const arma::mat &data) |
Armadillo version of matrix_min() | |
template<> | |
arma::subview_row< double > | o2scl::matrix_row< arma::mat, arma::subview_row< double > > (arma::mat &M, size_t row) |
Armadillo version of matrix_row() | |
template<> | |
arma::subview_col< double > | o2scl::matrix_column< arma::mat, arma::subview_col< double > > (arma::mat &M, size_t column) |
Armadillo version of matrix_column() | |
Eigen specializations in src/base/vector.h | |
double | o2scl::matrix_max (const Eigen::MatrixXd &data) |
Eigen version of matrix_max() | |
double | o2scl::matrix_min (const Eigen::MatrixXd &data) |
Eigen version of matrix_min() | |
template<> | |
Eigen::MatrixXd::RowXpr | o2scl::matrix_row< Eigen::MatrixXd, Eigen::MatrixXd::RowXpr > (Eigen::MatrixXd &M, size_t row) |
Eigen version of matrix_row() | |
template<> | |
Eigen::MatrixXd::ColXpr | o2scl::matrix_column< Eigen::MatrixXd, Eigen::MatrixXd::ColXpr > (Eigen::MatrixXd &M, size_t column) |
Eigen version of matrix_column() | |
This file contains a set of template functions which can be applied to almost any vector or matrix type which allow element access through operator[]
(for vectors) or operator(,)
for matrices. Detailed requirements on the template parameters are given in the functions below.
For a general discussion of vectors and matrices in O2scl , see the Arrays, Vectors, Matrices and Tensors of the User's Guide.
For statistics operations not included here, see vec_stats.h in the directory src/other
. Also related are the matrix output functions, o2scl::matrix_out(), which is defined in columnify.h because they utilize the class o2scl::columnify to format the output.
For functions which search for a value in an ordered (either increasing or decreasing) vector, see the class o2scl::search_vec .
Definition in file vector.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).