8#ifndef _AUROSTD_XVECTOR_H_
9#define _AUROSTD_XVECTOR_H_
13#include <initializer_list>
23#define _AUROSTD_XVECTOR_DEFAULT_SIZE_ 3
25#define BOUNDARY_CONDITIONS_NONE 0
26#define BOUNDARY_CONDITIONS_PERIODIC 1
28#define _AUROSTD_XVECTOR_TOLERANCE_IDENTITY_ AUROSTD_IDENTITY_TOL
29#define _AUROSTD_XVECTOR_TOLERANCE_ROUNDOFF_ AUROSTD_ROUNDOFF_TOL
31#define CONV_SHAPE_FULL 0
32#define CONV_SHAPE_SAME 1
33#define CONV_SHAPE_VALID 2
38 template <
class utype>
class xmatrix;
45 xvector(
const std::initializer_list<utype>);
71 void set(
const utype&);
75 void resize(
int = 3,
int nl = 1);
78 void shift(
int new_lrows);
85 typedef typename std::initializer_list<utype>::const_iterator
ili;
92 void copy(
const std::initializer_list<utype> l);
179 template <
class utype>
183 template <
class utype>
187 template <
class utype>
191 template <
class utype>
195 template <
class utype>
227 template <class utype>
318 template <class utype>
327 template <class utype>
332 void GCD(const std::vector<
int>&,
int&);
333 int LCM(const std::vector<
int>&);
335 template <class utype>
337 std::vector<utype>& out_V,
340 void GCD(const std::deque<
int>&,
int& gcd);
341 int LCM(const std::deque<
int>&);
343 template <class utype>
345 std::deque<utype>& out_V,
351 template <class utype>
412 template <class utype>
415 template <class utype>
419 template <class utype>
422 template <class utype>
426 template <class utype>
429 template <class utype>
433 template <class utype>
436 template <class utype>
440 template <class utype>
444 template <class utype>
447 template <class utype>
450 template <class utype>
453 template <class utype>
458 template <class utype>
462 template <class utype>
465 template <class utype>
468 template <class utype>
472 template <class utype>
475 template <class utype>
479 template <class utype>
482 template <class utype>
505 template <class utype>
509 template <class utype>
513 template <class utype>
517 template <class utype>
521 template <class utype1, class utype2>
525 template <class utype1, class utype2, class utype3>
529 template <class utype1, class utype2, class utype3, class utype4>
533 template <class utype>
539 template <
class utype>
548 template <
class utype>
554 template <
class utype1,
class utype2>
560 template <
class utype1,
class utype2,
class utype3>
566 template <
class utype1,
class utype2,
class utype3,
class utype4>
577 bool operator()(
const std::vector<utype>& a,
const std::vector<utype>& b);
585 template <
class utype>
bool compareVecElements(
const std::vector<utype>& a,
const std::vector<utype>& b);
609 template <
class utype>
610 std::vector<int>
getPeaks(
const xvector<utype>& signal_input,
uint smoothing_iterations = 4,
uint avg_window = 4,
int width_maximum = 1,
double significance_multiplier = 1.0);
611 template <
class utype>
#define _AUROSTD_XVECTOR_TOLERANCE_IDENTITY_
#define _AUROSTD_XVECTOR_TOLERANCE_ROUNDOFF_
bool operator()(const xvector< utype > &a, const xvector< utype > &b)
bool operator()(const std::vector< utype > &a, const std::vector< utype > &b)
compareVecElement(uint ind=0, bool ascending=true)
xvector< utype > & operator-=(const xvector< utype > &)
xvector< utype > & operator*=(utype r)
void shift(int new_lrows)
shift the lower row bound of an xmatrix to a new value
xvector< utype > & operator+=(const xvector< utype > &)
utype & operator[](int) const
xvector< utype > & operator=(const xvector< utype > &)
utype & operator()(int) const
xvector< utype > & operator/=(utype r)
std::initializer_list< utype >::const_iterator ili
void resize(int=3, int nl=1)
resize a xvector to the given dimensions
void copy(const xvector< utype > &b)
xmatrix< utype > sec(const xmatrix< utype > &) __xprototype
utype scalar_product(const xvector< utype > &a, const xvector< utype > &b)
void sort2(unsigned long n, xvector< utype1 > &a, xvector< utype2 > &b)
xvector< utype > elementwise_product(const xvector< utype > &a, const xvector< utype > &b)
xvector< utype > sech(const xvector< utype > &) __xprototype
xcomplex< utype > exp(const xcomplex< utype > &x)
double convex_volume_integral_triangle(const std::vector< xvector< utype > > &points, const std::vector< std::vector< uint > > &facets, const std::function< double(const xvector< double > &point)> &func)
utype mod(utype x, utype y)
bool isinteger(const xmatrix< utype > &a, const utype &tol)
xmatrix< utype > tanh(const xmatrix< utype > &) __xprototype
xmatrix< utype > tan(const xmatrix< utype > &) __xprototype
xcomplex< utype > cos(const xcomplex< utype > &x)
void set(xmatrix< utype > &a, const utype &s)
bool compareXVecElements(const aurostd::xvector< utype > &a, const aurostd::xvector< utype > &b)
void sort3(unsigned long n, xvector< utype1 > &a, xvector< utype2 > &b, xvector< utype3 > &c)
xmatrix< double > xdouble(const xmatrix< utype > &a) __xprototype
xmatrix< utype > outer_product(const xvector< utype > &a, const xvector< utype > &b)
xvector< utype > acotanh(const xvector< utype > &) __xprototype
void quicksort2(unsigned long n, xvector< utype1 > &, xvector< utype2 > &) __xprototype
xvector< utype > vector_product(const xvector< utype > &a, const xvector< utype > &b)
xmatrix< utype > sign(const xmatrix< utype > &a)
utype modulus(const xmatrix< utype > &a)
xvector< utype > qsort(const xvector< utype > &a)
xvector< utype > getVectorProjection(const xvector< utype > &b, const xvector< utype > &a)
void GCD(const xmatrix< int > &ma, const xmatrix< int > &mb, xmatrix< int > &mgcd)
utype abs(const xcomplex< utype > &x)
xcomplex< utype > sin(const xcomplex< utype > &x)
xvector< utype > operator%(const xvector< utype > &a, const xvector< utype > &b)
utype meanWeighted(const xvector< utype > &a, const xvector< utype > &weights)
utype modulussquare(const xmatrix< utype > &a)
xmatrix< utype > asinh(const xmatrix< utype > &) __xprototype
xvector< double > linspace(const double start, const double stop, const int n)
vector< utype > clear(vector< utype > &v)
xvector< utype > moving_average(const xvector< utype > &signal_input, int window)
xmatrix< utype > asin(const xmatrix< utype > &) __xprototype
xvector< double > getGeneralAngles(const xvector< utype > &vec, const utype &tol=_AUROSTD_XVECTOR_TOLERANCE_IDENTITY_)
xmatrix< int > xint(const xmatrix< utype > &a) __xprototype
bool isCollinear(const xvector< utype > &v0, const xvector< utype > &v1, const utype &tol=_AUROSTD_XVECTOR_TOLERANCE_IDENTITY_) __xprototype
xmatrix< utype > acos(const xmatrix< utype > &) __xprototype
vector< utype > reset(vector< utype > &v)
xvector< utype > getModeratedVectorProjection(const xvector< utype > c, const xvector< utype > &b, const xvector< utype > &a)
utype distance(const xvector< utype > &, const xvector< utype > &) __xprototype
double areaPointsOnPlane(const std::vector< xvector< utype > > &points) __xprototype
xcomplex< utype > operator+(const xcomplex< utype > &x, const xcomplex< utype > &y)
xvector< utype > cosech(const xvector< utype > &) __xprototype
xvector< double > getCentroidPBC(const std::vector< xvector< utype > > &points, const xmatrix< utype > &lattice) __xprototype
xmatrix< utype > atan(const xmatrix< utype > &) __xprototype
xvector< double > diffSG(const xvector< double > &f, double dx)
xvector< utype > cotanh(const xvector< utype > &) __xprototype
xmatrix< utype > acosh(const xmatrix< utype > &) __xprototype
void quicksort3(unsigned long n, xvector< utype1 > &, xvector< utype2 > &, xvector< utype3 > &) __xprototype
utype angle(utype x1, utype x2, utype x3, utype y1, utype y2, utype y3)
utype mean(const vector< utype > vec)
xvector< utype > vector2xvector(const std::vector< utype > &, int lrows=1) __xprototype
void quicksort4(unsigned long n, xvector< utype1 > &, xvector< utype2 > &, xvector< utype3 > &, xvector< utype4 > &) __xprototype
xvector< utype > convolution(const xvector< utype > &signal_input, const xvector< utype > &response_input, int SHAPE=CONV_SHAPE_FULL)
void reduceByGCD(const xvector< utype > &in_V, xvector< utype > &out_V, utype tol=(utype) _AUROSTD_XVECTOR_TOLERANCE_IDENTITY_) __xprototype
utype mode(const xvector< utype > &a)
xmatrix< utype > ceil(const xmatrix< utype > &a)
double tetrahedron_integral(const std::vector< xvector< utype > > &points, const std::function< double(const xvector< double > &point)> &func)
xvector< utype > getCentroid(const std::vector< xvector< utype > > &points) __xprototype
xmatrix< utype > log10(const xmatrix< utype > &) __xprototype
xmatrix< utype > floor(const xmatrix< utype > &a)
double volume(const std::vector< xvector< utype > > &points, const std::vector< std::vector< uint > > &facets, const std::vector< xvector< utype > > &normals) __xprototype
bool isequal(const xcomplex< utype > &a, const xcomplex< utype > &b, utype _tol_)
bool isdifferent(const xcomplex< utype > &a, const xcomplex< utype > &b, utype _tol_)
xvector< char > operator<(const xvector< utype > &a, const utype &b)
xvector< utype > getGeneralNormal(const std::vector< xvector< utype > > &_directive_vectors)
utype max(const vector< utype > vec)
xvector< utype > shellsort(const xvector< utype > &a) __xprototype
xmatrix< utype > cosec(const xmatrix< utype > &) __xprototype
xcomplex< utype > pow(const xcomplex< utype > &x, const xcomplex< utype > &y)
std::vector< int > getPeaks(const xvector< utype > &signal_input, uint smoothing_iterations=4, uint avg_window=4, int width_maximum=1, double significance_multiplier=1.0)
double getangle(const xvector< utype > &, const xvector< utype > &) __xprototype
void sort4(unsigned long n, xvector< utype1 > &a, xvector< utype2 > &b, xvector< utype3 > &c, xvector< utype4 > &d)
xvector< utype > heapsort(const xvector< utype > &a) __xprototype
void swap(xvector< utype > &, const int &, const int &) __xprototype
utype mod_floored(utype x, utype y)
floored mod function e.g. std::fmod(-4.0,+1.1)= -0.7; std::fmod(-4.0,-1.1)= -0.7 std::remainder(-4....
xcomplex< utype > operator*(const xcomplex< utype > &x, const xcomplex< utype > &y)
int maxi(const xvector< utype > &) __xprototype
xmatrix< utype > atanh(const xmatrix< utype > &) __xprototype
bool compareVecElements(const std::vector< utype > &a, const std::vector< utype > &b)
xcomplex< utype > sinh(const xcomplex< utype > &x)
xvector< utype > ssort(const xvector< utype > &a)
bool operator==(const xcomplex< utype > &x, const xcomplex< utype > &y)
xvector< char > operator>(const xvector< utype > &a, const utype &b)
xvector< utype > ones_xv(int nh, int nl) __xprototype
int gaussian_filter_get_window(utype sigma) __xprototype
xcomplex< utype > cosh(const xcomplex< utype > &x)
xcomplex< utype > log(const xcomplex< utype > &x)
bool identical(vector< utype > v1, vector< utype > v2, utype epsilon)
utype modulus2(const xmatrix< utype > &a)
xmatrix< long int > xlongint(const xmatrix< utype > &a) __xprototype
utype min(const vector< utype > vec)
utype sum(const vector< utype > vec)
xvector< utype > vabs(const xvector< utype > &) __xprototype
xvector< utype > gaussian_filter_xv(utype sigma) __xprototype
void sort(vector< utype1 > &arr)
bool linePlaneIntersect(const xvector< utype > &p0, const xvector< utype > &n, const xvector< utype > &l0, const xvector< utype > &l, double &d, xvector< utype > &intersection)
void sortPolyhedronFacets(const std::vector< xvector< utype > > &points, std::vector< std::vector< uint > > &facets, std::vector< xvector< utype > > &normals)
xvector< utype > normalizeSumToOne(const xvector< utype > &in_V, const utype &tol=(utype) _AUROSTD_XVECTOR_TOLERANCE_ROUNDOFF_) __xprototype
xmatrix< utype > nint(const xmatrix< utype > &a)
std::vector< xvector< double > > histogram(const xvector< utype > &data, uint bins, double minimum_data, double maximum_data)
xvector< utype > box_filter_xv(int window, int lrows) __xprototype
xcomplex< utype > conj(const xcomplex< utype > &x)
void getQuartiles(const xvector< utype > &_a, utype &q1, utype &q2, utype &q3)
vector< utype > xvector2vector(const xvector< utype > &xvec)
double convex_volume_integral(const std::vector< xvector< utype > > &points, const std::vector< std::vector< uint > > &facets, const std::function< double(const xvector< double > &point)> &func)
int mini(const xvector< utype > &) __xprototype
xvector< utype > pointLineIntersection(const xvector< utype > &a, const xvector< utype > &n, const xvector< utype > &p)
xvector< utype > hpsort(const xvector< utype > &a)
utype getMAD(const xvector< utype > &_a, utype median=(utype) AUROSTD_NAN)
xmatrix< utype > roundoff(const xmatrix< utype > &a, utype _tol_)
double getGeneralAngle(const xvector< utype > &_vec, int _i, const utype &tol=_AUROSTD_XVECTOR_TOLERANCE_IDENTITY_)
xmatrix< long double > xlongdouble(const xmatrix< utype > &a) __xprototype
b64_encoder_proxy operator<<(std::ostream &os, b64_encoder_creator)
xmatrix< char > xchar(const xmatrix< utype > &a) __xprototype
xcomplex< utype > operator-(const xcomplex< utype > &x, const xcomplex< utype > &y)
xvector< out_type > xvector2utype(const xvector< in_type > &in_vec) __xprototype
xvector< utype > quicksort(const xvector< utype > &) __xprototype
xcomplex< utype > operator/(const xcomplex< utype > &x, const xcomplex< utype > &y)
double getcos(const xvector< utype > &, const xvector< utype > &) __xprototype
xvector< uint > sortPolygonVertices(const std::vector< xvector< utype > > &points, const xvector< utype > &normal)
xmatrix< float > xfloat(const xmatrix< utype > &a) __xprototype
utype correlation_Pearson_fast(const xvector< utype > &a, const xvector< utype > &b, int ddof=1)
utype stddev(const xvector< utype > &a, int ddof=1)
xmatrix< utype > trunc(const xmatrix< utype > &a)
utype correlation_Pearson_slow(const xvector< utype > &a, const xvector< utype > &b)
utype elements_product(const xvector< utype > &a)
utype var(const xvector< utype > &a, int ddof=1)
double getsin(const xvector< utype > &, const xvector< utype > &) __xprototype
xmatrix< utype > round(const xmatrix< utype > &a)
xvector< utype > null_xv() __xprototype