Commit be56f6db authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Renaming rowLengths to compressedRowLengths in LambdaMatrix.

parent d6916fe6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ int main( int argc, char* argv[] )
   /***
    * Lambda functions defining the matrix.
    */
   auto rowLengths = [=] __cuda_callable__ ( const int rows, const int columns, const int rowIdx ) -> int { return 1; };
   auto compressedRowLengths = [=] __cuda_callable__ ( const int rows, const int columns, const int rowIdx ) -> int { return 1; };
   auto matrixElements1 = [=] __cuda_callable__ ( const int rows, const int columns, const int rowIdx, const int localIdx, int& columnIdx, double& value ) {
         columnIdx = rowIdx;
         value =  1.0;
@@ -21,13 +21,13 @@ int main( int argc, char* argv[] )
   /***
    * Matrix construction with explicit type definition.
    */
   using MatrixType = decltype( TNL::Matrices::LambdaMatrixFactory< double, TNL::Devices::Host, int >::create( matrixElements1, rowLengths ) );
   MatrixType m1( size, size, matrixElements1, rowLengths );
   using MatrixType = decltype( TNL::Matrices::LambdaMatrixFactory< double, TNL::Devices::Host, int >::create( matrixElements1, compressedRowLengths ) );
   MatrixType m1( size, size, matrixElements1, compressedRowLengths );

   /***
    * Matrix construction using 'auto'.
    */
   auto m2 = TNL::Matrices::LambdaMatrixFactory< double, TNL::Devices::Host, int >::create( matrixElements2, rowLengths );
   auto m2 = TNL::Matrices::LambdaMatrixFactory< double, TNL::Devices::Host, int >::create( matrixElements2, compressedRowLengths );
   m2.setDimensions( size, size );

   std::cout << "The first lambda matrix: " << std::endl << m1 << std::endl;
+2 −2
Original line number Diff line number Diff line
@@ -10,14 +10,14 @@ void forRowsExample()
   /***
    * Lambda functions defining the matrix.
    */
   auto rowLengths = [=] __cuda_callable__ ( const int rows, const int columns, const int rowIdx ) -> int { return columns; };
   auto compressedRowLengths = [=] __cuda_callable__ ( const int rows, const int columns, const int rowIdx ) -> int { return columns; };
   auto matrixElements = [=] __cuda_callable__ ( const int rows, const int columns, const int rowIdx, const int localIdx, int& columnIdx, double& value ) {
         columnIdx = localIdx;
         value = TNL::max( rowIdx - columnIdx + 1, 0 );
   };

   using MatrixFactory = TNL::Matrices::LambdaMatrixFactory< double, Device, int >;
   auto matrix = MatrixFactory::create( 5, 5, matrixElements, rowLengths );
   auto matrix = MatrixFactory::create( 5, 5, matrixElements, compressedRowLengths );

   TNL::Matrices::DenseMatrix< double, Device > denseMatrix( 5, 5 );
   auto denseView = denseMatrix.getView();