31 m_data.assign(values, values + n*m);
41Array2D& Array2D::operator=(
const Array2D& y)
63 for (
size_t m = 0; m <
m_nrows; m++) {
72 for (
size_t m = 0; m <
m_nrows; m++) {
79 for (
size_t j = 0; j <
m_ncols; j++) {
86 for (
size_t j = 0; j <
m_ncols; j++) {
93 for (
size_t i = 0; i <
m_nrows; i++) {
100 for (
size_t i = 0; i <
m_nrows; i++) {
108 size_t nr = m.
nRows();
110 for (
size_t i = 0; i < nr; i++) {
112 for (
size_t j = 1; j < nc; j++) {
Header file for class Cantera::Array2D.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
size_t m_nrows
Number of rows.
vector_fp m_data
Data stored in a single array.
void getColumn(size_t m, double *const col)
Get the values in column m.
void setColumn(size_t m, double *const col)
Set the values in column m to those in array col.
size_t nRows() const
Number of rows.
size_t m_ncols
Number of columns.
size_t nColumns() const
Number of columns.
void setRow(size_t n, const double *const rw)
Set the nth row to array rw.
doublereal & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
iterator end()
Return an iterator pointing past the last element.
void getRow(size_t n, double *const rw)
Get the nth row and return it in a vector.
iterator begin()
Return an iterator pointing to the first element.
void appendColumn(const vector_fp &c)
Append a column to the existing matrix using a std vector.
void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Array2D()
Default constructor.
Namespace for the Cantera kernel.
void operator*=(Array2D &m, double a)
Overload the times equals operator for multiplication of a matrix and a scalar.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
std::ostream & operator<<(std::ostream &s, const Array2D &m)
Output the current contents of the Array2D object.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...