A class for 2D arrays stored in column-major (Fortran-compatible) form.
In this form, the data entry for an n row, m col matrix is
index = i + (n-1) * j
where
J(i,j) = data_start + index
i = row
j = column
Definition at line 31 of file Array.h.
|
| Array2D ()=default |
| Default constructor. More...
|
|
| Array2D (const size_t m, const size_t n, const double v=0.0) |
| Constructor. More...
|
|
| Array2D (const size_t m, const size_t n, const double *values) |
| Constructor. More...
|
|
| Array2D (const Array2D &y) |
|
Array2D & | operator= (const Array2D &y) |
|
virtual void | resize (size_t n, size_t m, double v=0.0) |
| Resize the array, and fill the new entries with 'v'. More...
|
|
void | appendColumn (const vector< double > &c) |
| Append a column to the existing matrix using a std vector. More...
|
|
void | appendColumn (const double *const c) |
| Append a column to the existing matrix. More...
|
|
void | setRow (size_t n, const double *const rw) |
| Set the nth row to array rw. More...
|
|
void | getRow (size_t n, double *const rw) |
| Get the nth row and return it in a vector. More...
|
|
void | setColumn (size_t m, double *const col) |
| Set the values in column m to those in array col. More...
|
|
void | getColumn (size_t m, double *const col) |
| Get the values in column m. More...
|
|
void | zero () |
| Set all of the entries to zero. More...
|
|
double & | operator() (size_t i, size_t j) |
| Allows setting elements using the syntax A(i,j) = x. More...
|
|
double | operator() (size_t i, size_t j) const |
| Allows retrieving elements using the syntax x = A(i,j). More...
|
|
double & | value (size_t i, size_t j) |
| Returns a changeable reference to position in the matrix. More...
|
|
double | value (size_t i, size_t j) const |
| Returns the value of a single matrix entry. More...
|
|
size_t | nRows () const |
| Number of rows. More...
|
|
size_t | nColumns () const |
| Number of columns. More...
|
|
vector< double > & | data () |
| Return a reference to the data vector. More...
|
|
const vector< double > & | data () const |
| Return a const reference to the data vector. More...
|
|
void | operator*= (double a) |
|
double * | ptrColumn (size_t j) |
| Return a pointer to the top of column j, columns are contiguous in memory. More...
|
|
const double * | ptrColumn (size_t j) const |
| Return a const pointer to the top of column j, columns are contiguous in memory. More...
|
|