diff --git a/Documentation/Examples/Matrices/CMakeLists.txt b/Documentation/Examples/Matrices/CMakeLists.txt
index 8cb519f7a2c8de36606c3d369e5f89585067c2e3..f91ae36e0619c4a02d0ba4de052fcff0988430c3 100644
--- a/Documentation/Examples/Matrices/CMakeLists.txt
+++ b/Documentation/Examples/Matrices/CMakeLists.txt
@@ -1,17 +1,17 @@
-IF( BUILD_CUDA )
-   CUDA_ADD_EXECUTABLE( DenseMatrixExample_Constructor_init_list_cuda DenseMatrixExample_Constructor_init_list.cu )
-   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_Constructor_init_list_cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_Constructor_init_list.out 
-                       OUTPUT DenseMatrixExample_Constructor_init_list.out )
-
-   CUDA_ADD_EXECUTABLE( DenseMatrixExample_setElements_cuda DenseMatrixExample_setElements.cu )
-   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_setElements_cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_setElements.out 
-                       OUTPUT DenseMatrixExample_setElements.out )
-
-   CUDA_ADD_EXECUTABLE( DenseMatrixExample_getCompressedRowLengths_cuda DenseMatrixExample_getCompressedRowLengths.cu )
-   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_getCompressedRowLengths_cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_getCompressedRowLengths.out 
-                       OUTPUT DenseMatrixExample_getCompressedRowLengths.out )
-
-ELSE()
+#IF( BUILD_CUDA )
+#   CUDA_ADD_EXECUTABLE( DenseMatrixExample_Constructor_init_list_cuda DenseMatrixExample_Constructor_init_list.cu )
+#   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_Constructor_init_list_cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_Constructor_init_list.out 
+#                       OUTPUT DenseMatrixExample_Constructor_init_list.out )
+#
+#   CUDA_ADD_EXECUTABLE( DenseMatrixExample_setElements_cuda DenseMatrixExample_setElements.cu )
+#   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_setElements_cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_setElements.out 
+#                       OUTPUT DenseMatrixExample_setElements.out )
+#
+#   CUDA_ADD_EXECUTABLE( DenseMatrixExample_getCompressedRowLengths_cuda DenseMatrixExample_getCompressedRowLengths.cu )
+#   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_getCompressedRowLengths_cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_getCompressedRowLengths.out 
+#                       OUTPUT DenseMatrixExample_getCompressedRowLengths.out )
+#
+#ELSE()
    ADD_EXECUTABLE( DenseMatrixExample_Constructor_init_list DenseMatrixExample_Constructor_init_list.cpp )
    ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_Constructor_init_list > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_Constructor_init_list.out 
                        OUTPUT DenseMatrixExample_Constructor_init_list.out )
@@ -23,18 +23,34 @@ ELSE()
    ADD_EXECUTABLE( DenseMatrixExample_getCompressedRowLengths DenseMatrixExample_getCompressedRowLengths.cpp )
    ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_getCompressedRowLengths > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_getCompressedRowLengths.out 
                        OUTPUT DenseMatrixExample_getCompressedRowLengths.out )
-ENDIF()
 
-IF( BUILD_CUDA )
-ADD_CUSTOM_TARGET( RunMatricesExamples-cuda ALL DEPENDS
-   DenseMatrixExample_Constructor_init_list.out
-   DenseMatrixExample_setElements.out
-   DenseMatrixExample_getCompressedRowLengths.out
-   )
-ELSE()
+   ADD_EXECUTABLE( DenseMatrixExample_getElementsCount DenseMatrixExample_getElementsCount.cpp )
+   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_getElementsCount > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_getElementsCount.out 
+                       OUTPUT DenseMatrixExample_getElementsCount.out )
+
+   ADD_EXECUTABLE( DenseMatrixExample_getConstRow DenseMatrixExample_getConstRow.cpp )
+   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_getConstRow > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_getConstRow.out 
+                       OUTPUT DenseMatrixExample_getConstRow.out )
+
+   ADD_EXECUTABLE( DenseMatrixExample_getRow DenseMatrixExample_getRow.cpp )
+   ADD_CUSTOM_COMMAND( COMMAND DenseMatrixExample_getRow > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DenseMatrixExample_getRow.out 
+                       OUTPUT DenseMatrixExample_getRow.out )
+
+#ENDIF()
+
+#IF( BUILD_CUDA )
+#ADD_CUSTOM_TARGET( RunMatricesExamples-cuda ALL DEPENDS
+#   DenseMatrixExample_Constructor_init_list.out
+#   DenseMatrixExample_setElements.out
+#   DenseMatrixExample_getCompressedRowLengths.out
+#   )
+#ELSE()
 ADD_CUSTOM_TARGET( RunMatricesExamples ALL DEPENDS
    DenseMatrixExample_Constructor_init_list.out
    DenseMatrixExample_setElements.out
    DenseMatrixExample_getCompressedRowLengths.out
+   DenseMatrixExample_getElementsCount.out
+   DenseMatrixExample_getConstRow.out
+   DenseMatrixExample_getRow.out
    )
-ENDIF()
+#ENDIF()
diff --git a/Documentation/Examples/Matrices/DenseMatrixExample_Constructor_init_list.cu b/Documentation/Examples/Matrices/DenseMatrixExample_Constructor_init_list.cu
deleted file mode 120000
index 91fa4f073fdd92c38ccf252d84f3ec4b953aa9dc..0000000000000000000000000000000000000000
--- a/Documentation/Examples/Matrices/DenseMatrixExample_Constructor_init_list.cu
+++ /dev/null
@@ -1 +0,0 @@
-DenseMatrixExample_Constructor_init_list.cpp
\ No newline at end of file
diff --git a/Documentation/Examples/Matrices/DenseMatrixExample_getCompressedRowLengths.cu b/Documentation/Examples/Matrices/DenseMatrixExample_getCompressedRowLengths.cu
deleted file mode 120000
index 2b3cd6c1377adc000b69c7124e73f09d73df8176..0000000000000000000000000000000000000000
--- a/Documentation/Examples/Matrices/DenseMatrixExample_getCompressedRowLengths.cu
+++ /dev/null
@@ -1 +0,0 @@
-DenseMatrixExample_getCompressedRowLengths.cpp
\ No newline at end of file
diff --git a/Documentation/Examples/Matrices/DenseMatrixExample_getConstRow.cpp b/Documentation/Examples/Matrices/DenseMatrixExample_getConstRow.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8e5da1d4b71da7fa3e1c8fff5d71e1620a772b41
--- /dev/null
+++ b/Documentation/Examples/Matrices/DenseMatrixExample_getConstRow.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+#include <functional>
+#include <TNL/Algorithms/ParallelFor.h>
+#include <TNL/Matrices/DenseMatrix.h>
+#include <TNL/Devices/Host.h>
+
+int main( int argc, char* argv[] )
+{
+   TNL::Matrices::DenseMatrix< double, TNL::Devices::Host > matrix {
+      { 1, 0, 0, 0, 0 },
+      { 1, 2, 0, 0, 0 },
+      { 1, 2, 3, 0, 0 },
+      { 1, 2, 3, 4, 0 },
+      { 1, 2, 3, 4, 5 }
+   };
+
+   /***
+    * We need a matrix view to pass the matrix to lambda function even on CUDA device.
+    */
+   const auto matrixView = matrix.getConstView();
+
+   /***
+    * Fetch lambda function returns diagonal element in each row.
+    */
+   auto fetch = [=] __cuda_callable__ ( int rowIdx ) mutable -> double {
+      auto row = matrixView.getRow( rowIdx );
+      return row.getElement( rowIdx );
+   };
+
+   int trace = TNL::Algorithms::Reduction< TNL::Devices::Host >::reduce( matrix.getRows(), std::plus<>{}, fetch, 0 );
+   std::cout << "Matrix trace is " << trace << "." << std::endl;
+}
diff --git a/Documentation/Examples/Matrices/DenseMatrixExample_getElementsCount.cpp b/Documentation/Examples/Matrices/DenseMatrixExample_getElementsCount.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..997dadb7fc8e409e1af2a1677cbc61c0a2deb83b
--- /dev/null
+++ b/Documentation/Examples/Matrices/DenseMatrixExample_getElementsCount.cpp
@@ -0,0 +1,17 @@
+#include <iostream>
+#include <TNL/Matrices/DenseMatrix.h>
+#include <TNL/Devices/Host.h>
+
+int main( int argc, char* argv[] )
+{
+   TNL::Matrices::DenseMatrix< double, TNL::Devices::Host > triangularMatrix {
+      {  1 },
+      {  2,  3 },
+      {  4,  5,  6 },
+      {  7,  8,  9, 10 },
+      { 11, 12, 13, 14, 15 }
+   };
+
+   std::cout << "Matrix elements count is " << triangularMatrix.getElementsCount() << "." << std::endl;
+   std::cout << "Non-zero matrix elements count is " << triangularMatrix.getNonzeroElementsCount() << "." << std::endl;
+}
diff --git a/Documentation/Examples/Matrices/DenseMatrixExample_getRow.cpp b/Documentation/Examples/Matrices/DenseMatrixExample_getRow.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..120c934a3b214305f68476674230c227f1eaf2a5
--- /dev/null
+++ b/Documentation/Examples/Matrices/DenseMatrixExample_getRow.cpp
@@ -0,0 +1,21 @@
+#include <iostream>
+#include <TNL/Algorithms/ParallelFor.h>
+#include <TNL/Matrices/DenseMatrix.h>
+#include <TNL/Devices/Host.h>
+
+int main( int argc, char* argv[] )
+{
+   TNL::Matrices::DenseMatrix< double, TNL::Devices::Host > matrix( 5, 5 );
+
+   /***
+    * We need a matrix view to pass the matrix to lambda function even on CUDA device.
+    */
+   auto matrixView = matrix.getView();
+   auto f = [=] __cuda_callable__ ( int rowIdx ) mutable {
+      auto row = matrixView.getRow( rowIdx );
+      row.setElement( rowIdx, 10* ( rowIdx + 1 ) );
+   };
+
+   TNL::Algorithms::ParallelFor< TNL::Devices::Host >::exec( 0, matrix.getRows(), f );
+   std::cout << matrix << std::endl;
+}
diff --git a/Documentation/Examples/Matrices/DenseMatrixExample_setElements.cu b/Documentation/Examples/Matrices/DenseMatrixExample_setElements.cu
deleted file mode 120000
index fa2487e278ec58ceb13a2b5c20aafb8142ccb920..0000000000000000000000000000000000000000
--- a/Documentation/Examples/Matrices/DenseMatrixExample_setElements.cu
+++ /dev/null
@@ -1 +0,0 @@
-DenseMatrixExample_setElements.cpp
\ No newline at end of file
diff --git a/src/TNL/Containers/Segments/BiEllpack.hpp b/src/TNL/Containers/Segments/BiEllpack.hpp
index 91ebea2073128e76423a2621014809cdd2b92e85..5203b3b3fa98196b8ae762c575950851c03030e3 100644
--- a/src/TNL/Containers/Segments/BiEllpack.hpp
+++ b/src/TNL/Containers/Segments/BiEllpack.hpp
@@ -341,7 +341,8 @@ setSegmentsSizes( const SizesHolder& segmentsSizes )
    else
    {
       BiEllpack< Devices::Host, Index, typename Allocators::Default< Devices::Host >::template Allocator< IndexType >, RowMajorOrder > hostSegments;
-      Containers::Vector< IndexType, Devices::Host, IndexType > hostSegmentsSizes( segmentsSizes );
+      Containers::Vector< IndexType, Devices::Host, IndexType > hostSegmentsSizes;
+      hostSegmentsSizes = segmentsSizes;
       hostSegments.setSegmentsSizes( hostSegmentsSizes );
       *this = hostSegments;
    }
diff --git a/src/TNL/Containers/Segments/ChunkedEllpack.hpp b/src/TNL/Containers/Segments/ChunkedEllpack.hpp
index 444360d66dbb492ec7d61489cd78473c2b816fcf..83150c7668f98ce8e1304a8fbf8eabfdbd74a2cf 100644
--- a/src/TNL/Containers/Segments/ChunkedEllpack.hpp
+++ b/src/TNL/Containers/Segments/ChunkedEllpack.hpp
@@ -294,7 +294,8 @@ setSegmentsSizes( const SizesHolder& segmentsSizes )
    else
    {
       ChunkedEllpack< Devices::Host, Index, typename Allocators::Default< Devices::Host >::template Allocator< Index >, RowMajorOrder > hostSegments;
-      Containers::Vector< IndexType, Devices::Host, IndexType > hostSegmentsSizes( segmentsSizes );
+      Containers::Vector< IndexType, Devices::Host, IndexType > hostSegmentsSizes;
+      hostSegmentsSizes = segmentsSizes;
       hostSegments.setSegmentsSizes( hostSegmentsSizes );
       *this = hostSegments;
    }
diff --git a/src/TNL/File.hpp b/src/TNL/File.hpp
index af112e992a7640070ab880192688b3a0aac8f1d2..05e9d9ad70c387fff4765c00f0cc67fbe04d48ca 100644
--- a/src/TNL/File.hpp
+++ b/src/TNL/File.hpp
@@ -176,7 +176,7 @@ template< typename Type,
           typename Allocator >
 void File::save( const Type* buffer, std::streamsize elements )
 {
-   static_assert( std::is_same< Type, typename Allocator::value_type >::value,
+   static_assert( std::is_same< std::remove_cv_t< Type >, typename Allocator::value_type >::value,
                   "Allocator::value_type must be the same as Type." );
    TNL_ASSERT_GE( elements, 0, "Number of elements to save must be non-negative." );
 
diff --git a/src/TNL/Matrices/DenseMatrix.h b/src/TNL/Matrices/DenseMatrix.h
index 40fc1302beb22b63aa1a7eac37a8f5ab93aea3b6..8b22930e90b72d2275c2c6b37f1f1637126d50f1 100644
--- a/src/TNL/Matrices/DenseMatrix.h
+++ b/src/TNL/Matrices/DenseMatrix.h
@@ -87,23 +87,17 @@ class DenseMatrix : public Matrix< Real, Device, Index >
       using RowView = DenseMatrixRowView< SegmentViewType, ValuesViewType >;
 
       /**
-       * \brief Helper type for getting self type or its variations.
+       * \brief Helper type for getting self type or its modifications.
        */
       template< typename _Real = Real,
                 typename _Device = Device,
                 typename _Index = Index,
-                bool RowMajorOrder_ = RowMajorOrder,
-                typename RealAllocator_ = RealAllocator >
-      using Self = DenseMatrix< _Real, _Device, _Index, RowMajorOrder_, RealAllocator_ >;
-
-      // TODO: remove this
-      using CompressedRowLengthsVector = typename Matrix< Real, Device, Index >::CompressedRowLengthsVector;
-      using ConstCompressedRowLengthsVectorView = typename Matrix< Real, Device, Index >::ConstCompressedRowLengthsVectorView;
-
-
+                bool _RowMajorOrder = RowMajorOrder,
+                typename _RealAllocator = RealAllocator >
+      using Self = DenseMatrix< _Real, _Device, _Index, _RowMajorOrder, _RealAllocator >;
 
       /**
-       * \brief Constrictor without parameters.
+       * \brief Constructor without parameters.
        */
       DenseMatrix();
 
@@ -228,31 +222,119 @@ class DenseMatrix : public Matrix< Real, Device, Index >
       template< typename RowLengthsVector >
       void getCompressedRowLengths( RowLengthsVector& rowLengths ) const;
 
-      IndexType getMaxRowLength() const;
-
-      IndexType getNumberOfMatrixElements() const;
+      /**
+       * \brief Returns number of all matrix elements.
+       * 
+       * This method is here mainly for compatibility with sparse matrices since
+       * the number of all matrix elements is just number of rows times number of
+       * columns.
+       * 
+       * \return number of all matrix elements.
+       * 
+       * \par Example
+       * \include Matrices/DenseMatrixExample_getElementsCount.cpp
+       * \par Output
+       * \include DenseMatrixExample_getElementsCount.out
+       */
+      IndexType getElementsCount() const;
 
-      IndexType getNumberOfNonzeroMatrixElements() const;
+      /**
+       * \brief Returns number of non-zero matrix elements.
+       * 
+       * \return number of all non-zero matrix elements.
+       * 
+       * \par Example
+       * \include Matrices/DenseMatrixExample_getElementsCount.cpp
+       * \par Output
+       * \include DenseMatrixExample_getElementsCount.out
+       */
+      IndexType getNonzeroElementsCount() const;
 
+      /**
+       * \brief Resets the matrix to zero dimensions.
+       */
       void reset();
 
+      /**
+       * \brief Constant getter of simple structure for accessing given matrix row.
+       * 
+       * \param rowIdx is matrix row index.
+       * 
+       * \return RowView for accessing given matrix row.
+       *
+       * \par Example
+       * \include Matrices/DenseMatrixExample_getConstRow.cpp
+       * \par Output
+       * \include DenseMatrixExample_getConstRow.out
+       */
       __cuda_callable__
       const RowView getRow( const IndexType& rowIdx ) const;
 
+      /**
+       * \brief Non-constant getter of simple structure for accessing given matrix row.
+       * 
+       * \param rowIdx is matrix row index.
+       * 
+       * \return RowView for accessing given matrix row.
+       * 
+       * \par Example
+       * \include Matrices/DenseMatrixExample_getRow.cpp
+       * \par Output
+       * \include DenseMatrixExample_getRow.out
+       */
       __cuda_callable__
       RowView getRow( const IndexType& rowIdx );
 
-
+      /**
+       * \brief Sets all matrix elements to value \e v.
+       * 
+       * \param v is value all matrix elements will be set to.
+       */
       void setValue( const RealType& v );
 
+      /**
+       * \brief Returns non-constant reference to element at row \e row and column column.
+       * 
+       * Since this method returns reference to the element, it cannot be called across
+       * different address spaces. It means that it can be called only form CPU if the matrix
+       * is allocated on CPU or only from GPU kernels if the matrix is allocated on GPU.
+       * 
+       * \param row is a row index of the element.
+       * \param column is a columns index of the element. 
+       * \return reference to given matrix element.
+       */
       __cuda_callable__
       Real& operator()( const IndexType row,
                         const IndexType column );
 
+      /**
+       * \brief Returns constant reference to element at row \e row and column column.
+       * 
+       * Since this method returns reference to the element, it cannot be called across
+       * different address spaces. It means that it can be called only form CPU if the matrix
+       * is allocated on CPU or only from GPU kernels if the matrix is allocated on GPU.
+       * 
+       * \param row is a row index of the element.
+       * \param column is a columns index of the element. 
+       * \return reference to given matrix element.
+       */
       __cuda_callable__
       const Real& operator()( const IndexType row,
                               const IndexType column ) const;
 
+      /**
+       * \brief Sets element at given \e row and \e column to given \e value.
+       * 
+       * This method can be called only from the host system (CPU) no matter
+       * where the matrix is allocated. If the matrix is allocated in GPU device
+       * this methods transfer values of each matrix element separately and so the
+       * performance is very low. For higher performance see. \ref DenseMatrix::getRow
+       * or \ref DenseMatrix::forRows and \ref DenseMatrix::forAllRows.
+       * 
+       * \param row is row index of the element.
+       * \param column is columns index of the element.
+       * \param value is the value the element will be set to.
+       */
       void setElement( const IndexType row,
                        const IndexType column,
                        const RealType& value );
diff --git a/src/TNL/Matrices/DenseMatrix.hpp b/src/TNL/Matrices/DenseMatrix.hpp
index 64a14afc8db6a7250c029ead425dda4dd21d0c5f..4d8166f6400079c965cf96906f928e153127800c 100644
--- a/src/TNL/Matrices/DenseMatrix.hpp
+++ b/src/TNL/Matrices/DenseMatrix.hpp
@@ -202,17 +202,7 @@ template< typename Real,
           typename Index,
           bool RowMajorOrder,
           typename RealAllocator >
-Index DenseMatrix< Real, Device, Index, RowMajorOrder, RealAllocator >::getMaxRowLength() const
-{
-   return this->getColumns();
-}
-
-template< typename Real,
-          typename Device,
-          typename Index,
-          bool RowMajorOrder,
-          typename RealAllocator >
-Index DenseMatrix< Real, Device, Index, RowMajorOrder, RealAllocator >::getNumberOfMatrixElements() const
+Index DenseMatrix< Real, Device, Index, RowMajorOrder, RealAllocator >::getElementsCount() const
 {
    return this->getRows() * this->getColumns();
 }
@@ -222,9 +212,9 @@ template< typename Real,
           typename Index,
           bool RowMajorOrder,
           typename RealAllocator >
-Index DenseMatrix< Real, Device, Index, RowMajorOrder, RealAllocator >::getNumberOfNonzeroMatrixElements() const
+Index DenseMatrix< Real, Device, Index, RowMajorOrder, RealAllocator >::getNonzeroElementsCount() const
 {
-   return this->view.getNumberOfNonzeroMatrixElements();
+   return this->view.getNonzeroElementsCount();
 }
 
 template< typename Real,
diff --git a/src/TNL/Matrices/DenseMatrixRowView.h b/src/TNL/Matrices/DenseMatrixRowView.h
index 84c6b141cd7f7cdf25be8e550e573680b4cce902..01fdd9408df97990ac3d280a6961cfcf73defdc2 100644
--- a/src/TNL/Matrices/DenseMatrixRowView.h
+++ b/src/TNL/Matrices/DenseMatrixRowView.h
@@ -32,10 +32,10 @@ class DenseMatrixRowView
       IndexType getSize() const;
 
       __cuda_callable__
-      const RealType& getValue( const IndexType column ) const;
+      const RealType& getElement( const IndexType column ) const;
 
       __cuda_callable__
-      RealType& getValue( const IndexType column );
+      RealType& getElement( const IndexType column );
 
       __cuda_callable__
       void setElement( const IndexType column,
diff --git a/src/TNL/Matrices/DenseMatrixRowView.hpp b/src/TNL/Matrices/DenseMatrixRowView.hpp
index 1962a4d9a8eabe80f28b2e21d1f0506792949225..9ca725396d2c4a0524f9b268cbce900d8e660daf 100644
--- a/src/TNL/Matrices/DenseMatrixRowView.hpp
+++ b/src/TNL/Matrices/DenseMatrixRowView.hpp
@@ -38,7 +38,7 @@ template< typename SegmentView,
           typename ValuesView >
 __cuda_callable__ auto
 DenseMatrixRowView< SegmentView, ValuesView >::
-getValue( const IndexType column ) const -> const RealType&
+getElement( const IndexType column ) const -> const RealType&
 {
    TNL_ASSERT_LT( column, this->getSize(), "Column index exceeds matrix row size." );
    return values[ segmentView.getGlobalIndex( column ) ];
@@ -48,7 +48,7 @@ template< typename SegmentView,
           typename ValuesView >
 __cuda_callable__ auto
 DenseMatrixRowView< SegmentView, ValuesView >::
-getValue( const IndexType column ) -> RealType&
+getElement( const IndexType column ) -> RealType&
 {
    TNL_ASSERT_LT( column, this->getSize(), "Column index exceeds matrix row size." );
    return values[ segmentView.getGlobalIndex( column ) ];
diff --git a/src/TNL/Matrices/DenseMatrixView.h b/src/TNL/Matrices/DenseMatrixView.h
index a7e1a09a78f336b94ae9f62ab84d2846d2e24602..f0d0b388e5994ee6c57fbc3e7b9d4519a6369326 100644
--- a/src/TNL/Matrices/DenseMatrixView.h
+++ b/src/TNL/Matrices/DenseMatrixView.h
@@ -87,9 +87,9 @@ class DenseMatrixView : public MatrixView< Real, Device, Index >
 
       IndexType getMaxRowLength() const;
 
-      IndexType getNumberOfMatrixElements() const;
+      IndexType getElementsCount() const;
 
-      IndexType getNumberOfNonzeroMatrixElements() const;
+      IndexType getNonzeroElementsCount() const;
 
       void reset();
 
diff --git a/src/TNL/Matrices/DenseMatrixView.hpp b/src/TNL/Matrices/DenseMatrixView.hpp
index ec2e3f892595d4b1bcebd6668bb8124272bae659..bf2ebd4f27e7c428e10c16fa7bbfdddadce567b3 100644
--- a/src/TNL/Matrices/DenseMatrixView.hpp
+++ b/src/TNL/Matrices/DenseMatrixView.hpp
@@ -144,7 +144,7 @@ template< typename Real,
           typename Device,
           typename Index,
           bool RowMajorOrder >
-Index DenseMatrixView< Real, Device, Index, RowMajorOrder >::getNumberOfMatrixElements() const
+Index DenseMatrixView< Real, Device, Index, RowMajorOrder >::getElementsCount() const
 {
    return this->getRows() * this->getColumns();
 }
@@ -153,7 +153,7 @@ template< typename Real,
           typename Device,
           typename Index,
           bool RowMajorOrder >
-Index DenseMatrixView< Real, Device, Index, RowMajorOrder >::getNumberOfNonzeroMatrixElements() const
+Index DenseMatrixView< Real, Device, Index, RowMajorOrder >::getNonzeroElementsCount() const
 {
    const auto values_view = this->values.getConstView();
    auto fetch = [=] __cuda_callable__ ( const IndexType i ) -> IndexType {
@@ -189,7 +189,7 @@ DenseMatrixView< Real, Device, Index, RowMajorOrder >::
 getRow( const IndexType& rowIdx ) const -> const RowView
 {
    TNL_ASSERT_LT( rowIdx, this->getRows(), "Row index is larger than number of matrix rows." );
-   return RowView( this->segments.getSegmentView( rowIdx ), this->values.getView() );
+   return RowView( this->segments.getSegmentView( rowIdx ), this->values.getConstView() );
 }
 
 template< typename Real,
@@ -685,8 +685,8 @@ void DenseMatrixView< Real, Device, Index, RowMajorOrder >::print( std::ostream&
       for( IndexType column = 0; column < this->getColumns(); column++ )
       {
          std::stringstream str_;
-         str_ << column << ":" << this->getElement( row, column );
-         str << std::setw( 6 ) << str_.str();
+         str_ << std::setw( 4 ) << std::right << column << ":" << std::setw( 4 ) << std::left << this->getElement( row, column );
+         str << std::setw( 10 ) << str_.str();
       }
       str << std::endl;
    }
diff --git a/src/TNL/Matrices/MatrixView.h b/src/TNL/Matrices/MatrixView.h
index 89551018186e279ced32005971ccfe44d7bda918..76a3948a98792388120097cc7e20190ba58c95e5 100644
--- a/src/TNL/Matrices/MatrixView.h
+++ b/src/TNL/Matrices/MatrixView.h
@@ -83,8 +83,6 @@ public:
 
    virtual void save( File& file ) const;
 
-   virtual void load( File& file );
-
    virtual void print( std::ostream& str ) const;
 
 
diff --git a/src/TNL/Matrices/MatrixView.hpp b/src/TNL/Matrices/MatrixView.hpp
index dfac8f3afc671db39382fff6cc1916e73f3fc4b0..b2b181e4c4671607728bfb9f37935a23fe258a30 100644
--- a/src/TNL/Matrices/MatrixView.hpp
+++ b/src/TNL/Matrices/MatrixView.hpp
@@ -155,17 +155,6 @@ void MatrixView< Real, Device, Index >::save( File& file ) const
    file << this->values;
 }
 
-template< typename Real,
-          typename Device,
-          typename Index >
-void MatrixView< Real, Device, Index >::load( File& file )
-{
-   Object::load( file );
-   file.load( &this->rows );
-   file.load( &this->columns );
-   file >> this->values;
-}
-
 template< typename Real,
           typename Device,
           typename Index >
diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h
index 046b0a6ae14bcfedafe94244524afd6000a9467c..0348a3945bc4373fba5ffe03c3dc2474131c428a 100644
--- a/src/TNL/Matrices/SparseMatrix.h
+++ b/src/TNL/Matrices/SparseMatrix.h
@@ -115,7 +115,7 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator >
 
       // TODO: Remove this when possible
       void setCompressedRowLengths( ConstCompressedRowLengthsVectorView rowLengths ) {
-         this->setCompressedRowLengths( rowLengths );
+         this->setRowCapacities( rowLengths );
       };
 
       void setElements( const std::initializer_list< std::tuple< IndexType, IndexType, RealType > >& data );
diff --git a/src/UnitTests/Matrices/DenseMatrixTest.h b/src/UnitTests/Matrices/DenseMatrixTest.h
index 81e2ae6823cac5a9dcd0fe5711b9227ffd4b0e8d..391043f0f3129740afde07adb179e37ac9cab7e3 100644
--- a/src/UnitTests/Matrices/DenseMatrixTest.h
+++ b/src/UnitTests/Matrices/DenseMatrixTest.h
@@ -163,7 +163,7 @@ void test_GetCompressedRowLengths()
 }
 
 template< typename Matrix >
-void test_GetNumberOfMatrixElements()
+void test_GetElementsCount()
 {
     using RealType = typename Matrix::RealType;
     using DeviceType = typename Matrix::DeviceType;
@@ -176,11 +176,11 @@ void test_GetNumberOfMatrixElements()
     m.reset();
     m.setDimensions( rows, cols );
 
-    EXPECT_EQ( m.getNumberOfMatrixElements(), 42 );
+    EXPECT_EQ( m.getElementsCount(), 42 );
 }
 
 template< typename Matrix >
-void test_GetNumberOfNonzeroMatrixElements()
+void test_GetNonzeroElementsCount()
 {
     using RealType = typename Matrix::RealType;
     using DeviceType = typename Matrix::DeviceType;
@@ -212,7 +212,7 @@ void test_GetNumberOfNonzeroMatrixElements()
     m.setElement( 0, 0, 0); // Set the first element of the diagonal to 0.
     m.setElement( 6, 5, 0); // Set the last element of the diagonal to 0.
 
-    EXPECT_EQ( m.getNumberOfNonzeroMatrixElements(), 40 );
+    EXPECT_EQ( m.getNonzeroElementsCount(), 40 );
 }
 
 template< typename Matrix >
@@ -706,7 +706,7 @@ void test_AddRow()
       auto row = matrix_view.getRow( rowIdx );
       for( IndexType i = 0; i < 5; i++ )
       {
-         RealType& val = row.getValue( i );
+         RealType& val = row.getElement( i );
          val = rowIdx * val + values[ rowIdx ][ i ];
       }
    };
@@ -1281,53 +1281,6 @@ void test_SaveAndLoad()
     EXPECT_EQ( savedMatrix.getElement( 3, 3 ), 16 );
 }
 
-template< typename Matrix >
-void test_Print()
-{
-    using RealType = typename Matrix::RealType;
-    using DeviceType = typename Matrix::DeviceType;
-    using IndexType = typename Matrix::IndexType;
-/*
- * Sets up the following 5x4 sparse matrix:
- *
- *    /  1  2  3  4 \
- *    |  5  6  7  8 |
- *    |  9 10 11 12 |
- *    | 13 14 15 16 |
- *    \ 17 18 19 20 /
- */
-    const IndexType rows = 5;
-    const IndexType cols = 4;
-
-    Matrix m;
-    m.reset();
-    m.setDimensions( rows, cols );
-
-    RealType value = 1;
-    for( IndexType i = 0; i < rows; i++)
-        for( IndexType j = 0; j < cols; j++)
-            m.setElement( i, j, value++ );
-
-    #include <sstream>
-    std::stringstream printed;
-    std::stringstream couted;
-
-    //change the underlying buffer and save the old buffer
-    auto old_buf = std::cout.rdbuf(printed.rdbuf());
-
-    m.print( std::cout ); //all the std::cout goes to ss
-
-    std::cout.rdbuf(old_buf); //reset
-
-    couted << "Row: 0 ->  Col:0->1	 Col:1->2	 Col:2->3	 Col:3->4\t\n"
-              "Row: 1 ->  Col:0->5	 Col:1->6	 Col:2->7	 Col:3->8\t\n"
-              "Row: 2 ->  Col:0->9	 Col:1->10	 Col:2->11	 Col:3->12\t\n"
-              "Row: 3 ->  Col:0->13	 Col:1->14	 Col:2->15	 Col:3->16\t\n"
-              "Row: 4 ->  Col:0->17	 Col:1->18	 Col:2->19	 Col:3->20\t\n";
-
-    EXPECT_EQ( printed.str(), couted.str() );
-}
-
 // test fixture for typed tests
 template< typename Matrix >
 class MatrixTest : public ::testing::Test
@@ -1395,18 +1348,18 @@ TYPED_TEST( MatrixTest, setElementsTest )
     test_SetElements< MatrixType >();
 }
 
-TYPED_TEST( MatrixTest, getNumberOfMatrixElementsTest )
+TYPED_TEST( MatrixTest, getElementsCountTest )
 {
     using MatrixType = typename TestFixture::MatrixType;
 
-    test_GetNumberOfMatrixElements< MatrixType >();
+    test_GetElementsCount< MatrixType >();
 }
 
-TYPED_TEST( MatrixTest, getNumberOfNonzeroMatrixElementsTest )
+TYPED_TEST( MatrixTest, getNonzeroElementsCountTest )
 {
     using MatrixType = typename TestFixture::MatrixType;
 
-    test_GetNumberOfNonzeroMatrixElements< MatrixType >();
+    test_GetNonzeroElementsCount< MatrixType >();
 }
 
 TYPED_TEST( MatrixTest, resetTest )
@@ -1479,13 +1432,6 @@ TYPED_TEST( MatrixTest, saveAndLoadTest )
     test_SaveAndLoad< MatrixType >();
 }
 
-TYPED_TEST( MatrixTest, printTest )
-{
-    using MatrixType = typename TestFixture::MatrixType;
-
-    test_Print< MatrixType >();
-}
-
 //// test_getType is not general enough yet. DO NOT TEST IT YET.
 
 //TEST( DenseMatrixTest, Dense_GetTypeTest_Host )