Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | List of all members
Nektar::SymmetricMatrixFuncs Struct Reference

#include <MatrixFuncs.h>

Inheritance diagram for Nektar::SymmetricMatrixFuncs:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SymmetricMatrixFuncs:
Collaboration graph
[legend]

Static Public Member Functions

static unsigned int CalculateIndex (unsigned int curRow, unsigned int curColumn)
static boost::tuples::tuple
< unsigned int, unsigned int > 
Advance (const unsigned int totalRows, const unsigned int totalColumns, const unsigned int curRow, const unsigned int curColumn)

Additional Inherited Members

- Static Private Member Functions inherited from Nektar::TriangularMatrixFuncs
static unsigned int GetRequiredStorageSize (unsigned int rows, unsigned int columns)

Detailed Description

Definition at line 197 of file MatrixFuncs.h.

Member Function Documentation

boost::tuples::tuple< unsigned int, unsigned int > Nektar::SymmetricMatrixFuncs::Advance ( const unsigned int  totalRows,
const unsigned int  totalColumns,
const unsigned int  curRow,
const unsigned int  curColumn 
)
static

Definition at line 296 of file MatrixFuncs.cpp.

References ASSERTL1.

Referenced by Nektar::NekMatrix< DataType, StandardMatrixTag >::Advance().

{
ASSERTL1(totalRows == totalColumns, "Symmetric matrices must be square.");
ASSERTL1(curRow < totalRows, "Attemping to iterate through an element on row " +
boost::lexical_cast<std::string>(curRow) + " of a (" +
boost::lexical_cast<std::string>(totalRows) + ", " +
boost::lexical_cast<std::string>(totalColumns) + " symmetric matrix.");
ASSERTL1(curColumn < totalColumns, "Attemping to iterate through an element on row " +
boost::lexical_cast<std::string>(curColumn) + " of a (" +
boost::lexical_cast<std::string>(totalRows) + ", " +
boost::lexical_cast<std::string>(totalColumns) + " symmetric matrix.");
unsigned int nextRow = curRow;
unsigned int nextColumn = curColumn;
if( nextRow < totalRows )
{
++nextRow;
}
if( nextRow >= totalRows )
{
nextRow = 0;
++nextColumn;
}
if( nextColumn >= totalColumns )
{
nextRow = std::numeric_limits<unsigned int>::max();
nextColumn = std::numeric_limits<unsigned int>::max();
}
return boost::tuples::tuple<unsigned int, unsigned int>(nextRow, nextColumn);
}
unsigned int Nektar::SymmetricMatrixFuncs::CalculateIndex ( unsigned int  curRow,
unsigned int  curColumn 
)
static

Definition at line 283 of file MatrixFuncs.cpp.

Referenced by Nektar::ConstMatrix< DataType >::CalculateIndex().

{
if( curRow <= curColumn )
{
return curRow + curColumn*(curColumn+1)/2;
}
else
{
return curColumn + curRow*(curRow + 1)/2;
}
}