Cantera  2.0
DoubleStarStar Class Reference

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

DoubleStarStaroperator= (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.

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.

Vector of addresses for the top of the columns.

size_t m_nrows
number of rows

size_t m_ncols
number of columns

## Detailed Description

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.

## Constructor & Destructor Documentation

 DoubleStarStar ( )

Default constructor. Create an empty array.

Definition at line 12 of file vcs_DoubleStarStar.cpp.

 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.

Parameters
 mcol Number of columns nrow Number of rows

Definition at line 24 of file vcs_DoubleStarStar.cpp.

 DoubleStarStar ( const DoubleStarStar & y )

copy constructor

Parameters
 y object to be copied

Definition at line 37 of file vcs_DoubleStarStar.cpp.

## Member Function Documentation

 DoubleStarStar & operator= ( const DoubleStarStar & y )

assignment operator

Parameters
 y object to be copied

Definition at line 52 of file vcs_DoubleStarStar.cpp.

 void resize ( size_t mcol, size_t nrow, double v = 0.0 )

Resize the array, and fill the new entries with 'v'.

Parameters
 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.

 double * operator[] ( size_t jcol )

Pointer to the top of the column.

Parameters
 jcol This is the jth column
Returns
returns the pointer to the top of the jth column

Definition at line 122 of file vcs_DoubleStarStar.cpp.

 const double * operator[] ( size_t jcol ) const

Returns a const Pointer to the top of the jth column.

Parameters
 jcol This is the jth column
Returns
returns the pointer to the top of the jth column

Definition at line 127 of file vcs_DoubleStarStar.cpp.

 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.

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.

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.

## Member Data Documentation

 std::vector m_data
private

Storage area.

Definition at line 110 of file vcs_DoubleStarStar.h.

private

Vector of addresses for the top of the columns.

Length = mcol

Definition at line 116 of file vcs_DoubleStarStar.h.

 size_t m_nrows
private

number of rows

Definition at line 119 of file vcs_DoubleStarStar.h.

 size_t m_ncols
private

number of columns

Definition at line 122 of file vcs_DoubleStarStar.h.

The documentation for this class was generated from the following files: