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

#include <MatrixFuncs.h>

Static Public Member Functions

static unsigned int GetRequiredStorageSize (unsigned int totalRows, unsigned int totalColumns, unsigned int subDiags, unsigned int superDiags)
 Calculates and returns the storage size required.
static unsigned int CalculateNumberOfDiags (unsigned int totalRows, unsigned int diags)
static unsigned int CalculateNumberOfRows (unsigned int totalRows, unsigned int subDiags, unsigned int superDiags)
static unsigned int CalculateIndex (unsigned int totalRows, unsigned int totalColumns, unsigned int row, unsigned int column, unsigned int sub, unsigned int super)
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)

Detailed Description

Definition at line 50 of file MatrixFuncs.h.

Member Function Documentation

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

Definition at line 91 of file MatrixFuncs.cpp.

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

{
unsigned int nextRow = curRow;
unsigned int nextColumn = curColumn;
//if( transpose == 'N' )
//{
// if( (column <= row && (row - column) <= data.GetNumberOfSubDiagonals(totalRows)) ||
// (column > row && (column - row) <= data.GetNumberOfSuperDiagonals(totalRows)) )
// {
// unsigned int arrayColumns = totalColumns;
// unsigned int elementRow = data.GetNumberOfSuperDiagonals(totalRows)+row-column;
// unsigned int elementColumn = column;
// return elementRow + elementColumn*CalculateNumberOfRows(totalRows, data);
// }
// else
// {
// return boost::optional<unsigned int>();
// }
//}
//else
//{
//}
return boost::tuples::tuple<unsigned int, unsigned int>(nextRow, nextColumn);
}
unsigned int Nektar::BandedMatrixFuncs::CalculateIndex ( unsigned int  totalRows,
unsigned int  totalColumns,
unsigned int  row,
unsigned int  column,
unsigned int  sub,
unsigned int  super 
)
static

Definition at line 70 of file MatrixFuncs.cpp.

References CalculateNumberOfDiags(), and CalculateNumberOfRows().

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

{
if( (column <= row && (row - column) <= CalculateNumberOfDiags(totalRows, sub)) ||
(column > row && (column - row) <= CalculateNumberOfDiags(totalRows, super)) )
{
unsigned int elementRow = CalculateNumberOfDiags(totalRows, super)+row-column;
unsigned int elementColumn = column;
return elementRow + elementColumn*CalculateNumberOfRows(totalRows, sub, super);
}
else
{
return std::numeric_limits<unsigned int>::max();
}
}
unsigned int Nektar::BandedMatrixFuncs::CalculateNumberOfDiags ( unsigned int  totalRows,
unsigned int  diags 
)
static

Definition at line 49 of file MatrixFuncs.cpp.

Referenced by CalculateIndex(), and CalculateNumberOfRows().

{
if( diags != std::numeric_limits<unsigned int>::max() )
{
return diags;
}
else if( totalRows > 0 )
{
return totalRows-1;
}
else
{
return 0;
}
}
unsigned int Nektar::BandedMatrixFuncs::CalculateNumberOfRows ( unsigned int  totalRows,
unsigned int  subDiags,
unsigned int  superDiags 
)
static

Definition at line 65 of file MatrixFuncs.cpp.

References CalculateNumberOfDiags().

Referenced by CalculateIndex(), and GetRequiredStorageSize().

{
return CalculateNumberOfDiags(totalRows, subDiags) + CalculateNumberOfDiags(totalRows, superDiags) + 1;
}
unsigned int Nektar::BandedMatrixFuncs::GetRequiredStorageSize ( unsigned int  totalRows,
unsigned int  totalColumns,
unsigned int  subDiags,
unsigned int  superDiags 
)
static

Calculates and returns the storage size required.

This method assumes that the matrix will be used with LU factorizationa and allocates additional storage as appropriate.

Definition at line 43 of file MatrixFuncs.cpp.

References CalculateNumberOfRows().

Referenced by Nektar::LinearSystem::FactorMatrix(), and Nektar::ConstMatrix< DataType >::GetRequiredStorageSize().

{
return CalculateNumberOfRows(totalRows, subDiags, superDiags)*totalColumns;
}