diff --git a/src/TNL/Containers/Segments/CSR.h b/src/TNL/Containers/Segments/CSR.h index 3aa53e76cbda272ca828126e418fdc3fe43d069a..f86def78ed2f9e7cda6520e25be27181ae0accb0 100644 --- a/src/TNL/Containers/Segments/CSR.h +++ b/src/TNL/Containers/Segments/CSR.h @@ -19,7 +19,7 @@ namespace TNL { template< typename Device, typename Index > -class Segments +class CSR { public: @@ -29,29 +29,24 @@ class Segments CSR(); - CSR( const SizesHolder& sizes ); + CSR( const Vector< IndexType, DeviceType, IndexType >& sizes ); - CSR( const CSR& csr ); + CSR( const CSR& segments ); - CSR( const CSR&& csr ); - - /** - * \brief Set number of segments - */ - //void setSegmentsCount(); + CSR( const CSR&& segments ); /** * \brief Set sizes of particular segmenets. */ template< typename SizesHolder = OffsetsHolder > - void setSizes( const SizesHolder& sizes ) + void setSizes( const SizesHolder& sizes ); /** * \brief Number segments. */ - Index getSize() const; + IndexType getSize() const; - Index getStorageSize() const; + IndexType getStorageSize() const; IndexType getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; @@ -62,13 +57,13 @@ class Segments * function 'f' with arguments 'args' */ template< typename Function, typename... Args > - void forAll( Function& f, Args args ) const; + void forAll( Function& f, Args... args ) const; /*** * \brief Go over all segments and perform a reduction in each of them. */ template< typename Fetch, typename Reduction, typename ResultKeeper, typename... Args > - void segmentsReduction( Fetch& fetch, Reduction& reduction, ResultKeeper& keeper, Args args ); + void segmentsReduction( Fetch& fetch, Reduction& reduction, ResultKeeper& keeper, Args... args ); protected: @@ -80,4 +75,4 @@ class Segments } // namespace Conatiners } // namespace TNL -#include <TNL/Containers/Segments/CSR.h> \ No newline at end of file +#include <TNL/Containers/Segments/CSR.h> diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h index acca39bf4f36addde065190f7cad870c0c55157b..e266dc66db19ff67e44248a0565a481062989aab 100644 --- a/src/TNL/Matrices/SparseMatrix.h +++ b/src/TNL/Matrices/SparseMatrix.h @@ -10,19 +10,46 @@ #pragma once +#include <TNL/Matrices/Matrix.h> +#include <TNL/Allocators/Default.h> + namespace TNL { namespace Matrices { template< typename Real, - typename Organization > -class SparseMatrix : public Matrix< Real, typename Organization::Device, typename Organization::Index > + template< typename, typename > class Segments, + typename Device = Devices::Host, + typename Index = int, + typename RealAllocator = typename Allocators::Default< Device >::template Allocator< Real >, + typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index > > +class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > { public: using RealType = Real; - using OrganizationType = Organization; - using DeviceType = typename Organization::DeviceType; - using IndexType = typename Organization::IndexType; + template< typename Device_, typename Index_ > + using SegmentsTemplate = Segments< Device_, Index_ >; + using SegmentsType = Segments< Device, Index >; + using DeviceType = Device; + using IndexType = Index; + using RealAllocatorType = RealAllocator; + using IndexAllocatorType = IndexAllocator; + using CompressedRowLengthsVectorView = Containers::VectorView< IndexType, DeviceType, IndexType >; + using ConstCompressedRowLengthsVectorView = typename CompressedRowLengthsVectorView::ConstViewType; + using ValuesVectorType = typename Matrix< Real, Device, Index, RealAllocator >::ValuesVector; + using ColumnsVectorType = Containers::Vector< IndexType, DeviceType, IndexType, IndexAllocatorType >; + + SparseMatrix( const RealAllocatorType& realAllocator = RealAllocatorType(), + const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); + + SparseMatrix( const SparseMatrix& m ); + + SparseMatrix( const SparseMatrix&& m ); + + SparseMatrix( const IndexType rows, + const IndexType columns, + const RealAllocatorType& realAllocator = RealAllocatorType(), + const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); static String getSerializationType(); @@ -43,8 +70,10 @@ class SparseMatrix : public Matrix< Real, typename Organization::Device, typenam __cuda_callable__ IndexType getNonZeroRowLengthFast( const IndexType row ) const; - template< typename Real2, typename Device2, typename Index2 > - void setLike( const CSR< Real2, Device2, Index2 >& matrix ); + template< typename Real2, template< typename, typename > class Segments2, typename Device2, typename Index2, typename RealAllocator2, typename IndexAllocator2 > + void setLike( const SparseMatrix< Real2, Segments2, Device2, Index2, RealAllocator2, IndexAllocator2 >& matrix ); + + IndexType getNumberOfNonzeroMatrixElements() const; void reset(); @@ -106,11 +135,11 @@ class SparseMatrix : public Matrix< Real, typename Organization::Device, typenam IndexType* columns, RealType* values ) const; - __cuda_callable__ + /*__cuda_callable__ MatrixRow getRow( const IndexType rowIndex ); __cuda_callable__ - ConstMatrixRow getRow( const IndexType rowIndex ) const; + ConstMatrixRow getRow( const IndexType rowIndex ) const;*/ template< typename Vector > __cuda_callable__ @@ -123,14 +152,15 @@ class SparseMatrix : public Matrix< Real, typename Organization::Device, typenam OutVector& outVector ) const; // TODO: add const RealType& multiplicator = 1.0 ) - template< typename Real2, typename Index2 > - void addMatrix( const CSR< Real2, Device, Index2 >& matrix, + /*template< typename Real2, typename Index2 > + void addMatrix( const SparseMatrix< Real2, Segments, Device, Index2 >& matrix, const RealType& matrixMultiplicator = 1.0, const RealType& thisMatrixMultiplicator = 1.0 ); template< typename Real2, typename Index2 > - void getTransposition( const CSR< Real2, Device, Index2 >& matrix, + void getTransposition( const SparseMatrix< Real2, Segments, Device, Index2 >& matrix, const RealType& matrixMultiplicator = 1.0 ); + */ template< typename Vector1, typename Vector2 > bool performSORIteration( const Vector1& b, @@ -139,12 +169,16 @@ class SparseMatrix : public Matrix< Real, typename Organization::Device, typenam const RealType& omega = 1.0 ) const; // copy assignment - CSR& operator=( const CSR& matrix ); + SparseMatrix& operator=( const SparseMatrix& matrix ); // cross-device copy assignment - template< typename Real2, typename Device2, typename Index2, - typename = typename Enabler< Device2 >::type > - CSR& operator=( const CSR< Real2, Device2, Index2 >& matrix ); + template< typename Real2, + template< typename, typename > class Segments2, + typename Device2, + typename Index2, + typename RealAllocator2, + typename IndexAllocator2 > + SparseMatrix& operator=( const SparseMatrix< Real2, Segments2, Device2, Index2, RealAllocator2, IndexAllocator2 >& matrix ); void save( File& file ) const; @@ -155,9 +189,13 @@ class SparseMatrix : public Matrix< Real, typename Organization::Device, typenam void load( const String& fileName ); void print( std::ostream& str ) const; + + protected: - + ColumnsVectorType columnsVector; }; } // namespace Conatiners -} // namespace TNL \ No newline at end of file +} // namespace TNL + +#include <TNL/Matrices/SparseMatrix.hpp> diff --git a/src/TNL/Matrices/SparseMatrix.hpp b/src/TNL/Matrices/SparseMatrix.hpp index 2d11bb21e71b9b52db4c7e0a8d42642901c317fa..abfc1619dbb2aae26d9d4586b0f43dd3a8339a0e 100644 --- a/src/TNL/Matrices/SparseMatrix.hpp +++ b/src/TNL/Matrices/SparseMatrix.hpp @@ -10,211 +10,599 @@ #pragma once +#include <TNL/Matrices/SparseMatrix.h> + namespace TNL { namespace Matrices { -template< typename Real, - typename Organization > -static String getSerializationType(); - -template< typename Real, - typename Organization > -String getSerializationTypeVirtual() const; - -template< typename Real, - typename Organization > -void setDimensions( const IndexType rows, - const IndexType columns ); - -template< typename Real, - typename Organization > -void setCompressedRowLengths( ConstCompressedRowLengthsVectorView rowLengths ); - -template< typename Real, - typename Organization > -IndexType getRowLength( const IndexType row ) const; - -template< typename Real, - typename Organization > + template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +SparseMatrix( const RealAllocatorType& realAllocator, + const IndexAllocatorType& indexAllocator ) + : Matrix< Real, Device, Index, RealAllocator >( realAllocator ), columnsVector( indexAllocator ) +{ +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +SparseMatrix( const SparseMatrix& m ) + : Matrix< Real, Device, Index, RealAllocator >( m ), columnsVector( m.columnsVector ) +{ +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +SparseMatrix( const SparseMatrix&& m ) + : Matrix< Real, Device, Index, RealAllocator >( std::move( m ) ), columnsVector( std::move( m.columnsVector ) ) +{ +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +SparseMatrix( const IndexType rows, + const IndexType columns, + const RealAllocatorType& realAllocator, + const IndexAllocatorType& indexAllocator ) +: Matrix< Real, Device, Index, RealAllocator >( rows, columns, realAllocator ), columnsVector( indexAllocator ) +{ +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +String +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getSerializationType() +{ + return String( "Matrices::SparseMatrix< " ) + + TNL::getSerializationType< RealType >() + ", " + + TNL::getSerializationType< SegmentsType >() + ", [any_device], " + + TNL::getSerializationType< IndexType >() + ", [any_allocator] >"; +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +String +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getSerializationTypeVirtual() const +{ + return this->getSerializationType(); +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setDimensions( const IndexType rows, + const IndexType columns ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setCompressedRowLengths( ConstCompressedRowLengthsVectorView rowLengths ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +Index +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getRowLength( const IndexType row ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -IndexType getRowLengthFast( const IndexType row ) const; - -template< typename Real, - typename Organization > -IndexType getNonZeroRowLength( const IndexType row ) const; - -template< typename Real, - typename Organization > +Index +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getRowLengthFast( const IndexType row ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +Index +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getNonZeroRowLength( const IndexType row ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -IndexType getNonZeroRowLengthFast( const IndexType row ) const; - -template< typename Real, - typename Organization > -template< typename Real2, typename Device2, typename Index2 > -void setLike( const CSR< Real2, Device2, Index2 >& matrix ); - -template< typename Real, - typename Organization > -void reset(); - -template< typename Real, - typename Organization > +Index +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getNonZeroRowLengthFast( const IndexType row ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > + template< typename Real2, template< typename, typename > class Segments2, typename Device2, typename Index2, typename RealAllocator2, typename IndexAllocator2 > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setLike( const SparseMatrix< Real2, Segments2, Device2, Index2, RealAllocator2, IndexAllocator2 >& matrix ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +Index +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getNumberOfNonzeroMatrixElements() const +{ +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +reset() +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -bool setElementFast( const IndexType row, - const IndexType column, - const RealType& value ); - -template< typename Real, - typename Organization > -bool setElement( const IndexType row, - const IndexType column, - const RealType& value ); - -template< typename Real, - typename Organization > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setElementFast( const IndexType row, + const IndexType column, + const RealType& value ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setElement( const IndexType row, + const IndexType column, + const RealType& value ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -bool addElementFast( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); - -template< typename Real, - typename Organization > -bool addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); - - -template< typename Real, - typename Organization > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +addElementFast( const IndexType row, + const IndexType column, + const RealType& value, + const RealType& thisElementMultiplicator ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +addElement( const IndexType row, + const IndexType column, + const RealType& value, + const RealType& thisElementMultiplicator ) +{ + +} + + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -bool setRowFast( const IndexType row, - const IndexType* columnIndexes, - const RealType* values, - const IndexType elements ); - -template< typename Real, - typename Organization > -bool setRow( const IndexType row, - const IndexType* columnIndexes, - const RealType* values, - const IndexType elements ); - - -template< typename Real, - typename Organization > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setRowFast( const IndexType row, + const IndexType* columnIndexes, + const RealType* values, + const IndexType elements ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +setRow( const IndexType row, + const IndexType* columnIndexes, + const RealType* values, + const IndexType elements ) +{ + +} + + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -bool addRowFast( const IndexType row, - const IndexType* columns, - const RealType* values, - const IndexType numberOfElements, - const RealType& thisElementMultiplicator = 1.0 ); - -template< typename Real, - typename Organization > -bool addRow( const IndexType row, - const IndexType* columns, - const RealType* values, - const IndexType numberOfElements, - const RealType& thisElementMultiplicator = 1.0 ); - - -template< typename Real, - typename Organization > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +addRowFast( const IndexType row, + const IndexType* columns, + const RealType* values, + const IndexType numberOfElements, + const RealType& thisElementMultiplicator ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +addRow( const IndexType row, + const IndexType* columns, + const RealType* values, + const IndexType numberOfElements, + const RealType& thisElementMultiplicator ) +{ + +} + + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -RealType getElementFast( const IndexType row, - const IndexType column ) const; - -template< typename Real, - typename Organization > -RealType getElement( const IndexType row, - const IndexType column ) const; +Real +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getElementFast( const IndexType row, + const IndexType column ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +Real +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getElement( const IndexType row, + const IndexType column ) const +{ + +} __cuda_callable__ template< typename Real, - typename Organization > -void getRowFast( const IndexType row, - IndexType* columns, - RealType* values ) const; - -template< typename Real, - typename Organization > + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getRowFast( const IndexType row, + IndexType* columns, + RealType* values ) const +{ + +} + +/*template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -MatrixRow getRow( const IndexType rowIndex ); - -template< typename Real, - typename Organization > +MatrixRow +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getRow( const IndexType rowIndex ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > __cuda_callable__ -ConstMatrixRow getRow( const IndexType rowIndex ) const; - -template< typename Real, - typename Organization > -template< typename Vector > +ConstMatrixRow +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getRow( const IndexType rowIndex ) const +{ + +}*/ + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > + template< typename Vector > __cuda_callable__ -typename Vector::RealType rowVectorProduct( const IndexType row, - const Vector& vector ) const; - -template< typename Real, - typename Organization > +typename Vector::RealType +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +rowVectorProduct( const IndexType row, + const Vector& vector ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > template< typename InVector, typename OutVector > -void vectorProduct( const InVector& inVector, - OutVector& outVector ) const; +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +vectorProduct( const InVector& inVector, + OutVector& outVector ) const // TODO: add const RealType& multiplicator = 1.0 ) - -template< typename Real, - typename Organization > -template< typename Real2, typename Index2 > -void addMatrix( const CSR< Real2, Device, Index2 >& matrix, - const RealType& matrixMultiplicator = 1.0, - const RealType& thisMatrixMultiplicator = 1.0 ); - -template< typename Real, - typename Organization > +{ + +} + +/*template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +template< typename Real2, template< typename, typename > class Segments2, typename Index2, typename RealAllocator2, typename IndexAllocator2 > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +addMatrix( const SparseMatrix< Real2, Segments2, Device, Index2, RealAllocator2, IndexAllocator2 >& matrix, + const RealType& matrixMultiplicator, + const RealType& thisMatrixMultiplicator ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > template< typename Real2, typename Index2 > -void getTransposition( const CSR< Real2, Device, Index2 >& matrix, - const RealType& matrixMultiplicator = 1.0 ); - -template< typename Real, - typename Organization > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +getTransposition( const SparseMatrix< Real2, Device, Index2 >& matrix, + const RealType& matrixMultiplicator ) +{ + +}*/ + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > template< typename Vector1, typename Vector2 > -bool performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; +bool +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +performSORIteration( const Vector1& b, + const IndexType row, + Vector2& x, + const RealType& omega ) const +{ + +} // copy assignment template< typename Real, - typename Organization > -CSR& operator=( const CSR& matrix ); + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >& +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +operator=( const SparseMatrix& matrix ) +{ + +} // cross-device copy assignment template< typename Real, - typename Organization > -template< typename Real2, typename Device2, typename Index2, - typename = typename Enabler< Device2 >::type > -CSR& operator=( const CSR< Real2, Device2, Index2 >& matrix ); - -template< typename Real, - typename Organization > -void save( File& file ) const; - -template< typename Real, - typename Organization > -void load( File& file ); - -template< typename Real, - typename Organization > -void save( const String& fileName ) const; - -template< typename Real, - typename Organization > -void load( const String& fileName ); - -template< typename Real, - typename Organization > -void print( std::ostream& str ) const; + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > + template< typename Real2, + template< typename, typename > class Segments2, + typename Device2, + typename Index2, + typename RealAllocator2, + typename IndexAllocator2 > +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >& +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +operator=( const SparseMatrix< Real2, Segments2, Device2, Index2, RealAllocator2, IndexAllocator2 >& matrix ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +save( File& file ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +load( File& file ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +save( const String& fileName ) const +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +load( const String& fileName ) +{ + +} + +template< typename Real, + template< typename, typename > class Segments, + typename Device, + typename Index, + typename RealAllocator, + typename IndexAllocator > +void +SparseMatrix< Real, Segments, Device, Index, RealAllocator, IndexAllocator >:: +print( std::ostream& str ) const +{ + +} } //namespace Matrices