26 m_data.assign(values, values + n*m);
36Array2D& Array2D::operator=(
const Array2D& y)
58 for (
size_t m = 0; m <
m_nrows; m++) {
67 for (
size_t m = 0; m <
m_nrows; m++) {
74 for (
size_t j = 0; j <
m_ncols; j++) {
81 for (
size_t j = 0; j <
m_ncols; j++) {
88 for (
size_t i = 0; i <
m_nrows; i++) {
95 for (
size_t i = 0; i <
m_nrows; i++) {
122 size_t nr = m.
nRows();
124 for (
size_t i = 0; i < nr; i++) {
126 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.
vector< double > m_data
Data stored in a single array.
Array2D()=default
Default constructor.
size_t m_nrows
Number of rows.
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.
iterator begin()
Return an iterator pointing to the first element.
iterator end()
Return an iterator pointing past the last element.
size_t nRows() const
Number of rows.
vector< double >::iterator iterator
Type definition for the iterator class that is can be used by Array2D types.
size_t m_ncols
Number of columns.
size_t nColumns() const
Number of columns.
void appendColumn(const vector< double > &c)
Append a column to the existing matrix using a std vector.
void setRow(size_t n, const double *const rw)
Set the nth row to array rw.
void getRow(size_t n, double *const rw)
Get the nth row and return it in a vector.
double & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
vector< double >::const_iterator const_iterator
Type definition for the const_iterator class that is can be used by Array2D types.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
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 warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
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 and polynomial operations (see Templated Arr...