#include <aurostd_xmatrix.h>
Public Member Functions | |
xmatrix (int=3, int=3, int=1, int=1) | |
xmatrix (const std::initializer_list< std::initializer_list< utype > >) | |
xmatrix (int, int, utype *) | |
xmatrix (const xmatrix< utype > &) | |
xmatrix (const xvector< utype > &) | |
xmatrix< utype > & | operator= (const xmatrix< utype > &) |
xmatrix< utype > & | operator= (const std::initializer_list< std::initializer_list< utype > >) |
~xmatrix () | |
utype * | operator[] (int) const |
xvector< utype > | operator() (int) const |
xvector< utype > | getcol (int) const |
xvector< utype > | getdiag (int k=0, int _lrows=1) const |
xvector< utype > | getxvec () const |
Convert xmatrix into xvector given a set of indices. | |
xvector< utype > | getxvec (int lrow, int urow, int lcol, int ucol, int lrows_out=1) const |
Convert an xmatrix into an xvector given a set of indices. | |
void | getxmatInPlace (xmatrix< utype > &mat_out, int lrow, int urow, int lcol, int ucol, int lrows_out=1, int lcols_out=1) const |
Convert xmatrix into a submatrix given a set of indices. | |
void | getxvecInPlace (xvector< utype > &xv_out, int lrow, int urow, int lcol, int ucol, int lrows_out=1) const |
xmatrix< utype > | getxmat (int lrow, int urow, int lcol, int ucol, int lrows_out=1, int lcols_out=1) const |
void | setrow (const xvector< utype > &row, int irow=1) |
void | setcol (const xvector< utype > &col, int icol=1) |
void | setmat (const xmatrix< utype > &mat, int irow=1, int icol=1) |
void | setmat (const xvector< utype > &xv, int icol=1, bool col=true) |
utype & | operator() (int, int) const |
utype & | operator() (int, int, bool) const |
xmatrix< utype > & | operator+= (const xmatrix< utype > &) |
xmatrix< utype > & | operator+= (const std::initializer_list< std::initializer_list< utype > >) |
xmatrix< utype > & | operator-= (const xmatrix< utype > &) |
xmatrix< utype > & | operator-= (const std::initializer_list< std::initializer_list< utype > >) |
xmatrix< utype > & | operator*= (const xmatrix< utype > &) |
xmatrix< utype > & | operator*= (utype r) |
xmatrix< utype > & | operator/= (utype r) |
xmatrix< utype > & | operator/= (const xmatrix< utype > &) |
void | set (const utype &) |
void | reset () |
void | clear () |
void | shift (int new_lrows, int new_lcols) |
shift the lower bounds of an xmatrix to new values | |
void | shiftrow (int new_lrows) |
shift the lower row bound of an xmatrix to a new value | |
void | shiftcol (int new_lcols) |
shift the lower column bound of an xmatrix to a new value | |
void | reshape (uint new_rows, uint new_cols=0) |
reshape a xmatrix to given dimensions | |
void | reshape (int new_urows, int new_ucols, int new_lrows, int new_lcols) |
reshape a xmatrix to given dimensions | |
Public Attributes | |
int | rows |
int | lrows |
int | urows |
int | cols |
int | lcols |
int | ucols |
bool | issquare |
bool | isfloat |
bool | iscomplex |
Private Types | |
typedef std::initializer_list< utype >::const_iterator | ili |
typedef std::initializer_list< std::initializer_list< utype > >::const_iterator | il2i |
Private Member Functions | |
void | init () |
void | free () |
void | copy (const xmatrix< utype > &b) |
void | copy (const xvector< utype > &b) |
void | copy (const std::initializer_list< std::initializer_list< utype > > ll) |
void | refresh () |
Private Attributes | |
utype ** | corpus |
char | size |
long int | msize |
Definition at line 40 of file aurostd_xmatrix.h.
|
private |
Definition at line 104 of file aurostd_xmatrix.h.
|
private |
Definition at line 105 of file aurostd_xmatrix.h.
aurostd::xmatrix< utype >::xmatrix | ( | int | nrh = 3, |
int | nch = 3, | ||
int | nrl = 1, | ||
int | ncl = 1 ) |
Definition at line 60 of file aurostd_xmatrix.cpp.
aurostd::xmatrix< utype >::xmatrix | ( | const std::initializer_list< std::initializer_list< utype > > | ll | ) |
Definition at line 115 of file aurostd_xmatrix.cpp.
aurostd::xmatrix< utype >::xmatrix | ( | int | vrows, |
int | vcols, | ||
utype * | a ) |
Definition at line 140 of file aurostd_xmatrix.cpp.
aurostd::xmatrix< utype >::xmatrix | ( | const xmatrix< utype > & | b | ) |
Definition at line 97 of file aurostd_xmatrix.cpp.
aurostd::xmatrix< utype >::xmatrix | ( | const xvector< utype > & | b | ) |
Definition at line 106 of file aurostd_xmatrix.cpp.
aurostd::xmatrix< utype >::~xmatrix | ( | ) |
Definition at line 184 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator= | ( | const xmatrix< utype > & | b | ) |
Definition at line 295 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator= | ( | const std::initializer_list< std::initializer_list< utype > > | ll | ) |
Definition at line 306 of file aurostd_xmatrix.cpp.
utype * aurostd::xmatrix< utype >::operator[] | ( | int | ir | ) | const |
Definition at line 455 of file aurostd_xmatrix.cpp.
xvector< utype > aurostd::xmatrix< utype >::operator() | ( | int | i | ) | const |
Definition at line 507 of file aurostd_xmatrix.cpp.
|
nodiscard |
Definition at line 521 of file aurostd_xmatrix.cpp.
|
nodiscard |
Definition at line 534 of file aurostd_xmatrix.cpp.
|
nodiscard |
Convert xmatrix into xvector given a set of indices.
void |
This function performs the same task as getxvecInPlace(), but it assumes that you have already passed it a 1-d slice of the xmatrix and then performs the type conversion.
Definition at line 675 of file aurostd_xmatrix.cpp.
|
nodiscard |
Convert an xmatrix into an xvector given a set of indices.
xv_out | the xvector that will be changed InPlace |
lrow | lower row to include in xvector |
urow | upper row to include in xvector |
lcol | lower column to include in xvector |
ucol | upper column to include in xvector |
This function allocates the xvector then calls getxvecInPlace().
Definition at line 653 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::getxmatInPlace | ( | xmatrix< utype > & | mat_out, |
int | lrow, | ||
int | urow, | ||
int | lcol, | ||
int | ucol, | ||
int | lrows_out = 1, | ||
int | lcols_out = 1 ) const |
Convert xmatrix into a submatrix given a set of indices.
mat_out | the matrix that will be changed InPlace |
lrow | lower row to include in submatrix |
urow | upper row to include in submatrix |
lcol | lower column to include in submatrix |
ucol | upper column to include in submatrix |
lrows_out | the lower row of the matrix that will be written over mat_out (if it is not the same it will allocate a new matrix) |
lcols_out | the lower column of the matrix that will be written over mat_out (if it is not the same it will allocate a new matrix) |
This is a function that slices an xmatrix into into a submatrix, originally written by CO. When slicing the xmatrix. lrow is lower row. urow is upper row. lcol is lower column and ucol is upper column. Note that the indices are inclusive. i.e any index given will be returned. Also lcol == ucol or lrow == urow in order to be a vector. This function is designed so the base "InPlace" function drives the rest of the functions. The InPlace designation means you must supply a matrix that will then be changed InPlace to the matrix elements that are specified by the arguments.
CO: this function returns a submatrix mat_out spanning urow:lrow,ucol:lcol of the original matrix lrows_out,lcols_out specifies lrows,lcols of mat_out this is different than submatrix(), which returns back a submatrix by cutting out irow,jcol
Definition at line 711 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::getxvecInPlace | ( | xvector< utype > & | xv_out, |
int | lrow, | ||
int | urow, | ||
int | lcol, | ||
int | ucol, | ||
int | lrows_out = 1 ) const |
Convert an xmatrix into an xvector given a set of indices.
xv_out | the xvector that will be changed InPlace |
lrow | lower row to include in xvector |
urow | upper row to include in xvector |
lcol | lower column to include in xvector |
ucol | upper column to include in xvector |
lrows_out | the lower rows of the output xvector (if it does not match the xvector will be resized) |
This is a function that slices an xmatrix into an xvector, It checks that the vector is 1-dimensional when slicing the xmatrix. Note that the indices are inclusive.
Definition at line 560 of file aurostd_xmatrix.cpp.
|
nodiscard |
Definition at line 747 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::setrow | ( | const xvector< utype > & | row, |
int | irow = 1 ) |
Definition at line 756 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::setcol | ( | const xvector< utype > & | col, |
int | icol = 1 ) |
Definition at line 768 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::setmat | ( | const xmatrix< utype > & | mat, |
int | irow = 1, | ||
int | icol = 1 ) |
Definition at line 780 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::setmat | ( | const xvector< utype > & | xv, |
int | icol = 1, | ||
bool | col = true ) |
Definition at line 809 of file aurostd_xmatrix.cpp.
utype & aurostd::xmatrix< utype >::operator() | ( | int | i, |
int | j ) const |
Definition at line 477 of file aurostd_xmatrix.cpp.
utype & aurostd::xmatrix< utype >::operator() | ( | int | i, |
int | j, | ||
bool | bc ) const |
Definition at line 866 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator+= | ( | const xmatrix< utype > & | r | ) |
Definition at line 950 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator+= | ( | const std::initializer_list< std::initializer_list< utype > > | ll | ) |
Definition at line 971 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator-= | ( | const xmatrix< utype > & | r | ) |
Definition at line 997 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator-= | ( | const std::initializer_list< std::initializer_list< utype > > | ll | ) |
Definition at line 1018 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator*= | ( | const xmatrix< utype > & | b | ) |
Definition at line 1045 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator*= | ( | utype | r | ) |
Definition at line 1093 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator/= | ( | utype | r | ) |
Definition at line 1113 of file aurostd_xmatrix.cpp.
xmatrix< utype > & aurostd::xmatrix< utype >::operator/= | ( | const xmatrix< utype > & | a | ) |
Definition at line 1130 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::set | ( | const utype & | s | ) |
Definition at line 2455 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::reset | ( | ) |
Definition at line 2397 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::clear | ( | ) |
Definition at line 2429 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::shift | ( | int | new_lrows, |
int | new_lcols ) |
shift the lower bounds of an xmatrix to new values
new_lrows | new lower bound for rows |
new_lcols | new lower bound for columns |
Definition at line 342 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::shiftrow | ( | int | new_lrows | ) |
shift the lower row bound of an xmatrix to a new value
new_lrows | new lower bound for rows |
Definition at line 362 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::shiftcol | ( | int | new_lcols | ) |
shift the lower column bound of an xmatrix to a new value
new_lcols | new lower bound for columns |
Definition at line 369 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::reshape | ( | uint | new_rows, |
uint | new_cols = 0 ) |
reshape a xmatrix to given dimensions
new_rows | row count |
new_cols | column count |
Definition at line 383 of file aurostd_xmatrix.cpp.
void aurostd::xmatrix< utype >::reshape | ( | int | new_urows, |
int | new_ucols, | ||
int | new_lrows, | ||
int | new_lcols ) |
reshape a xmatrix to given dimensions
new_urows | new upper bound for rows |
new_ucols | new upper bound for columns |
new_lrows | new lower bound for rows |
new_lcols | new lower bound for columns |
Definition at line 410 of file aurostd_xmatrix.cpp.
|
private |
Definition at line 122 of file aurostd_xmatrix.cpp.
|
private |
Definition at line 201 of file aurostd_xmatrix.cpp.
|
private |
Definition at line 212 of file aurostd_xmatrix.cpp.
|
private |
Definition at line 262 of file aurostd_xmatrix.cpp.
|
private |
Definition at line 270 of file aurostd_xmatrix.cpp.
|
private |
Definition at line 316 of file aurostd_xmatrix.cpp.
int aurostd::xmatrix< utype >::rows |
Definition at line 83 of file aurostd_xmatrix.h.
int aurostd::xmatrix< utype >::lrows |
Definition at line 83 of file aurostd_xmatrix.h.
int aurostd::xmatrix< utype >::urows |
Definition at line 83 of file aurostd_xmatrix.h.
int aurostd::xmatrix< utype >::cols |
Definition at line 84 of file aurostd_xmatrix.h.
int aurostd::xmatrix< utype >::lcols |
Definition at line 84 of file aurostd_xmatrix.h.
int aurostd::xmatrix< utype >::ucols |
Definition at line 84 of file aurostd_xmatrix.h.
bool aurostd::xmatrix< utype >::issquare |
Definition at line 85 of file aurostd_xmatrix.h.
bool aurostd::xmatrix< utype >::isfloat |
Definition at line 85 of file aurostd_xmatrix.h.
bool aurostd::xmatrix< utype >::iscomplex |
Definition at line 85 of file aurostd_xmatrix.h.
|
private |
Definition at line 100 of file aurostd_xmatrix.h.
|
private |
Definition at line 102 of file aurostd_xmatrix.h.
|
private |
Definition at line 103 of file aurostd_xmatrix.h.