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().

298  {
299  ASSERTL1(totalRows == totalColumns, "Symmetric matrices must be square.");
300  ASSERTL1(curRow < totalRows, "Attemping to iterate through an element on row " +
301  boost::lexical_cast<std::string>(curRow) + " of a (" +
302  boost::lexical_cast<std::string>(totalRows) + ", " +
303  boost::lexical_cast<std::string>(totalColumns) + " symmetric matrix.");
304  ASSERTL1(curColumn < totalColumns, "Attemping to iterate through an element on row " +
305  boost::lexical_cast<std::string>(curColumn) + " of a (" +
306  boost::lexical_cast<std::string>(totalRows) + ", " +
307  boost::lexical_cast<std::string>(totalColumns) + " symmetric matrix.");
308 
309  unsigned int nextRow = curRow;
310  unsigned int nextColumn = curColumn;
311 
312  if( nextRow < totalRows )
313  {
314  ++nextRow;
315  }
316 
317  if( nextRow >= totalRows )
318  {
319  nextRow = 0;
320  ++nextColumn;
321  }
322 
323  if( nextColumn >= totalColumns )
324  {
325  nextRow = std::numeric_limits<unsigned int>::max();
326  nextColumn = std::numeric_limits<unsigned int>::max();
327  }
328 
329  return boost::tuples::tuple<unsigned int, unsigned int>(nextRow, nextColumn);
330  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
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().

284  {
285  if( curRow <= curColumn )
286  {
287  return curRow + curColumn*(curColumn+1)/2;
288  }
289  else
290  {
291  return curColumn + curRow*(curRow + 1)/2;
292  }
293  }