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

#include <MatrixFuncs.h>

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

Static Public Member Functions

static unsigned int CalculateIndex (unsigned int totalColumns, 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, char transpose= 'N')
- Static Public Member Functions inherited from Nektar::TriangularMatrixFuncs
static unsigned int GetRequiredStorageSize (unsigned int rows, unsigned int columns)

Detailed Description

Definition at line 185 of file MatrixFuncs.h.

Member Function Documentation

boost::tuples::tuple< unsigned int, unsigned int > Nektar::LowerTriangularMatrixFuncs::Advance ( const unsigned int  totalRows,
const unsigned int  totalColumns,
const unsigned int  curRow,
const unsigned int  curColumn,
char  transpose = 'N' 
)
static

Definition at line 234 of file MatrixFuncs.cpp.

References ASSERTL1.

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

{
ASSERTL1(totalRows == totalColumns, "Triangular 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) + " lower triangular 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) + " lower triangular matrix.");
ASSERTL1(curRow >= curColumn, "Attemping to iterate through element (" +
boost::lexical_cast<std::string>(curRow) + ", " +
boost::lexical_cast<std::string>(curColumn) + ") of a (" +
boost::lexical_cast<std::string>(totalRows) + ", " +
boost::lexical_cast<std::string>(totalColumns) + " lower triangular matrix.");
if( transpose == 'T' )
{
totalColumns, totalRows, curColumn, curRow);
}
unsigned int nextRow = curRow;
unsigned int nextColumn = curColumn;
if( nextRow < totalRows )
{
++nextRow;
}
if( nextRow >= totalRows )
{
++nextColumn;
nextRow = 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::LowerTriangularMatrixFuncs::CalculateIndex ( unsigned int  totalColumns,
unsigned int  curRow,
unsigned int  curColumn 
)
static

Definition at line 221 of file MatrixFuncs.cpp.

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

{
if( curRow >= curColumn )
{
return curRow + (2*totalColumns - curColumn - 1)*(curColumn)/2;
}
else
{
return std::numeric_limits<unsigned int>::max();
}
}