Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag > Class Template Reference

#include <BlockMatrix.hpp>

Inheritance diagram for Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >:
Collaboration graph
[legend]

Classes

class  iterator_base

Public Types

typedef NekMatrix< DataType,
InnerMatrixType > 
InnerType
typedef NekMatrix< InnerType,
BlockMatrixTag > 
ThisType
typedef InnerType::NumberType NumberType
typedef ConstMatrix< NumberTypeBaseType
typedef InnerType::GetValueType GetValueType
typedef
InnerType::ConstGetValueType 
ConstGetValueType
typedef iterator_base< ThisTypeiterator
typedef iterator_base< const
ThisType
const_iterator

Public Member Functions

 NekMatrix (MatrixStorage type=eFULL)
 NekMatrix (unsigned int numberOfBlockRows, unsigned int numberOfBlockColumns, unsigned int rowsPerBlock, unsigned int columnsPerBlock, MatrixStorage type=eFULL)
 NekMatrix (unsigned int numberOfBlockRows, unsigned int numberOfBlockColumns, const unsigned int *rowsPerBlock, const unsigned int *columnsPerBlock, MatrixStorage type=eFULL)
 NekMatrix (unsigned int numberOfBlockRows, unsigned int numberOfBlockColumns, const Array< OneD, const unsigned int > &rowsPerBlock, const Array< OneD, const unsigned int > &columnsPerBlock, MatrixStorage type=eFULL)
 NekMatrix (const Array< OneD, const unsigned int > &rowsPerBlock, const Array< OneD, const unsigned int > &columnsPerBlock, MatrixStorage type=eFULL)
 NekMatrix (const ThisType &rhs)
unsigned int GetRequiredStorageSize () const
unsigned int CalculateBlockIndex (unsigned int row, unsigned int column) const
const InnerTypeGetBlockPtr (unsigned int row, unsigned int column) const
boost::shared_ptr< const
InnerType
GetBlock (unsigned int row, unsigned int column) const
boost::shared_ptr< InnerType > & GetBlock (unsigned int row, unsigned int column)
void SetBlock (unsigned int row, unsigned int column, boost::shared_ptr< InnerType > &m)
ConstGetValueType operator() (unsigned int row, unsigned int col) const
unsigned int GetStorageSize () const
MatrixStorage GetType () const
unsigned int GetNumberOfBlockRows () const
unsigned int GetNumberOfBlockColumns () const
unsigned int GetNumberOfRowsInBlockRow (unsigned int blockRow) const
unsigned int GetNumberOfColumnsInBlockColumn (unsigned int blockCol) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
- Public Member Functions inherited from Nektar::ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType >
virtual ~ConstMatrix ()
MatrixStorage GetStorageType () const
unsigned int GetRows () const
unsigned int GetTransposedRows (char transpose) const
unsigned int GetColumns () const
unsigned int GetTransposedColumns (char transpose) const
const unsigned int * GetSize () const
void Transpose ()
char GetTransposeFlag () const

Static Public Member Functions

static ThisType CreateWrapper (const ThisType &rhs)
static boost::shared_ptr
< ThisType
CreateWrapper (const boost::shared_ptr< ThisType > &rhs)
- Static Public Member Functions inherited from Nektar::ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType >
static unsigned int CalculateIndex (MatrixStorage type, unsigned int row, unsigned int col, unsigned int numRows, unsigned int numColumns, const char transpose= 'N', unsigned int numSubDiags=0, unsigned int numSuperDiags=0)
static unsigned int GetRequiredStorageSize (MatrixStorage type, unsigned int rows, unsigned int columns, unsigned int subDiags=0, unsigned int superDiags=0)

Private Member Functions

void Initialize (const unsigned int *rowsPerBlock, const unsigned int *columnsPerBlock)
virtual boost::call_traits
< NumberType >::value_type 
v_GetValue (unsigned int row, unsigned int column) const
virtual unsigned int v_GetStorageSize () const
virtual MatrixStorage v_GetStorageType () const
virtual void v_Transpose ()

Static Private Member Functions

static unsigned int GetNumberOfElementsInBlock (unsigned int block, unsigned int totalBlocks, const Array< OneD, unsigned int > &sizes)

Private Attributes

Array< OneD, boost::shared_ptr
< InnerType > > 
m_data
boost::shared_ptr< InnerTypem_nullBlockPtr
Array< OneD, unsigned int > m_rowSizes
Array< OneD, unsigned int > m_columnSizes
unsigned int m_storageSize
unsigned int m_numberOfBlockRows
unsigned int m_numberOfBlockColumns
MatrixStorage m_storageType

Static Private Attributes

static NumberType m_zeroElement

Additional Inherited Members

- Protected Member Functions inherited from Nektar::ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType >
 ConstMatrix (unsigned int rows, unsigned int columns)
 ConstMatrix (const ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType > &rhs)
ConstMatrix< NekMatrix
< DataType, InnerMatrixType >
::NumberType > & 
operator= (const ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType > &rhs)
void Resize (unsigned int rows, unsigned int columns)
 Resets the rows and columns in the array. This method does not update the data storage to match the new row and column counts.
void SetTransposeFlag (char newValue)
char GetRawTransposeFlag () const

Detailed Description

template<typename DataType, typename InnerMatrixType>
class Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >

Definition at line 52 of file BlockMatrix.hpp.

Member Typedef Documentation

template<typename DataType , typename InnerMatrixType >
typedef ConstMatrix<NumberType> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::BaseType

Definition at line 58 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef iterator_base<const ThisType> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::const_iterator

Definition at line 131 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef InnerType::ConstGetValueType Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::ConstGetValueType

Definition at line 64 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef InnerType::GetValueType Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetValueType

Definition at line 63 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef NekMatrix<DataType, InnerMatrixType> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::InnerType

Definition at line 55 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef iterator_base<ThisType> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::iterator

Definition at line 130 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef InnerType::NumberType Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NumberType

Definition at line 57 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
typedef NekMatrix<InnerType, BlockMatrixTag> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::ThisType

Definition at line 56 of file BlockMatrix.hpp.

Constructor & Destructor Documentation

template<typename DataType , typename InnerMatrixType >
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NekMatrix ( MatrixStorage  type = eFULL)
explicit
template<typename DataType , typename InnerMatrixType >
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NekMatrix ( unsigned int  numberOfBlockRows,
unsigned int  numberOfBlockColumns,
unsigned int  rowsPerBlock,
unsigned int  columnsPerBlock,
MatrixStorage  type = eFULL 
)

Definition at line 55 of file BlockMatrix.cpp.

:
BaseType(numberOfBlockRows*rowsPerBlock, numberOfBlockColumns*columnsPerBlock),
m_data(),
m_rowSizes(numberOfBlockRows),
m_columnSizes(numberOfBlockColumns),
m_numberOfBlockRows(numberOfBlockRows),
m_numberOfBlockColumns(numberOfBlockColumns),
{
m_data = Array<OneD, boost::shared_ptr<InnerType> >(m_storageSize, boost::shared_ptr<InnerType>());
for(unsigned int i = 1; i <= numberOfBlockRows; ++i)
{
m_rowSizes[i-1] = i*rowsPerBlock-1;
}
for(unsigned int i = 1; i <= numberOfBlockColumns; ++i)
{
m_columnSizes[i-1] = i*columnsPerBlock-1;
}
}
template<typename DataType , typename InnerMatrixType >
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NekMatrix ( unsigned int  numberOfBlockRows,
unsigned int  numberOfBlockColumns,
const unsigned int *  rowsPerBlock,
const unsigned int *  columnsPerBlock,
MatrixStorage  type = eFULL 
)

Definition at line 81 of file BlockMatrix.cpp.

:
BaseType(std::accumulate(rowsPerBlock, rowsPerBlock + numberOfBlockRows, 0),
std::accumulate(columnsPerBlock, columnsPerBlock + numberOfBlockColumns, 0)),
m_data(),
m_rowSizes(numberOfBlockRows),
m_columnSizes(numberOfBlockColumns),
m_numberOfBlockRows(numberOfBlockRows),
m_numberOfBlockColumns(numberOfBlockColumns),
{
m_data = Array<OneD, boost::shared_ptr<InnerType> >(m_storageSize, boost::shared_ptr<InnerType>());
Initialize(rowsPerBlock, columnsPerBlock);
}
template<typename DataType , typename InnerMatrixType >
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NekMatrix ( unsigned int  numberOfBlockRows,
unsigned int  numberOfBlockColumns,
const Array< OneD, const unsigned int > &  rowsPerBlock,
const Array< OneD, const unsigned int > &  columnsPerBlock,
MatrixStorage  type = eFULL 
)

Definition at line 100 of file BlockMatrix.cpp.

:
BaseType(std::accumulate(rowsPerBlock.data(), rowsPerBlock.data() + numberOfBlockRows, 0),
std::accumulate(columnsPerBlock.data(), columnsPerBlock.data() + numberOfBlockColumns, 0)),
m_data(),
m_rowSizes(numberOfBlockRows),
m_columnSizes(numberOfBlockColumns),
m_numberOfBlockRows(numberOfBlockRows),
m_numberOfBlockColumns(numberOfBlockColumns),
{
m_data = Array<OneD, boost::shared_ptr<InnerType> >(m_storageSize, boost::shared_ptr<InnerType>());
Initialize(rowsPerBlock.data(), columnsPerBlock.data());
}
template<typename DataType , typename InnerMatrixType >
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NekMatrix ( const Array< OneD, const unsigned int > &  rowsPerBlock,
const Array< OneD, const unsigned int > &  columnsPerBlock,
MatrixStorage  type = eFULL 
)

Definition at line 119 of file BlockMatrix.cpp.

:
BaseType(std::accumulate(rowsPerBlock.begin(), rowsPerBlock.end(), 0),
std::accumulate(columnsPerBlock.begin(), columnsPerBlock.end(), 0)),
m_data(),
m_rowSizes(rowsPerBlock.num_elements()),
m_columnSizes(columnsPerBlock.num_elements()),
m_numberOfBlockRows(rowsPerBlock.num_elements()),
m_numberOfBlockColumns(columnsPerBlock.num_elements()),
{
m_data = Array<OneD, boost::shared_ptr<InnerType> >(m_storageSize, boost::shared_ptr<InnerType>());
Initialize(rowsPerBlock.data(), columnsPerBlock.data());
}
template<typename DataType , typename InnerMatrixType >
Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NekMatrix ( const ThisType rhs)

Member Function Documentation

template<typename DataType , typename InnerMatrixType >
NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::iterator Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::begin ( )

Definition at line 365 of file BlockMatrix.cpp.

References Nektar::iterator.

{ return iterator(*this, 0, 0); }
template<typename DataType , typename InnerMatrixType >
NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::const_iterator Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::begin ( ) const

Definition at line 371 of file BlockMatrix.cpp.

{ return const_iterator(*this, 0, 0); }
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::CalculateBlockIndex ( unsigned int  row,
unsigned int  column 
) const

Definition at line 162 of file BlockMatrix.cpp.

{
unsigned int blockRows = GetNumberOfBlockRows();
unsigned int blockCols = GetNumberOfBlockColumns();
if( this->GetTransposeFlag() == 'T' )
{
std::swap(blockRows, blockCols);
}
return BaseType::CalculateIndex(this->GetStorageType(),
row, column, blockRows, blockCols, this->GetTransposeFlag());
}
template<typename DataType , typename InnerMatrixType >
static ThisType Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::CreateWrapper ( const ThisType rhs)
static
template<typename DataType , typename InnerMatrixType >
static boost::shared_ptr<ThisType> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::CreateWrapper ( const boost::shared_ptr< ThisType > &  rhs)
static
template<typename DataType , typename InnerMatrixType >
NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::iterator Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::end ( )

Definition at line 368 of file BlockMatrix.cpp.

References Nektar::iterator.

{ return iterator(*this); }
template<typename DataType , typename InnerMatrixType >
NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::const_iterator Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::end ( ) const

Definition at line 374 of file BlockMatrix.cpp.

{ return const_iterator(*this); }
template<typename DataType , typename InnerMatrixType >
boost::shared_ptr< const typename NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::InnerType > Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetBlock ( unsigned int  row,
unsigned int  column 
) const

Definition at line 199 of file BlockMatrix.cpp.

References ASSERTL2.

{
ASSERTL2(row < m_numberOfBlockRows, std::string("Row ") + boost::lexical_cast<std::string>(row) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockRows) +
std::string(" rows"));
ASSERTL2(column < m_numberOfBlockColumns, std::string("Column ") + boost::lexical_cast<std::string>(column) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockColumns) +
std::string(" columns"));
int x = CalculateBlockIndex(row,column);
if (x < 0)
{
return boost::shared_ptr<const InnerType>();
}
else
{
return m_data[x];
}
}
template<typename DataType , typename InnerMatrixType >
boost::shared_ptr< typename NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::InnerType > & Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetBlock ( unsigned int  row,
unsigned int  column 
)

Definition at line 220 of file BlockMatrix.cpp.

References ASSERTL2.

{
ASSERTL2(row < m_numberOfBlockRows, std::string("Row ") + boost::lexical_cast<std::string>(row) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockRows) +
std::string(" rows"));
ASSERTL2(column < m_numberOfBlockColumns, std::string("Column ") + boost::lexical_cast<std::string>(column) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockColumns) +
std::string(" columns"));
int x = CalculateBlockIndex(row,column);
if (x == -1)
{
}
else
{
return m_data[x];
}
}
template<typename DataType , typename InnerMatrixType >
const NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::InnerType * Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetBlockPtr ( unsigned int  row,
unsigned int  column 
) const

Definition at line 178 of file BlockMatrix.cpp.

References ASSERTL2.

{
ASSERTL2(row < m_numberOfBlockRows, std::string("Row ") + boost::lexical_cast<std::string>(row) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockRows) +
std::string(" rows"));
ASSERTL2(column < m_numberOfBlockColumns, std::string("Column ") + boost::lexical_cast<std::string>(column) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockColumns) +
std::string(" columns"));
int x = CalculateBlockIndex(row,column);
if (x == -1)
{
return 0;
}
else
{
return m_data[x].get();
}
}
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetNumberOfBlockColumns ( ) const

Definition at line 326 of file BlockMatrix.cpp.

{
if( this->GetTransposeFlag() == 'N' )
{
}
else
{
}
}
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetNumberOfBlockRows ( ) const

Definition at line 313 of file BlockMatrix.cpp.

{
if( this->GetTransposeFlag() == 'N' )
{
}
else
{
}
}
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetNumberOfColumnsInBlockColumn ( unsigned int  blockCol) const

Definition at line 352 of file BlockMatrix.cpp.

template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetNumberOfElementsInBlock ( unsigned int  block,
unsigned int  totalBlocks,
const Array< OneD, unsigned int > &  sizes 
)
staticprivate

Definition at line 391 of file BlockMatrix.cpp.

References ASSERTL2.

{
ASSERTL2(block < totalBlocks, std::string("Block Element ") + boost::lexical_cast<std::string>(block) +
std::string(" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(totalBlocks) +
std::string(" blocks."));
if( block == 0 )
{
return sizes[block]+1;
}
else
{
return sizes[block] - sizes[block-1];
}
}
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetNumberOfRowsInBlockRow ( unsigned int  blockRow) const

Definition at line 339 of file BlockMatrix.cpp.

template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetRequiredStorageSize ( ) const

Definition at line 155 of file BlockMatrix.cpp.

{
return BaseType::GetRequiredStorageSize(this->GetStorageType(), this->GetNumberOfBlockRows(),
}
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetStorageSize ( ) const

Reimplemented from Nektar::ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType >.

Definition at line 301 of file BlockMatrix.cpp.

{
return m_storageSize;
}
template<typename DataType , typename InnerMatrixType >
MatrixStorage Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::GetType ( ) const

Definition at line 307 of file BlockMatrix.cpp.

{
return m_storageType;
}
template<typename DataType , typename InnerMatrixType >
void Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::Initialize ( const unsigned int *  rowsPerBlock,
const unsigned int *  columnsPerBlock 
)
private

Definition at line 407 of file BlockMatrix.cpp.

{
m_storageSize = this->GetRows()*this->GetColumns();
if (this->GetRows() > 0)
{
m_rowSizes[0] = rowsPerBlock[0] - 1;
for(unsigned int i = 1; i < m_numberOfBlockRows; ++i)
{
m_rowSizes[i] = rowsPerBlock[i] + m_rowSizes[i-1];
}
}
if (this->GetColumns() > 0)
{
m_columnSizes[0] = columnsPerBlock[0] - 1;
for(unsigned int i = 1; i < m_numberOfBlockColumns; ++i)
{
m_columnSizes[i] = columnsPerBlock[i] + m_columnSizes[i-1];
}
}
}
template<typename DataType , typename InnerMatrixType >
NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::ConstGetValueType Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::operator() ( unsigned int  row,
unsigned int  col 
) const

Reimplemented from Nektar::ConstMatrix< NekMatrix< DataType, InnerMatrixType >::NumberType >.

Definition at line 255 of file BlockMatrix.cpp.

References ASSERTL2.

{
ASSERTL2(row < this->GetRows(), std::string("Row ") + boost::lexical_cast<std::string>(row) +
std::string(" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(this->GetRows()) +
std::string(" rows"));
ASSERTL2(col < this->GetColumns(), std::string("Column ") + boost::lexical_cast<std::string>(col) +
std::string(" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(this->GetColumns()) +
std::string(" columns"));
const Array<OneD, unsigned int>* rowSizes = &m_rowSizes;
const Array<OneD, unsigned int>* columnSizes = &m_columnSizes;
if( this->GetTransposeFlag() == 'T' )
{
std::swap(rowSizes, columnSizes);
}
unsigned int blockRow = std::lower_bound(rowSizes->begin(), rowSizes->end(), row) - rowSizes->begin();
unsigned int blockColumn = std::lower_bound(columnSizes->begin(), columnSizes->end(), col) - columnSizes->begin();
const boost::shared_ptr<const InnerType> block = GetBlock(blockRow, blockColumn);
unsigned int actualRow = row;
if( blockRow > 0 )
{
actualRow = row-((*rowSizes)[blockRow-1])-1;
}
unsigned int actualCol = col;
if( blockColumn > 0 )
{
actualCol = col-((*columnSizes)[blockColumn-1])-1;
}
if( block )
{
return (*block)(actualRow, actualCol);
}
else
{
return m_zeroElement;
}
}
template<typename DataType , typename InnerMatrixType >
void Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::SetBlock ( unsigned int  row,
unsigned int  column,
boost::shared_ptr< InnerType > &  m 
)

Definition at line 240 of file BlockMatrix.cpp.

References ASSERTL2.

{
ASSERTL2(row < m_numberOfBlockRows, std::string("Row ") + boost::lexical_cast<std::string>(row) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockRows) +
std::string(" rows"));
ASSERTL2(column < m_numberOfBlockColumns, std::string("Column ") + boost::lexical_cast<std::string>(column) +
std::string(" requested in a block matrix with a maximum of ") + boost::lexical_cast<std::string>(m_numberOfBlockColumns) +
std::string(" columns"));
m_data[CalculateBlockIndex(row, column)] = InnerType::CreateWrapper(m);
}
template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::v_GetStorageSize ( ) const
privatevirtual

Definition at line 436 of file BlockMatrix.cpp.

{
return this->GetStorageSize();
}
template<typename DataType , typename InnerMatrixType >
MatrixStorage Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::v_GetStorageType ( ) const
privatevirtual

Definition at line 442 of file BlockMatrix.cpp.

{
return this->GetType();
}
template<typename DataType , typename InnerMatrixType >
boost::call_traits< typename NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NumberType >::value_type Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::v_GetValue ( unsigned int  row,
unsigned int  column 
) const
privatevirtual

Definition at line 430 of file BlockMatrix.cpp.

{
return (*this)(row, column);
}
template<typename DataType , typename InnerMatrixType >
void Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::v_Transpose ( )
privatevirtual

Definition at line 448 of file BlockMatrix.cpp.

{
BOOST_FOREACH(boost::shared_ptr<InnerType> ptr, m_data)
{
if( ptr.get() != 0 )
{
ptr->Transpose();
}
}
}

Member Data Documentation

template<typename DataType , typename InnerMatrixType >
Array<OneD, unsigned int> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_columnSizes
private

Definition at line 207 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
Array<OneD, boost::shared_ptr<InnerType> > Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_data
private

Definition at line 204 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
boost::shared_ptr<InnerType> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_nullBlockPtr
private

Definition at line 205 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_numberOfBlockColumns
private

Definition at line 210 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_numberOfBlockRows
private

Definition at line 209 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
Array<OneD, unsigned int> Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_rowSizes
private

Definition at line 206 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
unsigned int Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_storageSize
private

Definition at line 208 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
MatrixStorage Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_storageType
private

Definition at line 211 of file BlockMatrix.hpp.

template<typename DataType , typename InnerMatrixType >
NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::NumberType Nektar::NekMatrix< NekMatrix< DataType, InnerMatrixType >, BlockMatrixTag >::m_zeroElement
staticprivate

Definition at line 212 of file BlockMatrix.hpp.