From 55341d35b8e67f418868e15d780cd2f8f636fdcd Mon Sep 17 00:00:00 2001
From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
Date: Wed, 8 Jan 2020 17:06:01 +0100
Subject: [PATCH] Fixing serialization type of dense matrix.

---
 src/TNL/Matrices/Dense.h                      |  4 ++--
 src/TNL/Matrices/Dense.hpp                    | 20 +++++++++----------
 src/TNL/Matrices/DenseMatrixView.hpp          | 14 ++++++-------
 .../{Tridiagonal_impl.h => Tridiagonal.hpp}   |  0
 4 files changed, 19 insertions(+), 19 deletions(-)
 rename src/TNL/Matrices/{Tridiagonal_impl.h => Tridiagonal.hpp} (100%)

diff --git a/src/TNL/Matrices/Dense.h b/src/TNL/Matrices/Dense.h
index 9c05297d15..778fd0bd4a 100644
--- a/src/TNL/Matrices/Dense.h
+++ b/src/TNL/Matrices/Dense.h
@@ -56,7 +56,7 @@ class Dense : public Matrix< Real, Device, Index >
       Dense();
 
       Dense( const IndexType rows, const IndexType columns );
-      
+
       ViewType getView();
 
       ConstViewType getConstView() const;
@@ -179,7 +179,7 @@ class Dense : public Matrix< Real, Device, Index >
 
       template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ >
       bool operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const;
-      
+
       void save( const String& fileName ) const;
 
       void load( const String& fileName );
diff --git a/src/TNL/Matrices/Dense.hpp b/src/TNL/Matrices/Dense.hpp
index 7a6c4becc3..49e218c779 100644
--- a/src/TNL/Matrices/Dense.hpp
+++ b/src/TNL/Matrices/Dense.hpp
@@ -15,7 +15,7 @@
 #include <TNL/Exceptions/NotImplementedError.h>
 
 namespace TNL {
-namespace Matrices {   
+namespace Matrices {
 
 template< typename Real,
           typename Device,
@@ -46,7 +46,7 @@ auto
 Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
 getView() -> ViewType
 {
-   return ViewType( this->getRows(), 
+   return ViewType( this->getRows(),
                     this->getColumns(),
                     this->getValues().getView(),
                     this->segments.getView() );
@@ -77,9 +77,9 @@ Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
 getSerializationType()
 {
    return String( "Matrices::Dense< " ) +
-          getType< RealType >() + ", " +
-          getType< Device >() + ", " +
-          getType< IndexType >() + " >";
+          TNL::getSerializationType< RealType >() + ", [any_device], " +
+          TNL::getSerializationType< IndexType >() +
+          ( RowMajorOrder ? "true" : "false" ) + ", [any_allocator] >";
 }
 
 template< typename Real,
@@ -99,7 +99,7 @@ template< typename Real,
           typename Index,
           bool RowMajorOrder,
           typename RealAllocator >
-void 
+void
 Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
 setDimensions( const IndexType rows,
                const IndexType columns )
@@ -128,7 +128,7 @@ template< typename Real,
           typename Index,
           bool RowMajorOrder,
           typename RealAllocator >
-void 
+void
 Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
 setCompressedRowLengths( ConstCompressedRowLengthsVectorView rowLengths )
 {
@@ -322,7 +322,7 @@ template< typename Real,
           typename Index,
           bool RowMajorOrder,
           typename RealAllocator >
-Real 
+Real
 Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
 getElement( const IndexType row,
             const IndexType column ) const
@@ -447,7 +447,7 @@ template< typename Real,
           typename RealAllocator >
    template< typename InVector,
              typename OutVector >
-void 
+void
 Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
 vectorProduct( const InVector& inVector, OutVector& outVector ) const
 {
@@ -857,7 +857,7 @@ void Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::getTranspositio
                     << "This matrix rows: " << this->getRows() << std::endl
                     << "That matrix columns: " << matrix.getColumns() << std::endl
                     << "That matrix rows: " << matrix.getRows() << std::endl );
- 
+
    if( std::is_same< Device, Devices::Host >::value )
    {
       const IndexType& rows = matrix.getRows();
diff --git a/src/TNL/Matrices/DenseMatrixView.hpp b/src/TNL/Matrices/DenseMatrixView.hpp
index 08cfab8437..48c0ccdc32 100644
--- a/src/TNL/Matrices/DenseMatrixView.hpp
+++ b/src/TNL/Matrices/DenseMatrixView.hpp
@@ -15,7 +15,7 @@
 #include <TNL/Exceptions/NotImplementedError.h>
 
 namespace TNL {
-namespace Matrices {   
+namespace Matrices {
 
 template< typename Real,
           typename Device,
@@ -50,7 +50,7 @@ auto
 DenseMatrixView< Real, Device, Index, RowMajorOrder >::
 getView() -> ViewType
 {
-   return ViewType( this->getRows(), 
+   return ViewType( this->getRows(),
                     this->getColumns(),
                     this->getValues().getView(),
                     this->columnIndexes.getView(),
@@ -82,9 +82,9 @@ DenseMatrixView< Real, Device, Index, RowMajorOrder >::
 getSerializationType()
 {
    return String( "Matrices::Dense< " ) +
-          getType< RealType >() + ", " +
-          getType< Device >() + ", " +
-          getType< IndexType >() + " >";
+          TNL::getSerializationType< RealType >() + ", [any_device], " +
+          TNL::getSerializationType< IndexType >() +
+          ( RowMajorOrder ? "true" : "false" ) + ", [any_allocator] >";
 }
 
 template< typename Real,
@@ -271,7 +271,7 @@ template< typename Real,
           typename Device,
           typename Index,
           bool RowMajorOrder >
-Real 
+Real
 DenseMatrixView< Real, Device, Index, RowMajorOrder >::
 getElement( const IndexType row,
             const IndexType column ) const
@@ -783,7 +783,7 @@ void DenseMatrixView< Real, Device, Index, RowMajorOrder >::getTransposition( co
                     << "This matrix rows: " << this->getRows() << std::endl
                     << "That matrix columns: " << matrix.getColumns() << std::endl
                     << "That matrix rows: " << matrix.getRows() << std::endl );
- 
+
    if( std::is_same< Device, Devices::Host >::value )
    {
       const IndexType& rows = matrix.getRows();
diff --git a/src/TNL/Matrices/Tridiagonal_impl.h b/src/TNL/Matrices/Tridiagonal.hpp
similarity index 100%
rename from src/TNL/Matrices/Tridiagonal_impl.h
rename to src/TNL/Matrices/Tridiagonal.hpp
-- 
GitLab