Loading src/implementation/core/arrays/tnlArray_impl.h +4 −2 Original line number Diff line number Diff line Loading @@ -418,10 +418,12 @@ ostream& operator << ( ostream& str, const tnlArray< Element, Device, Index >& v #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlArray< float, tnlHost, int >; // TODO: this does not work with CUDA 5.5 - fix it later /*extern template class tnlArray< float, tnlHost, int >; extern template class tnlArray< double, tnlHost, int >; extern template class tnlArray< float, tnlHost, long int >; extern template class tnlArray< double, tnlHost, long int >; extern template class tnlArray< double, tnlHost, long int >;*/ #ifdef HAVE_CUDA /*extern template class tnlArray< float, tnlCuda, int >; Loading src/implementation/matrices/tnlCSRMatrix_impl.h +41 −21 Original line number Diff line number Diff line Loading @@ -149,6 +149,16 @@ bool tnlCSRMatrix< Real, Device, Index >::operator != ( const tnlCSRMatrix< Real return ! ( ( *this ) == matrix ); } template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index >::setElementFast( const IndexType row, const IndexType column, const Real& value ) { return this->addElementFast( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > Loading @@ -156,13 +166,14 @@ bool tnlCSRMatrix< Real, Device, Index >::setElement( const IndexType row, const IndexType column, const Real& value ) { return this->addElement( row, column, value, 0.0 ); return this->addElementFast( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index >::addElement( const IndexType row, bool tnlCSRMatrix< Real, Device, Index >::addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) Loading Loading @@ -210,7 +221,7 @@ bool tnlCSRMatrix< Real, Device, Index >::addElement( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index > :: setRow( const IndexType row, bool tnlCSRMatrix< Real, Device, Index > :: setRowFast( const IndexType row, const IndexType* columnIndexes, const RealType* values, const IndexType elements ) Loading @@ -234,7 +245,7 @@ bool tnlCSRMatrix< Real, Device, Index > :: setRow( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index > :: addRow( const IndexType row, bool tnlCSRMatrix< Real, Device, Index > :: addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType numberOfElements, Loading @@ -247,7 +258,7 @@ bool tnlCSRMatrix< Real, Device, Index > :: addRow( const IndexType row, template< typename Real, typename Device, typename Index > Real tnlCSRMatrix< Real, Device, Index >::getElement( const IndexType row, Real tnlCSRMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { IndexType elementPtr = this->rowPointers[ row ]; Loading @@ -262,7 +273,16 @@ Real tnlCSRMatrix< Real, Device, Index >::getElement( const IndexType row, template< typename Real, typename Device, typename Index > void tnlCSRMatrix< Real, Device, Index >::getRow( const IndexType row, Real tnlCSRMatrix< Real, Device, Index >::getElement( const IndexType row, const IndexType column ) const { return this->getElementFast( row, column ); } template< typename Real, typename Device, typename Index > void tnlCSRMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { Loading src/implementation/matrices/tnlChunkedEllpackMatrix_impl.h +40 −20 Original line number Diff line number Diff line Loading @@ -296,6 +296,16 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::operator != ( const tnlChun return ! ( ( *this ) == matrix ); } template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index >::setElementFast( const IndexType row, const IndexType column, const Real& value ) { return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > Loading @@ -306,10 +316,11 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::setElement( const IndexType return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index >::addElement( const IndexType row, bool tnlChunkedEllpackMatrix< Real, Device, Index >::addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) Loading Loading @@ -366,7 +377,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::addElement( const IndexType template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index > :: setRow( const IndexType row, bool tnlChunkedEllpackMatrix< Real, Device, Index > :: setRowFast( const IndexType row, const IndexType* columnIndexes, const RealType* values, const IndexType elements ) Loading Loading @@ -394,7 +405,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index > :: setRow( const IndexType r template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index > :: addRow( const IndexType row, bool tnlChunkedEllpackMatrix< Real, Device, Index > :: addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType numberOfElements, Loading @@ -407,7 +418,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index > :: addRow( const IndexType r template< typename Real, typename Device, typename Index > Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { const IndexType& sliceIndex = slicesToRowsMapping[ row ]; Loading @@ -427,7 +438,16 @@ Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElement( const IndexType template< typename Real, typename Device, typename Index > void tnlChunkedEllpackMatrix< Real, Device, Index >::getRow( const IndexType row, Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, const IndexType column ) const { return this->getElementFast( row, column ); } template< typename Real, typename Device, typename Index > void tnlChunkedEllpackMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { Loading src/implementation/matrices/tnlDenseMatrix_impl.h +98 −7 Original line number Diff line number Diff line Loading @@ -117,6 +117,17 @@ void tnlDenseMatrix< Real, Device, Index >::reset() this->values.reset(); } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::setElementFast( const IndexType row, const IndexType column, const RealType& value ) { this->values.operator[]( this->getElementIndex( row, column ) ) = value; return true; } template< typename Real, typename Device, typename Index > Loading @@ -128,6 +139,23 @@ bool tnlDenseMatrix< Real, Device, Index >::setElement( const IndexType row, return true; } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) { const IndexType elementIndex = this->getElementIndex( row, column ); if( thisElementMultiplicator == 1.0 ) this->values.operator[]( elementIndex ) += value; else this->values.operator[]( elementIndex ) = thisElementMultiplicator * this->values.operator[]( elementIndex ) + value; } template< typename Real, typename Device, typename Index > Loading @@ -138,10 +166,29 @@ bool tnlDenseMatrix< Real, Device, Index >::addElement( const IndexType row, { const IndexType elementIndex = this->getElementIndex( row, column ); if( thisElementMultiplicator == 1.0 ) values->operator[]( elementIndex ) += value; this->values.setElement( elementIndex, this->values.getElement( elementIndex ) + value ); else values->operator[]( elementIndex ) = thisElementMultiplicator * values->operator[]( elementIndex ) + value; this->values.setElement( elementIndex, thisElementMultiplicator * this->values.getElement( elementIndex ) + value ); } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::setRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType elements ) { tnlAssert( elements <= this->getColumns(), cerr << " elements = " << elements << " this->columns = " << this->getColumns() << " this->getName() = " << this->getName() ); for( IndexType i = 0; i < elements; i++ ) this->setElementFast( row, columns[ i ], values[ i ] ); return true; } template< typename Real, Loading @@ -152,12 +199,31 @@ bool tnlDenseMatrix< Real, Device, Index >::setRow( const IndexType row, const RealType* values, const IndexType elements ) { tnlAssert( elements <= this->getDimensions().y(), tnlAssert( elements <= this->getColumns(), cerr << " elements = " << elements << " this->columns = " << this->getDimensions().y() << " this->columns = " << this->getColumns() << " this->getName() = " << this->getName() ); for( IndexType i = 0; i < elements; i++ ) this->operator()( row, columns[ i ] ) = values[ i ]; this->setElement( row, columns[ i ], values[ i ] ); return true; } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType elements, const RealType& thisRowMultiplicator ) { tnlAssert( elements <= this->columns, cerr << " elements = " << elements << " this->columns = " << this->columns << " this->getName() = " << this->getName() ); for( IndexType i = 0; i < elements; i++ ) this->setElementFast( row, columns[ i ], thisRowMultiplicator * this->getElementFast( row, columns[ i ] ) + values[ i ] ); return true; } Loading @@ -180,6 +246,16 @@ bool tnlDenseMatrix< Real, Device, Index >::addRow( const IndexType row, return true; } template< typename Real, typename Device, typename Index > Real tnlDenseMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { return this->values.operator[]( this->getElementIndex( row, column ) ); } template< typename Real, typename Device, typename Index > Loading @@ -189,6 +265,20 @@ Real tnlDenseMatrix< Real, Device, Index >::getElement( const IndexType row, return this->values.getElement( this->getElementIndex( row, column ) ); } template< typename Real, typename Device, typename Index > void tnlDenseMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { for( IndexType i = 0; i < this->getColumns(); i++ ) { columns[ i ] = i; values[ i ] = this->getElementFast( row, i ); } } template< typename Real, typename Device, typename Index > Loading @@ -203,6 +293,7 @@ void tnlDenseMatrix< Real, Device, Index >::getRow( const IndexType row, } } template< typename Real, typename Device, typename Index > Loading src/implementation/matrices/tnlEllpackMatrix_impl.h +39 −18 Original line number Diff line number Diff line Loading @@ -155,6 +155,16 @@ bool tnlEllpackMatrix< Real, Device, Index >::operator != ( const tnlEllpackMatr return ! ( ( *this ) == matrix ); } template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: setElementFast( const IndexType row, const IndexType column, const Real& value ) { return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > Loading @@ -165,10 +175,11 @@ bool tnlEllpackMatrix< Real, Device, Index > :: setElement( const IndexType row, return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: addElement( const IndexType row, bool tnlEllpackMatrix< Real, Device, Index > :: addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) Loading Loading @@ -215,7 +226,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: addElement( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: setRow( const IndexType row, bool tnlEllpackMatrix< Real, Device, Index > :: setRowFast( const IndexType row, const IndexType* columnIndexes, const RealType* values, const IndexType elements ) Loading @@ -237,7 +248,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: setRow( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: addRow( const IndexType row, bool tnlEllpackMatrix< Real, Device, Index > :: addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType numberOfElements, Loading @@ -250,7 +261,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: addRow( const IndexType row, template< typename Real, typename Device, typename Index > Real tnlEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, Real tnlEllpackMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { IndexType elementPtr( row * this->rowLengths ); Loading @@ -264,7 +275,17 @@ Real tnlEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, template< typename Real, typename Device, typename Index > void tnlEllpackMatrix< Real, Device, Index >::getRow( const IndexType row, Real tnlEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, const IndexType column ) const { return this->getElementFast( row, column ); } template< typename Real, typename Device, typename Index > void tnlEllpackMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { Loading Loading
src/implementation/core/arrays/tnlArray_impl.h +4 −2 Original line number Diff line number Diff line Loading @@ -418,10 +418,12 @@ ostream& operator << ( ostream& str, const tnlArray< Element, Device, Index >& v #ifdef TEMPLATE_EXPLICIT_INSTANTIATION extern template class tnlArray< float, tnlHost, int >; // TODO: this does not work with CUDA 5.5 - fix it later /*extern template class tnlArray< float, tnlHost, int >; extern template class tnlArray< double, tnlHost, int >; extern template class tnlArray< float, tnlHost, long int >; extern template class tnlArray< double, tnlHost, long int >; extern template class tnlArray< double, tnlHost, long int >;*/ #ifdef HAVE_CUDA /*extern template class tnlArray< float, tnlCuda, int >; Loading
src/implementation/matrices/tnlCSRMatrix_impl.h +41 −21 Original line number Diff line number Diff line Loading @@ -149,6 +149,16 @@ bool tnlCSRMatrix< Real, Device, Index >::operator != ( const tnlCSRMatrix< Real return ! ( ( *this ) == matrix ); } template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index >::setElementFast( const IndexType row, const IndexType column, const Real& value ) { return this->addElementFast( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > Loading @@ -156,13 +166,14 @@ bool tnlCSRMatrix< Real, Device, Index >::setElement( const IndexType row, const IndexType column, const Real& value ) { return this->addElement( row, column, value, 0.0 ); return this->addElementFast( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index >::addElement( const IndexType row, bool tnlCSRMatrix< Real, Device, Index >::addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) Loading Loading @@ -210,7 +221,7 @@ bool tnlCSRMatrix< Real, Device, Index >::addElement( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index > :: setRow( const IndexType row, bool tnlCSRMatrix< Real, Device, Index > :: setRowFast( const IndexType row, const IndexType* columnIndexes, const RealType* values, const IndexType elements ) Loading @@ -234,7 +245,7 @@ bool tnlCSRMatrix< Real, Device, Index > :: setRow( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlCSRMatrix< Real, Device, Index > :: addRow( const IndexType row, bool tnlCSRMatrix< Real, Device, Index > :: addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType numberOfElements, Loading @@ -247,7 +258,7 @@ bool tnlCSRMatrix< Real, Device, Index > :: addRow( const IndexType row, template< typename Real, typename Device, typename Index > Real tnlCSRMatrix< Real, Device, Index >::getElement( const IndexType row, Real tnlCSRMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { IndexType elementPtr = this->rowPointers[ row ]; Loading @@ -262,7 +273,16 @@ Real tnlCSRMatrix< Real, Device, Index >::getElement( const IndexType row, template< typename Real, typename Device, typename Index > void tnlCSRMatrix< Real, Device, Index >::getRow( const IndexType row, Real tnlCSRMatrix< Real, Device, Index >::getElement( const IndexType row, const IndexType column ) const { return this->getElementFast( row, column ); } template< typename Real, typename Device, typename Index > void tnlCSRMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { Loading
src/implementation/matrices/tnlChunkedEllpackMatrix_impl.h +40 −20 Original line number Diff line number Diff line Loading @@ -296,6 +296,16 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::operator != ( const tnlChun return ! ( ( *this ) == matrix ); } template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index >::setElementFast( const IndexType row, const IndexType column, const Real& value ) { return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > Loading @@ -306,10 +316,11 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::setElement( const IndexType return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index >::addElement( const IndexType row, bool tnlChunkedEllpackMatrix< Real, Device, Index >::addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) Loading Loading @@ -366,7 +377,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::addElement( const IndexType template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index > :: setRow( const IndexType row, bool tnlChunkedEllpackMatrix< Real, Device, Index > :: setRowFast( const IndexType row, const IndexType* columnIndexes, const RealType* values, const IndexType elements ) Loading Loading @@ -394,7 +405,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index > :: setRow( const IndexType r template< typename Real, typename Device, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index > :: addRow( const IndexType row, bool tnlChunkedEllpackMatrix< Real, Device, Index > :: addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType numberOfElements, Loading @@ -407,7 +418,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index > :: addRow( const IndexType r template< typename Real, typename Device, typename Index > Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { const IndexType& sliceIndex = slicesToRowsMapping[ row ]; Loading @@ -427,7 +438,16 @@ Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElement( const IndexType template< typename Real, typename Device, typename Index > void tnlChunkedEllpackMatrix< Real, Device, Index >::getRow( const IndexType row, Real tnlChunkedEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, const IndexType column ) const { return this->getElementFast( row, column ); } template< typename Real, typename Device, typename Index > void tnlChunkedEllpackMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { Loading
src/implementation/matrices/tnlDenseMatrix_impl.h +98 −7 Original line number Diff line number Diff line Loading @@ -117,6 +117,17 @@ void tnlDenseMatrix< Real, Device, Index >::reset() this->values.reset(); } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::setElementFast( const IndexType row, const IndexType column, const RealType& value ) { this->values.operator[]( this->getElementIndex( row, column ) ) = value; return true; } template< typename Real, typename Device, typename Index > Loading @@ -128,6 +139,23 @@ bool tnlDenseMatrix< Real, Device, Index >::setElement( const IndexType row, return true; } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) { const IndexType elementIndex = this->getElementIndex( row, column ); if( thisElementMultiplicator == 1.0 ) this->values.operator[]( elementIndex ) += value; else this->values.operator[]( elementIndex ) = thisElementMultiplicator * this->values.operator[]( elementIndex ) + value; } template< typename Real, typename Device, typename Index > Loading @@ -138,10 +166,29 @@ bool tnlDenseMatrix< Real, Device, Index >::addElement( const IndexType row, { const IndexType elementIndex = this->getElementIndex( row, column ); if( thisElementMultiplicator == 1.0 ) values->operator[]( elementIndex ) += value; this->values.setElement( elementIndex, this->values.getElement( elementIndex ) + value ); else values->operator[]( elementIndex ) = thisElementMultiplicator * values->operator[]( elementIndex ) + value; this->values.setElement( elementIndex, thisElementMultiplicator * this->values.getElement( elementIndex ) + value ); } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::setRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType elements ) { tnlAssert( elements <= this->getColumns(), cerr << " elements = " << elements << " this->columns = " << this->getColumns() << " this->getName() = " << this->getName() ); for( IndexType i = 0; i < elements; i++ ) this->setElementFast( row, columns[ i ], values[ i ] ); return true; } template< typename Real, Loading @@ -152,12 +199,31 @@ bool tnlDenseMatrix< Real, Device, Index >::setRow( const IndexType row, const RealType* values, const IndexType elements ) { tnlAssert( elements <= this->getDimensions().y(), tnlAssert( elements <= this->getColumns(), cerr << " elements = " << elements << " this->columns = " << this->getDimensions().y() << " this->columns = " << this->getColumns() << " this->getName() = " << this->getName() ); for( IndexType i = 0; i < elements; i++ ) this->operator()( row, columns[ i ] ) = values[ i ]; this->setElement( row, columns[ i ], values[ i ] ); return true; } template< typename Real, typename Device, typename Index > bool tnlDenseMatrix< Real, Device, Index >::addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType elements, const RealType& thisRowMultiplicator ) { tnlAssert( elements <= this->columns, cerr << " elements = " << elements << " this->columns = " << this->columns << " this->getName() = " << this->getName() ); for( IndexType i = 0; i < elements; i++ ) this->setElementFast( row, columns[ i ], thisRowMultiplicator * this->getElementFast( row, columns[ i ] ) + values[ i ] ); return true; } Loading @@ -180,6 +246,16 @@ bool tnlDenseMatrix< Real, Device, Index >::addRow( const IndexType row, return true; } template< typename Real, typename Device, typename Index > Real tnlDenseMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { return this->values.operator[]( this->getElementIndex( row, column ) ); } template< typename Real, typename Device, typename Index > Loading @@ -189,6 +265,20 @@ Real tnlDenseMatrix< Real, Device, Index >::getElement( const IndexType row, return this->values.getElement( this->getElementIndex( row, column ) ); } template< typename Real, typename Device, typename Index > void tnlDenseMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { for( IndexType i = 0; i < this->getColumns(); i++ ) { columns[ i ] = i; values[ i ] = this->getElementFast( row, i ); } } template< typename Real, typename Device, typename Index > Loading @@ -203,6 +293,7 @@ void tnlDenseMatrix< Real, Device, Index >::getRow( const IndexType row, } } template< typename Real, typename Device, typename Index > Loading
src/implementation/matrices/tnlEllpackMatrix_impl.h +39 −18 Original line number Diff line number Diff line Loading @@ -155,6 +155,16 @@ bool tnlEllpackMatrix< Real, Device, Index >::operator != ( const tnlEllpackMatr return ! ( ( *this ) == matrix ); } template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: setElementFast( const IndexType row, const IndexType column, const Real& value ) { return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > Loading @@ -165,10 +175,11 @@ bool tnlEllpackMatrix< Real, Device, Index > :: setElement( const IndexType row, return this->addElement( row, column, value, 0.0 ); } template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: addElement( const IndexType row, bool tnlEllpackMatrix< Real, Device, Index > :: addElementFast( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ) Loading Loading @@ -215,7 +226,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: addElement( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: setRow( const IndexType row, bool tnlEllpackMatrix< Real, Device, Index > :: setRowFast( const IndexType row, const IndexType* columnIndexes, const RealType* values, const IndexType elements ) Loading @@ -237,7 +248,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: setRow( const IndexType row, template< typename Real, typename Device, typename Index > bool tnlEllpackMatrix< Real, Device, Index > :: addRow( const IndexType row, bool tnlEllpackMatrix< Real, Device, Index > :: addRowFast( const IndexType row, const IndexType* columns, const RealType* values, const IndexType numberOfElements, Loading @@ -250,7 +261,7 @@ bool tnlEllpackMatrix< Real, Device, Index > :: addRow( const IndexType row, template< typename Real, typename Device, typename Index > Real tnlEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, Real tnlEllpackMatrix< Real, Device, Index >::getElementFast( const IndexType row, const IndexType column ) const { IndexType elementPtr( row * this->rowLengths ); Loading @@ -264,7 +275,17 @@ Real tnlEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, template< typename Real, typename Device, typename Index > void tnlEllpackMatrix< Real, Device, Index >::getRow( const IndexType row, Real tnlEllpackMatrix< Real, Device, Index >::getElement( const IndexType row, const IndexType column ) const { return this->getElementFast( row, column ); } template< typename Real, typename Device, typename Index > void tnlEllpackMatrix< Real, Device, Index >::getRowFast( const IndexType row, IndexType* columns, RealType* values ) const { Loading