|
Cantera
2.0
|
A class for 2D double arrays stored in column-major (Fortran-compatible) form. More...
#include <vcs_DoubleStarStar.h>
Public Member Functions | |
| DoubleStarStar () | |
| Default constructor. Create an empty array. | |
| DoubleStarStar (size_t mcol, size_t nrow, double v=0.0) | |
| Constructor. | |
| DoubleStarStar (const DoubleStarStar &y) | |
| copy constructor | |
| DoubleStarStar & | operator= (const DoubleStarStar &y) |
| assignment operator | |
| void | resize (size_t mcol, size_t nrow, double v=0.0) |
| Resize the array, and fill the new entries with 'v'. | |
| double * | operator[] (size_t jcol) |
| Pointer to the top of the column. | |
| const double * | operator[] (size_t jcol) const |
| Returns a const Pointer to the top of the jth column. | |
| double *const * | baseDataAddr () |
| Returns a double ** pointer to the base address. | |
| double const *const * | constBaseDataAddr () const |
| Returns a const double ** pointer to the base address. | |
| size_t | nRows () const |
| Number of rows. | |
| size_t | nColumns () const |
| Number of columns. | |
Private Attributes | |
| std::vector< double > | m_data |
| Storage area. | |
| std::vector< double * > | m_colAddr |
| Vector of addresses for the top of the columns. | |
| size_t | m_nrows |
| number of rows | |
| size_t | m_ncols |
| number of columns | |
A class for 2D double 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 Matrix[j][i] i = row j = column The way this is instantiated is via the constructor: DoubleStarStar Dmatrix(mcol, mrow);
The way this is referenced is via the notation: Dmatrix[icol][irow]
Definition at line 32 of file vcs_DoubleStarStar.h.
| DoubleStarStar | ( | ) |
Default constructor. Create an empty array.
Definition at line 12 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr, and DoubleStarStar::m_data.
| DoubleStarStar | ( | size_t | mcol, |
| size_t | nrow, | ||
| double | v = 0.0 |
||
| ) |
Constructor.
Create an nrow by mcol double array, and initialize all elements to v.
| mcol | Number of columns |
| nrow | Number of rows |
Definition at line 24 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr, DoubleStarStar::m_data, DoubleStarStar::m_ncols, and DoubleStarStar::m_nrows.
| DoubleStarStar | ( | const DoubleStarStar & | y | ) |
copy constructor
| y | object to be copied |
Definition at line 37 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr, DoubleStarStar::m_data, DoubleStarStar::m_ncols, and DoubleStarStar::m_nrows.
| DoubleStarStar & operator= | ( | const DoubleStarStar & | y | ) |
assignment operator
| y | object to be copied |
Definition at line 52 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr, DoubleStarStar::m_data, DoubleStarStar::m_ncols, and DoubleStarStar::m_nrows.
| void resize | ( | size_t | mcol, |
| size_t | nrow, | ||
| double | v = 0.0 |
||
| ) |
Resize the array, and fill the new entries with 'v'.
| mrow | This is the number of columns in the new matrix |
| ncol | This is the number of rows |
| v | Default fill value -> defaults to zero. |
Definition at line 77 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr, DoubleStarStar::m_data, DoubleStarStar::m_ncols, and DoubleStarStar::m_nrows.
Referenced by vcs_VolPhase::operator=(), vcs_VolPhase::resize(), VCS_PROB::resizeElements(), VCS_PROB::resizeSpecies(), vcs_VolPhase::transferElementsFM(), VCS_SOLVE::vcs_initSizes(), and VCS_PROB::VCS_PROB().
| double * operator[] | ( | size_t | jcol | ) |
Pointer to the top of the column.
| jcol | This is the jth column |
Definition at line 122 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr.
| const double * operator[] | ( | size_t | jcol | ) | const |
Returns a const Pointer to the top of the jth column.
| jcol | This is the jth column |
Definition at line 127 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr.
| double *const * baseDataAddr | ( | ) |
Returns a double ** pointer to the base address.
This is the second way to get to the data This returns a double ** which can later be used in Dmatrix[icol][irow] notation to get to the data
Definition at line 132 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr.
Referenced by VCS_PROB::set_gai(), and vcs_VolPhase::transferElementsFM().
| double const *const * constBaseDataAddr | ( | ) | const |
Returns a const double ** pointer to the base address.
This is the second way to get to the data This returns a double ** which can later be used in Dmatrix[icol][irow] notation to get to the data
Definition at line 137 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_colAddr.
Referenced by vcs_VolPhase::getFormulaMatrix().
| size_t nRows | ( | ) | const |
Number of rows.
Definition at line 143 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_nrows.
| size_t nColumns | ( | ) | const |
Number of columns.
Definition at line 149 of file vcs_DoubleStarStar.cpp.
References DoubleStarStar::m_ncols.
|
private |
Storage area.
Definition at line 110 of file vcs_DoubleStarStar.h.
Referenced by DoubleStarStar::DoubleStarStar(), DoubleStarStar::operator=(), and DoubleStarStar::resize().
|
private |
Vector of addresses for the top of the columns.
Length = mcol
Definition at line 116 of file vcs_DoubleStarStar.h.
Referenced by DoubleStarStar::baseDataAddr(), DoubleStarStar::constBaseDataAddr(), DoubleStarStar::DoubleStarStar(), DoubleStarStar::operator=(), DoubleStarStar::operator[](), and DoubleStarStar::resize().
|
private |
number of rows
Definition at line 119 of file vcs_DoubleStarStar.h.
Referenced by DoubleStarStar::DoubleStarStar(), DoubleStarStar::nRows(), DoubleStarStar::operator=(), and DoubleStarStar::resize().
|
private |
number of columns
Definition at line 122 of file vcs_DoubleStarStar.h.
Referenced by DoubleStarStar::DoubleStarStar(), DoubleStarStar::nColumns(), DoubleStarStar::operator=(), and DoubleStarStar::resize().
1.8.2