Skip to content
Snippets Groups Projects
Commit 4a70c74f authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Added matrix values holder.

parent 888869bd
No related branches found
No related tags found
1 merge request!48Segments
......@@ -36,8 +36,8 @@ class Dense : public Matrix< Real, Device, Index >
using IndexType = Index;
using RealAllocatorType = RealAllocator;
using BaseType = Matrix< Real, Device, Index, RealAllocator >;
using ValuesType = typename BaseType::ValuesVector;
using ValuesViewType = typename ValuesType::ViewType;
using ValuesHolderType = typename BaseType::ValuesHolderType;
using ValuesViewType = typename ValuesHolderType::ViewType;
using SegmentsType = Containers::Segments::Ellpack< DeviceType, IndexType, typename Allocators::Default< Device >::template Allocator< IndexType >, RowMajorOrder, 1 >;
using SegmentViewType = typename SegmentsType::SegmentViewType;
using ViewType = DenseMatrixView< Real, Device, Index, RowMajorOrder >;
......
......@@ -39,8 +39,8 @@ class DenseMatrixView : public MatrixView< Real, Device, Index >
using DeviceType = Device;
using IndexType = Index;
using BaseType = Matrix< Real, Device, Index >;
using ValuesType = typename BaseType::ValuesVector;
using ValuesViewType = typename ValuesType::ViewType;
using ValuesHolderType = typename BaseType::ValuesHolderType;
using ValuesViewType = typename ValuesHolderType::ViewType;
using SegmentsType = Containers::Segments::Ellpack< DeviceType, IndexType, typename Allocators::Default< Device >::template Allocator< IndexType >, RowMajorOrder, 1 >;
using SegmentsViewType = typename SegmentsType::ViewType;
using SegmentViewType = typename SegmentsType::SegmentViewType;
......
......@@ -35,8 +35,8 @@ class Multidiagonal : public Matrix< Real, Device, Index, RealAllocator >
using RealAllocatorType = RealAllocator;
using IndexAllocatorType = IndexAllocator;
using BaseType = Matrix< Real, Device, Index, RealAllocator >;
using ValuesType = typename BaseType::ValuesVector;
using ValuesViewType = typename ValuesType::ViewType;
using ValuesHolderType = typename BaseType::ValuesHolderType;
using ValuesViewType = typename ValuesHolderType::ViewType;
using IndexerType = details::MultidiagonalMatrixIndexer< IndexType, RowMajorOrder >;
using DiagonalsShiftsType = Containers::Vector< IndexType, DeviceType, IndexType, IndexAllocatorType >;
using DiagonalsShiftsView = typename DiagonalsShiftsType::ViewType;
......
......@@ -46,8 +46,8 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator >
using RowsCapacitiesType = Containers::Vector< IndexType, DeviceType, IndexType, IndexAllocatorType >;
using RowsCapacitiesView = Containers::VectorView< IndexType, DeviceType, IndexType >;
using ConstRowsCapacitiesView = typename RowsCapacitiesView::ConstViewType;
using ValuesVectorType = typename Matrix< Real, Device, Index, RealAllocator >::ValuesVector;
using ValuesViewType = typename ValuesVectorType::ViewType;
using ValuesHolderType = typename Matrix< Real, Device, Index, RealAllocator >::ValuesHolderType;
using ValuesViewType = typename ValuesHolderType::ViewType;
using ColumnsIndexesVectorType = Containers::Vector< IndexType, DeviceType, IndexType, IndexAllocatorType >;
using ColumnsIndexesViewType = typename ColumnsIndexesVectorType::ViewType;
using ViewType = SparseMatrixView< Real, Device, Index, MatrixType, SegmentsViewTemplate >;
......
......@@ -34,8 +34,8 @@ class Tridiagonal : public Matrix< Real, Device, Index, RealAllocator >
using RealAllocatorType = RealAllocator;
using BaseType = Matrix< Real, Device, Index, RealAllocator >;
using IndexerType = details::TridiagonalMatrixIndexer< IndexType, RowMajorOrder >;
using ValuesType = typename BaseType::ValuesVector;
using ValuesViewType = typename ValuesType::ViewType;
using ValuesHolderType = typename BaseType::ValuesHolderType;
using ValuesViewType = typename ValuesHolderType::ViewType;
using ViewType = TridiagonalMatrixView< Real, Device, Index, RowMajorOrder >;
using ConstViewType = TridiagonalMatrixView< typename std::add_const< Real >::type, Device, Index, RowMajorOrder >;
using RowView = TridiagonalMatrixRowView< ValuesViewType, IndexerType >;
......
......@@ -14,13 +14,54 @@ namespace TNL {
namespace Matrices {
namespace details {
template< typename Real,
typename Device,
typename Index >
struct ValuesHolderView
: public Containers::VectorView< Real, Device, Index >
{
using RealType = Real;
using DeviceType = Device;
using IndexType = Index;
using Containers::VectorView< Real, Device, Index >::VectorView;
using Containers::VectorView< Real, Device, Index >::operator=;
/*__cuda_callable__
ValuesHolderView() = default;
__cuda_callable__
explicit ValuesHolderView( const ValuesHolderView& ) = default;
__cuda_callable__
ValuesHolderView( ValuesHolderView&& ) = default;*/
};
template< typename Real,
typename Device,
typename Index,
typename RealAllocator >
class ValuesHolder
: public Containers::Vector< Real, Device, Index, RealAllocator >
{};
typename Allocator >
struct ValuesHolder
: public Containers::Vector< Real, Device, Index, Allocator >
{
using RealType = Real;
using DeviceType = Device;
using IndexType = Index;
using AllocatorType = Allocator;
using ViewType = ValuesHolderView< Real, Device, Index >;
using Containers::Vector< Real, Device, Index, Allocator >::Vector;
using Containers::Vector< Real, Device, Index, Allocator >::operator=;
/*ValuesHolder() = default;
explicit ValuesHolder( const ValuesHolder& ) = default;
explicit ValuesHolder( const ValuesHolder& vector, const AllocatorType& allocator );
ValuesHolder( ValuesHolder&& ) = default;*/
};
template< typename Device,
typename Index >
......@@ -31,6 +72,7 @@ class BooleanValuesHolder
using RealType = bool;
using DeviceType = Device;
using IndexType = Index;
using ViewType = BooleanValuesHolder;
BooleanValuesHolder()
: size( 0 ){};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment