Array.h Source File#
Array.h
Go to the documentation of this file.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition Array.h:32
void setColumn(size_t m, double *const col)
Set the values in column m to those in array col.
Definition Array.cpp:86
double value(size_t i, size_t j) const
Returns the value of a single matrix entry.
Definition Array.h:171
double & operator()(size_t i, size_t j)
Allows setting elements using the syntax A(i,j) = x.
Definition Array.h:137
const vector< double > & data() const
Return a const reference to the data vector.
Definition Array.h:191
const double * ptrColumn(size_t j) const
Return a const pointer to the top of column j, columns are contiguous in memory.
Definition Array.h:213
void appendColumn(const vector< double > &c)
Append a column to the existing matrix using a std vector.
Definition Array.cpp:54
double * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
Definition Array.h:203
void getRow(size_t n, double *const rw)
Get the nth row and return it in a vector.
Definition Array.cpp:79
double & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
Definition Array.h:160
double operator()(size_t i, size_t j) const
Allows retrieving elements using the syntax x = A(i,j).
Definition Array.h:147
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Definition Array.cpp:47
This file contains definitions of constants, types and terms that are used in internal routines and a...
void operator*=(Array2D &m, double a)
Overload the times equals operator for multiplication of a matrix and a scalar.
Definition Array.cpp:114
std::ostream & operator<<(std::ostream &s, const Array2D &m)
Output the current contents of the Array2D object.
Definition Array.cpp:100
Generated by 1.9.7