From 2cfaa8d3644a17bde405c79d73da028c80e60c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz> Date: Mon, 27 Dec 2021 12:47:36 +0100 Subject: [PATCH] clang-tidy: const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls] See https://clang.llvm.org/extra/clang-tidy/checks/readability-avoid-const-params-in-decls.html --- src/TNL/Algorithms/MemoryOperations.h | 36 +++++++++---------- .../Algorithms/MultiDeviceMemoryOperations.h | 8 ++--- src/TNL/Algorithms/Multireduction.h | 21 ++--------- src/TNL/Algorithms/Segments/BiEllpack.h | 10 +++--- src/TNL/Algorithms/Segments/BiEllpackView.h | 18 +++++----- src/TNL/Algorithms/Segments/CSR.h | 6 ++-- src/TNL/Algorithms/Segments/CSRView.h | 6 ++-- src/TNL/Algorithms/Segments/ChunkedEllpack.h | 8 ++--- .../Algorithms/Segments/ChunkedEllpackView.h | 26 +++++++------- src/TNL/Algorithms/Segments/Ellpack.h | 10 +++--- src/TNL/Algorithms/Segments/EllpackView.h | 6 ++-- .../Segments/Kernels/CSRAdaptiveKernel.h | 2 +- .../Segments/Kernels/CSRAdaptiveKernelView.h | 2 +- .../details/CSRAdaptiveKernelParameters.h | 2 +- src/TNL/Algorithms/Segments/SlicedEllpack.h | 6 ++-- .../Algorithms/Segments/SlicedEllpackView.h | 6 ++-- src/TNL/Algorithms/Segments/detail/CSR.h | 4 +-- src/TNL/Algorithms/detail/Reduction.h | 12 +++---- src/TNL/Benchmarks/Benchmarks.h | 8 ++--- src/TNL/Containers/ArrayView.h | 4 +-- src/TNL/FileName.h | 6 ++-- src/TNL/Images/DicomSeries.h | 5 +-- src/TNL/Images/JPEGImage.h | 2 +- src/TNL/Images/PGMImage.h | 2 +- src/TNL/Images/PNGImage.h | 2 +- src/TNL/Images/RegionOfInterest.h | 2 +- src/TNL/Matrices/DenseMatrix.h | 23 ++++++------ src/TNL/Matrices/DenseMatrixRowView.h | 10 +++--- src/TNL/Matrices/DenseMatrixView.h | 23 +++++------- src/TNL/Matrices/Matrix.h | 4 +-- src/TNL/Matrices/MatrixReader.h | 4 +-- src/TNL/Matrices/MatrixView.h | 2 +- src/TNL/Matrices/MultidiagonalMatrix.h | 33 ++++++++--------- src/TNL/Matrices/MultidiagonalMatrixRowView.h | 10 +++--- src/TNL/Matrices/MultidiagonalMatrixView.h | 17 ++++----- .../Matrices/Sandbox/SparseSandboxMatrix.h | 32 ++++++++--------- .../Sandbox/SparseSandboxMatrixRowView.h | 14 ++++---- .../Sandbox/SparseSandboxMatrixView.h | 16 ++++----- src/TNL/Matrices/SparseMatrix.h | 30 ++++++++-------- src/TNL/Matrices/SparseMatrixRowView.h | 14 ++++---- src/TNL/Matrices/SparseMatrixView.h | 14 ++++---- src/TNL/Matrices/TridiagonalMatrix.h | 23 ++++++------ src/TNL/Matrices/TridiagonalMatrixRowView.h | 10 +++--- src/TNL/Matrices/TridiagonalMatrixView.h | 17 ++++----- src/TNL/Meshes/GridDetails/Grid1D.h | 4 +-- src/TNL/Meshes/GridDetails/Grid2D.h | 4 +-- src/TNL/Meshes/GridDetails/Grid3D.h | 4 +-- src/TNL/Meshes/GridDetails/GridTraverser.h | 12 +++---- .../Meshes/GridDetails/GridTraverser_1D.hpp | 4 +-- .../Meshes/GridDetails/GridTraverser_2D.hpp | 4 +-- .../Meshes/GridDetails/GridTraverser_3D.hpp | 4 +-- src/TNL/Meshes/Mesh.h | 20 +++++------ src/TNL/Meshes/MeshEntity.h | 6 ++-- src/TNL/Meshes/Writers/PVTIWriter.h | 12 +++---- src/TNL/Meshes/Writers/PVTUWriter.h | 14 ++++---- src/TNL/Meshes/Writers/VTIWriter.h | 6 ++-- src/TNL/Meshes/Writers/VTKWriter.h | 6 ++-- src/TNL/Meshes/Writers/VTUWriter.h | 6 ++-- src/TNL/Solvers/Linear/GMRES.h | 18 +++++----- src/TNL/String.h | 2 +- 60 files changed, 301 insertions(+), 341 deletions(-) diff --git a/src/TNL/Algorithms/MemoryOperations.h b/src/TNL/Algorithms/MemoryOperations.h index dd94f6582e..e91d0ba13e 100644 --- a/src/TNL/Algorithms/MemoryOperations.h +++ b/src/TNL/Algorithms/MemoryOperations.h @@ -23,7 +23,7 @@ struct MemoryOperations< Devices::Sequential > template< typename Element, typename Index > __cuda_callable__ static void - construct( Element* data, const Index size ); + construct( Element* data, Index size ); // note that args are passed by reference to the constructor, not via // std::forward since move-semantics does not apply for the construction of @@ -31,12 +31,12 @@ struct MemoryOperations< Devices::Sequential > template< typename Element, typename Index, typename... Args > __cuda_callable__ static void - construct( Element* data, const Index size, const Args&... args ); + construct( Element* data, Index size, const Args&... args ); template< typename Element, typename Index > __cuda_callable__ static void - destruct( Element* data, const Index size ); + destruct( Element* data, Index size ); template< typename Element > __cuda_callable__ @@ -51,12 +51,12 @@ struct MemoryOperations< Devices::Sequential > template< typename Element, typename Index > __cuda_callable__ static void - set( Element* data, const Element& value, const Index size ); + set( Element* data, const Element& value, Index size ); template< typename DestinationElement, typename SourceElement, typename Index > __cuda_callable__ static void - copy( DestinationElement* destination, const SourceElement* source, const Index size ); + copy( DestinationElement* destination, const SourceElement* source, Index size ); template< typename DestinationElement, typename Index, typename SourceIterator > static void @@ -65,7 +65,7 @@ struct MemoryOperations< Devices::Sequential > template< typename Element1, typename Element2, typename Index > __cuda_callable__ static bool - compare( const Element1* destination, const Element2* source, const Index size ); + compare( const Element1* destination, const Element2* source, Index size ); }; template<> @@ -73,18 +73,18 @@ struct MemoryOperations< Devices::Host > { template< typename Element, typename Index > static void - construct( Element* data, const Index size ); + construct( Element* data, Index size ); // note that args are passed by reference to the constructor, not via // std::forward since move-semantics does not apply for the construction of // multiple elements template< typename Element, typename Index, typename... Args > static void - construct( Element* data, const Index size, const Args&... args ); + construct( Element* data, Index size, const Args&... args ); template< typename Element, typename Index > static void - destruct( Element* data, const Index size ); + destruct( Element* data, Index size ); // this is __cuda_callable__ only to silence nvcc warnings TNL_NVCC_HD_WARNING_DISABLE @@ -102,11 +102,11 @@ struct MemoryOperations< Devices::Host > template< typename Element, typename Index > static void - set( Element* data, const Element& value, const Index size ); + set( Element* data, const Element& value, Index size ); template< typename DestinationElement, typename SourceElement, typename Index > static void - copy( DestinationElement* destination, const SourceElement* source, const Index size ); + copy( DestinationElement* destination, const SourceElement* source, Index size ); template< typename DestinationElement, typename Index, typename SourceIterator > static void @@ -114,7 +114,7 @@ struct MemoryOperations< Devices::Host > template< typename Element1, typename Element2, typename Index > static bool - compare( const Element1* destination, const Element2* source, const Index size ); + compare( const Element1* destination, const Element2* source, Index size ); }; template<> @@ -122,7 +122,7 @@ struct MemoryOperations< Devices::Cuda > { template< typename Element, typename Index > static void - construct( Element* data, const Index size ); + construct( Element* data, Index size ); // note that args are passed by value to the constructor, not via // std::forward or even by reference, since move-semantics does not apply for @@ -130,11 +130,11 @@ struct MemoryOperations< Devices::Cuda > // with CUDA kernels template< typename Element, typename Index, typename... Args > static void - construct( Element* data, const Index size, const Args&... args ); + construct( Element* data, Index size, const Args&... args ); template< typename Element, typename Index > static void - destruct( Element* data, const Index size ); + destruct( Element* data, Index size ); template< typename Element > __cuda_callable__ @@ -148,11 +148,11 @@ struct MemoryOperations< Devices::Cuda > template< typename Element, typename Index > static void - set( Element* data, const Element& value, const Index size ); + set( Element* data, const Element& value, Index size ); template< typename DestinationElement, typename SourceElement, typename Index > static void - copy( DestinationElement* destination, const SourceElement* source, const Index size ); + copy( DestinationElement* destination, const SourceElement* source, Index size ); template< typename DestinationElement, typename Index, typename SourceIterator > static void @@ -160,7 +160,7 @@ struct MemoryOperations< Devices::Cuda > template< typename Element1, typename Element2, typename Index > static bool - compare( const Element1* destination, const Element2* source, const Index size ); + compare( const Element1* destination, const Element2* source, Index size ); }; } // namespace Algorithms diff --git a/src/TNL/Algorithms/MultiDeviceMemoryOperations.h b/src/TNL/Algorithms/MultiDeviceMemoryOperations.h index cd6d86909e..52c887a84a 100644 --- a/src/TNL/Algorithms/MultiDeviceMemoryOperations.h +++ b/src/TNL/Algorithms/MultiDeviceMemoryOperations.h @@ -39,11 +39,11 @@ struct MultiDeviceMemoryOperations< Devices::Cuda, DeviceType > { template< typename DestinationElement, typename SourceElement, typename Index > static void - copy( DestinationElement* destination, const SourceElement* source, const Index size ); + copy( DestinationElement* destination, const SourceElement* source, Index size ); template< typename DestinationElement, typename SourceElement, typename Index > static bool - compare( const DestinationElement* destination, const SourceElement* source, const Index size ); + compare( const DestinationElement* destination, const SourceElement* source, Index size ); }; template< typename DeviceType > @@ -51,11 +51,11 @@ struct MultiDeviceMemoryOperations< DeviceType, Devices::Cuda > { template< typename DestinationElement, typename SourceElement, typename Index > static void - copy( DestinationElement* destination, const SourceElement* source, const Index size ); + copy( DestinationElement* destination, const SourceElement* source, Index size ); template< typename Element1, typename Element2, typename Index > static bool - compare( const Element1* destination, const Element2* source, const Index size ); + compare( const Element1* destination, const Element2* source, Index size ); }; // CUDA <-> CUDA to disambiguate from partial specializations below diff --git a/src/TNL/Algorithms/Multireduction.h b/src/TNL/Algorithms/Multireduction.h index a9cbc8838a..cb70b52aa0 100644 --- a/src/TNL/Algorithms/Multireduction.h +++ b/src/TNL/Algorithms/Multireduction.h @@ -40,12 +40,7 @@ struct Multireduction< Devices::Sequential > */ template< typename Result, typename DataFetcher, typename Reduction, typename Index > static constexpr void - reduce( const Result identity, - DataFetcher dataFetcher, - const Reduction reduction, - const Index size, - const int n, - Result* result ); + reduce( Result identity, DataFetcher dataFetcher, Reduction reduction, Index size, int n, Result* result ); }; template<> @@ -68,12 +63,7 @@ struct Multireduction< Devices::Host > */ template< typename Result, typename DataFetcher, typename Reduction, typename Index > static void - reduce( const Result identity, - DataFetcher dataFetcher, - const Reduction reduction, - const Index size, - const int n, - Result* result ); + reduce( Result identity, DataFetcher dataFetcher, Reduction reduction, Index size, int n, Result* result ); }; template<> @@ -96,12 +86,7 @@ struct Multireduction< Devices::Cuda > */ template< typename Result, typename DataFetcher, typename Reduction, typename Index > static void - reduce( const Result identity, - DataFetcher dataFetcher, - const Reduction reduction, - const Index size, - const int n, - Result* hostResult ); + reduce( Result identity, DataFetcher dataFetcher, Reduction reduction, Index size, int n, Result* hostResult ); }; } // namespace Algorithms diff --git a/src/TNL/Algorithms/Segments/BiEllpack.h b/src/TNL/Algorithms/Segments/BiEllpack.h index 0c587558fc..a89f7d6df4 100644 --- a/src/TNL/Algorithms/Segments/BiEllpack.h +++ b/src/TNL/Algorithms/Segments/BiEllpack.h @@ -85,7 +85,7 @@ public: reset(); IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /** * \brief Number segments. @@ -100,11 +100,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const IndexType segmentIdx, const IndexType localIdx ) const; + getGlobalIndex( IndexType segmentIdx, IndexType localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call @@ -196,10 +196,10 @@ protected: verifyRowLengths( const SizesHolder& segmentsSizes ); IndexType - getStripLength( const IndexType stripIdx ) const; + getStripLength( IndexType stripIdx ) const; IndexType - getGroupLength( const IndexType strip, const IndexType group ) const; + getGroupLength( IndexType strip, IndexType group ) const; IndexType size = 0, storageSize = 0; diff --git a/src/TNL/Algorithms/Segments/BiEllpackView.h b/src/TNL/Algorithms/Segments/BiEllpackView.h index 3de2183d54..62b0e0a3e3 100644 --- a/src/TNL/Algorithms/Segments/BiEllpackView.h +++ b/src/TNL/Algorithms/Segments/BiEllpackView.h @@ -45,16 +45,16 @@ public: BiEllpackView() = default; __cuda_callable__ - BiEllpackView( const IndexType size, - const IndexType storageSize, - const IndexType virtualRows, + BiEllpackView( IndexType size, + IndexType storageSize, + IndexType virtualRows, const OffsetsView& rowPermArray, const OffsetsView& groupPointers ); __cuda_callable__ - BiEllpackView( const IndexType size, - const IndexType storageSize, - const IndexType virtualRows, + BiEllpackView( IndexType size, + IndexType storageSize, + IndexType virtualRows, const OffsetsView&& rowPermArray, const OffsetsView&& groupPointers ); @@ -90,7 +90,7 @@ public: */ __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /*** * \brief Returns number of elements managed by all segments. @@ -108,11 +108,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/CSR.h b/src/TNL/Algorithms/Segments/CSR.h index 0c002e10c3..7050a16e87 100644 --- a/src/TNL/Algorithms/Segments/CSR.h +++ b/src/TNL/Algorithms/Segments/CSR.h @@ -246,7 +246,7 @@ public: */ __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /*** * \brief Returns number of elements managed by all segments. @@ -277,7 +277,7 @@ public: */ __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; /** * \brief Returns segment view (i.e. segment accessor) of segment with given index. @@ -292,7 +292,7 @@ public: */ __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /** * \brief Returns reference on constant vector with row offsets used in the CSR format. diff --git a/src/TNL/Algorithms/Segments/CSRView.h b/src/TNL/Algorithms/Segments/CSRView.h index 05d2027d55..eb8c5df844 100644 --- a/src/TNL/Algorithms/Segments/CSRView.h +++ b/src/TNL/Algorithms/Segments/CSRView.h @@ -84,7 +84,7 @@ public: */ __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /*** * \brief Returns number of elements managed by all segments. @@ -102,11 +102,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/ChunkedEllpack.h b/src/TNL/Algorithms/Segments/ChunkedEllpack.h index e145660165..77a389d41d 100644 --- a/src/TNL/Algorithms/Segments/ChunkedEllpack.h +++ b/src/TNL/Algorithms/Segments/ChunkedEllpack.h @@ -94,7 +94,7 @@ public: reset(); IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /** * \brief Number segments. @@ -109,11 +109,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call @@ -180,7 +180,7 @@ protected: template< typename SegmentsSizes > bool - setSlice( SegmentsSizes& rowLengths, const IndexType sliceIdx, IndexType& elementsToAllocation ); + setSlice( SegmentsSizes& rowLengths, IndexType sliceIdx, IndexType& elementsToAllocation ); IndexType size = 0, storageSize = 0; diff --git a/src/TNL/Algorithms/Segments/ChunkedEllpackView.h b/src/TNL/Algorithms/Segments/ChunkedEllpackView.h index d04ac0b3e1..f852d81bde 100644 --- a/src/TNL/Algorithms/Segments/ChunkedEllpackView.h +++ b/src/TNL/Algorithms/Segments/ChunkedEllpackView.h @@ -54,28 +54,28 @@ public: ChunkedEllpackView() = default; __cuda_callable__ - ChunkedEllpackView( const IndexType size, - const IndexType storageSize, - const IndexType chunksInSlice, - const IndexType desiredChunkSize, + ChunkedEllpackView( IndexType size, + IndexType storageSize, + IndexType chunksInSlice, + IndexType desiredChunkSize, const OffsetsView& rowToChunkMapping, const OffsetsView& rowToSliceMapping, const OffsetsView& chunksToSegmentsMapping, const OffsetsView& rowPointers, const ChunkedEllpackSliceInfoContainerView& slices, - const IndexType numberOfSlices ); + IndexType numberOfSlices ); __cuda_callable__ - ChunkedEllpackView( const IndexType size, - const IndexType storageSize, - const IndexType chunksInSlice, - const IndexType desiredChunkSize, + ChunkedEllpackView( IndexType size, + IndexType storageSize, + IndexType chunksInSlice, + IndexType desiredChunkSize, const OffsetsView&& rowToChunkMapping, const OffsetsView&& rowToSliceMapping, const OffsetsView&& chunksToSegmentsMapping, const OffsetsView&& rowPointers, const ChunkedEllpackSliceInfoContainerView&& slices, - const IndexType numberOfSlices ); + IndexType numberOfSlices ); __cuda_callable__ ChunkedEllpackView( const ChunkedEllpackView& chunked_ellpack_view ) = default; @@ -109,7 +109,7 @@ public: */ __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /*** * \brief Returns number of elements managed by all segments. @@ -127,11 +127,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/Ellpack.h b/src/TNL/Algorithms/Segments/Ellpack.h index c36c6ccf2c..32663314b0 100644 --- a/src/TNL/Algorithms/Segments/Ellpack.h +++ b/src/TNL/Algorithms/Segments/Ellpack.h @@ -56,7 +56,7 @@ public: template< typename ListIndex > Ellpack( const std::initializer_list< ListIndex >& segmentsSizes ); - Ellpack( const IndexType segmentsCount, const IndexType segmentSize ); + Ellpack( IndexType segmentsCount, IndexType segmentSize ); Ellpack( const Ellpack& segments ) = default; @@ -82,7 +82,7 @@ public: setSegmentsSizes( const SizesHolder& sizes ); void - setSegmentsSizes( const IndexType segmentsCount, const IndexType segmentSize ); + setSegmentsSizes( IndexType segmentsCount, IndexType segmentSize ); void reset(); @@ -96,7 +96,7 @@ public: __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; __cuda_callable__ IndexType @@ -108,11 +108,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/EllpackView.h b/src/TNL/Algorithms/Segments/EllpackView.h index 9d8a67ea56..43a769fbb7 100644 --- a/src/TNL/Algorithms/Segments/EllpackView.h +++ b/src/TNL/Algorithms/Segments/EllpackView.h @@ -98,7 +98,7 @@ public: __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; __cuda_callable__ IndexType @@ -110,11 +110,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.h b/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.h index f3681808fc..2a05964d9c 100644 --- a/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.h +++ b/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernel.h @@ -100,7 +100,7 @@ struct CSRAdaptiveKernel protected: template< int SizeOfValue, typename Offsets > Index - findLimit( const Index start, const Offsets& offsets, const Index size, detail::Type& type, size_t& sum ); + findLimit( Index start, const Offsets& offsets, Index size, detail::Type& type, size_t& sum ); template< int SizeOfValue, typename Offsets > void diff --git a/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernelView.h b/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernelView.h index 9200d057df..5bd1f2c2e5 100644 --- a/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernelView.h +++ b/src/TNL/Algorithms/Segments/Kernels/CSRAdaptiveKernelView.h @@ -35,7 +35,7 @@ struct CSRAdaptiveKernelView CSRAdaptiveKernelView() = default; void - setBlocks( BlocksType& blocks, const int idx ); + setBlocks( BlocksType& blocks, int idx ); ViewType getView(); diff --git a/src/TNL/Algorithms/Segments/Kernels/details/CSRAdaptiveKernelParameters.h b/src/TNL/Algorithms/Segments/Kernels/details/CSRAdaptiveKernelParameters.h index e4dd80a173..80832297b7 100644 --- a/src/TNL/Algorithms/Segments/Kernels/details/CSRAdaptiveKernelParameters.h +++ b/src/TNL/Algorithms/Segments/Kernels/details/CSRAdaptiveKernelParameters.h @@ -21,7 +21,7 @@ struct CSRAdaptiveKernelParameters static constexpr int MaxValueSizeLog = 6; static constexpr int - getSizeValueLogConstexpr( const int i ); + getSizeValueLogConstexpr( int i ); static constexpr int getSizeOfValue() diff --git a/src/TNL/Algorithms/Segments/SlicedEllpack.h b/src/TNL/Algorithms/Segments/SlicedEllpack.h index da9298e34f..766f867f8b 100644 --- a/src/TNL/Algorithms/Segments/SlicedEllpack.h +++ b/src/TNL/Algorithms/Segments/SlicedEllpack.h @@ -88,7 +88,7 @@ public: __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /** * \brief Number segments. @@ -103,11 +103,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/SlicedEllpackView.h b/src/TNL/Algorithms/Segments/SlicedEllpackView.h index 3004ed9cb2..d7c4904932 100644 --- a/src/TNL/Algorithms/Segments/SlicedEllpackView.h +++ b/src/TNL/Algorithms/Segments/SlicedEllpackView.h @@ -85,7 +85,7 @@ public: __cuda_callable__ IndexType - getSegmentSize( const IndexType segmentIdx ) const; + getSegmentSize( IndexType segmentIdx ) const; /** * \brief Number segments. @@ -100,11 +100,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ SegmentViewType - getSegmentView( const IndexType segmentIdx ) const; + getSegmentView( IndexType segmentIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/Segments/detail/CSR.h b/src/TNL/Algorithms/Segments/detail/CSR.h index 943d9098eb..7d0c982952 100644 --- a/src/TNL/Algorithms/Segments/detail/CSR.h +++ b/src/TNL/Algorithms/Segments/detail/CSR.h @@ -80,11 +80,11 @@ public: __cuda_callable__ IndexType - getGlobalIndex( const Index segmentIdx, const Index localIdx ) const; + getGlobalIndex( Index segmentIdx, Index localIdx ) const; __cuda_callable__ void - getSegmentAndLocalIndex( const Index globalIdx, Index& segmentIdx, Index& localIdx ) const; + getSegmentAndLocalIndex( Index globalIdx, Index& segmentIdx, Index& localIdx ) const; /*** * \brief Go over all segments and for each segment element call diff --git a/src/TNL/Algorithms/detail/Reduction.h b/src/TNL/Algorithms/detail/Reduction.h index 75dd0d6a4c..3a839d0ab7 100644 --- a/src/TNL/Algorithms/detail/Reduction.h +++ b/src/TNL/Algorithms/detail/Reduction.h @@ -26,11 +26,11 @@ struct Reduction< Devices::Sequential > { template< typename Index, typename Result, typename Fetch, typename Reduce > static constexpr Result - reduce( const Index begin, const Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); + reduce( Index begin, Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); template< typename Index, typename Result, typename Fetch, typename Reduce > static constexpr std::pair< Result, Index > - reduceWithArgument( const Index begin, const Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); + reduceWithArgument( Index begin, Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); }; template<> @@ -38,11 +38,11 @@ struct Reduction< Devices::Host > { template< typename Index, typename Result, typename Fetch, typename Reduce > static Result - reduce( const Index begin, const Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); + reduce( Index begin, Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); template< typename Index, typename Result, typename Fetch, typename Reduce > static std::pair< Result, Index > - reduceWithArgument( const Index begin, const Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); + reduceWithArgument( Index begin, Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); }; template<> @@ -50,11 +50,11 @@ struct Reduction< Devices::Cuda > { template< typename Index, typename Result, typename Fetch, typename Reduce > static Result - reduce( const Index begin, const Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); + reduce( Index begin, Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); template< typename Index, typename Result, typename Fetch, typename Reduce > static std::pair< Result, Index > - reduceWithArgument( const Index begin, const Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); + reduceWithArgument( Index begin, Index end, Fetch&& fetch, Reduce&& reduce, const Result& identity ); }; } // namespace detail diff --git a/src/TNL/Benchmarks/Benchmarks.h b/src/TNL/Benchmarks/Benchmarks.h index a6e660b203..2422eb4757 100644 --- a/src/TNL/Benchmarks/Benchmarks.h +++ b/src/TNL/Benchmarks/Benchmarks.h @@ -100,8 +100,8 @@ public: // Sets the dataset size and base time for the calculations of bandwidth // and speedup in the benchmarks result. void - setDatasetSize( const double datasetSize = 0.0, // in GB - const double baseTime = 0.0 ); + setDatasetSize( double datasetSize = 0.0, // in GB + double baseTime = 0.0 ); // Sets current operation -- operations expand the table vertically // - baseTime should be reset to 0.0 for most operations, but sometimes @@ -110,8 +110,8 @@ public: // easily sorted while converting to HTML.) void setOperation( const String& operation, - const double datasetSize = 0.0, // in GB - const double baseTime = 0.0 ); + double datasetSize = 0.0, // in GB + double baseTime = 0.0 ); // Times a single ComputeFunction. Subsequent calls implicitly split // the current operation into sub-columns identified by "performer", diff --git a/src/TNL/Containers/ArrayView.h b/src/TNL/Containers/ArrayView.h index 1f7e16a194..0fc46495a3 100644 --- a/src/TNL/Containers/ArrayView.h +++ b/src/TNL/Containers/ArrayView.h @@ -603,11 +603,11 @@ operator<<( std::ostream& str, const ArrayView< Value, Device, Index >& view ); */ template< typename Value, typename Device, typename Index > File& -operator<<( File& file, const ArrayView< Value, Device, Index > view ); +operator<<( File& file, ArrayView< Value, Device, Index > view ); template< typename Value, typename Device, typename Index > File& -operator<<( File&& file, const ArrayView< Value, Device, Index > view ); +operator<<( File&& file, ArrayView< Value, Device, Index > view ); /** * \brief Deserialization of array views from binary files. diff --git a/src/TNL/FileName.h b/src/TNL/FileName.h index 958eaf509c..d64dff321b 100644 --- a/src/TNL/FileName.h +++ b/src/TNL/FileName.h @@ -73,7 +73,7 @@ public: * @param index Index of the file name. */ void - setIndex( const size_t index ); + setIndex( size_t index ); /** * \brief Sets number of digits for index of the file name. @@ -81,7 +81,7 @@ public: * @param digitsCount Number of digits. It is 5 by default. */ void - setDigitsCount( const size_t digitsCount ); + setDigitsCount( size_t digitsCount ); /** * \brief Sets the distributed system node ID as integer, for example MPI process ID. @@ -144,7 +144,7 @@ protected: * @return Extension of the given file name. */ String -getFileExtension( const String fileName ); +getFileExtension( String fileName ); /** * \brief Cuts off the file extension. diff --git a/src/TNL/Images/DicomSeries.h b/src/TNL/Images/DicomSeries.h index 3c9d9fa7c1..b4bb706407 100644 --- a/src/TNL/Images/DicomSeries.h +++ b/src/TNL/Images/DicomSeries.h @@ -60,10 +60,7 @@ public: template< typename Real, typename Device, typename Index, typename Vector > bool - getImage( const int imageIdx, - const Meshes::Grid< 2, Real, Device, Index >& grid, - const RegionOfInterest< int > roi, - Vector& vector ); + getImage( int imageIdx, const Meshes::Grid< 2, Real, Device, Index >& grid, RegionOfInterest< int > roi, Vector& vector ); #ifdef HAVE_DCMTK_H inline const Uint16* diff --git a/src/TNL/Images/JPEGImage.h b/src/TNL/Images/JPEGImage.h index 65c23cc7f1..79c7c6c927 100644 --- a/src/TNL/Images/JPEGImage.h +++ b/src/TNL/Images/JPEGImage.h @@ -38,7 +38,7 @@ public: template< typename MeshReal, typename Device, typename Real > bool - read( const RegionOfInterest< Index > roi, + read( RegionOfInterest< Index > roi, Functions::MeshFunction< Meshes::Grid< 2, MeshReal, Device, Index >, 2, Real >& function ); template< typename Real, typename Device > diff --git a/src/TNL/Images/PGMImage.h b/src/TNL/Images/PGMImage.h index 8fc3d7c3d5..c8cf365abf 100644 --- a/src/TNL/Images/PGMImage.h +++ b/src/TNL/Images/PGMImage.h @@ -29,7 +29,7 @@ public: template< typename MeshReal, typename Device, typename Real > bool - read( const RegionOfInterest< Index > roi, + read( RegionOfInterest< Index > roi, Functions::MeshFunction< Meshes::Grid< 2, MeshReal, Device, Index >, 2, Real >& function ); template< typename Real, typename Device > diff --git a/src/TNL/Images/PNGImage.h b/src/TNL/Images/PNGImage.h index fdf5794043..5fbdefa42c 100644 --- a/src/TNL/Images/PNGImage.h +++ b/src/TNL/Images/PNGImage.h @@ -31,7 +31,7 @@ public: template< typename MeshReal, typename Device, typename Real > bool - read( const RegionOfInterest< Index > roi, + read( RegionOfInterest< Index > roi, Functions::MeshFunction< Meshes::Grid< 2, MeshReal, Device, Index >, 2, Real >& function ); template< typename Real, typename Device > diff --git a/src/TNL/Images/RegionOfInterest.h b/src/TNL/Images/RegionOfInterest.h index e565574098..5851725eaf 100644 --- a/src/TNL/Images/RegionOfInterest.h +++ b/src/TNL/Images/RegionOfInterest.h @@ -48,7 +48,7 @@ public: setGrid( Grid& grid, bool verbose = false ); bool - isIn( const Index row, const Index column ) const; + isIn( Index row, Index column ) const; protected: Index top, bottom, left, right; diff --git a/src/TNL/Matrices/DenseMatrix.h b/src/TNL/Matrices/DenseMatrix.h index 9f30845269..90d0c08893 100644 --- a/src/TNL/Matrices/DenseMatrix.h +++ b/src/TNL/Matrices/DenseMatrix.h @@ -162,7 +162,7 @@ public: * \param columns is number of matrix columns. * \param allocator is used for allocation of matrix elements values. */ - DenseMatrix( const IndexType rows, const IndexType columns, const RealAllocatorType& allocator = RealAllocatorType() ); + DenseMatrix( IndexType rows, IndexType columns, const RealAllocatorType& allocator = RealAllocatorType() ); /** * \brief Constructor with 2D initializer list. @@ -231,7 +231,7 @@ public: * \param columns is the number of matrix columns. */ void - setDimensions( const IndexType rows, const IndexType columns ) override; + setDimensions( IndexType rows, IndexType columns ) override; /** * \brief Set the number of matrix rows and columns by the given matrix. @@ -376,7 +376,7 @@ public: */ __cuda_callable__ Real& - operator()( const IndexType row, const IndexType column ); + operator()( IndexType row, IndexType column ); /** * \brief Returns constant reference to element at row \e row and column column. @@ -391,7 +391,7 @@ public: */ __cuda_callable__ const Real& - operator()( const IndexType row, const IndexType column ) const; + operator()( IndexType row, IndexType column ) const; /** * \brief Sets element at given \e row and \e column to given \e value. @@ -414,7 +414,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -440,10 +440,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator = 1.0 ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -468,7 +465,7 @@ public: */ __cuda_callable__ Real - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for iteration over all matrix rows for constant instances. @@ -926,8 +923,8 @@ public: OutVector& outVector, const RealType& matrixMultiplicator = 1.0, const RealType& outVectorMultiplicator = 0.0, - const IndexType begin = 0, - const IndexType end = 0 ) const; + IndexType begin = 0, + IndexType end = 0 ) const; template< typename Matrix > void @@ -1110,7 +1107,7 @@ public: protected: __cuda_callable__ IndexType - getElementIndex( const IndexType row, const IndexType column ) const; + getElementIndex( IndexType row, IndexType column ) const; SegmentsType segments; diff --git a/src/TNL/Matrices/DenseMatrixRowView.h b/src/TNL/Matrices/DenseMatrixRowView.h index 80e8d9f505..15295e34a8 100644 --- a/src/TNL/Matrices/DenseMatrixRowView.h +++ b/src/TNL/Matrices/DenseMatrixRowView.h @@ -116,7 +116,7 @@ public: */ __cuda_callable__ const RealType& - getValue( const IndexType column ) const; + getValue( IndexType column ) const; /** * \brief Returns non-constants reference to an element with given column index. @@ -127,7 +127,7 @@ public: */ __cuda_callable__ RealType& - getValue( const IndexType column ); + getValue( IndexType column ); /** * \brief This method is only for compatibility with sparse matrix row. @@ -138,7 +138,7 @@ public: */ __cuda_callable__ IndexType - getColumnIndex( const IndexType localIdx ) const; + getColumnIndex( IndexType localIdx ) const; /** * \brief Sets value of matrix element with given column index @@ -148,7 +148,7 @@ public: */ __cuda_callable__ void - setValue( const IndexType column, const RealType& value ); + setValue( IndexType column, const RealType& value ); /** * \brief Sets value of matrix element with given column index @@ -161,7 +161,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType localIdx, const IndexType column, const RealType& value ); + setElement( IndexType localIdx, IndexType column, const RealType& value ); /** * \brief Returns iterator pointing at the beginning of the matrix row. diff --git a/src/TNL/Matrices/DenseMatrixView.h b/src/TNL/Matrices/DenseMatrixView.h index 78dac42c23..2f4e5d6e62 100644 --- a/src/TNL/Matrices/DenseMatrixView.h +++ b/src/TNL/Matrices/DenseMatrixView.h @@ -132,7 +132,7 @@ public: * \include DenseMatrixViewExample_constructor.out */ __cuda_callable__ - DenseMatrixView( const IndexType rows, const IndexType columns, const ValuesViewType& values ); + DenseMatrixView( IndexType rows, IndexType columns, const ValuesViewType& values ); /** * \brief Constructor with matrix dimensions and values. @@ -150,9 +150,7 @@ public: */ template< typename Real_ > __cuda_callable__ - DenseMatrixView( const IndexType rows, - const IndexType columns, - const Containers::VectorView< Real_, Device, Index >& values ); + DenseMatrixView( IndexType rows, IndexType columns, const Containers::VectorView< Real_, Device, Index >& values ); /** * \brief Copy constructor. @@ -313,7 +311,7 @@ public: */ __cuda_callable__ Real& - operator()( const IndexType row, const IndexType column ); + operator()( IndexType row, IndexType column ); /** * \brief Returns constant reference to element at row \e row and column column. @@ -328,7 +326,7 @@ public: */ __cuda_callable__ const Real& - operator()( const IndexType row, const IndexType column ) const; + operator()( IndexType row, IndexType column ) const; /** * \brief Sets element at given \e row and \e column to given \e value. @@ -351,7 +349,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -377,10 +375,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator = 1.0 ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -405,7 +400,7 @@ public: */ __cuda_callable__ Real - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows. @@ -864,7 +859,7 @@ public: OutVector& outVector, const RealType& matrixMultiplicator = 1.0, const RealType& outVectorMultiplicator = 0.0, - const IndexType begin = 0, + IndexType begin = 0, IndexType end = 0 ) const; template< typename Matrix > @@ -962,7 +957,7 @@ public: protected: __cuda_callable__ IndexType - getElementIndex( const IndexType row, const IndexType column ) const; + getElementIndex( IndexType row, IndexType column ) const; SegmentsViewType segments; }; diff --git a/src/TNL/Matrices/Matrix.h b/src/TNL/Matrices/Matrix.h index 24560c99d6..cb57f0b2d7 100644 --- a/src/TNL/Matrices/Matrix.h +++ b/src/TNL/Matrices/Matrix.h @@ -103,7 +103,7 @@ public: * \param columns is a number of matrix columns. * \param allocator is a user defined allocator of the matrix values. */ - Matrix( const IndexType rows, const IndexType columns, const RealAllocatorType& allocator = RealAllocatorType() ); + Matrix( IndexType rows, IndexType columns, const RealAllocatorType& allocator = RealAllocatorType() ); /** * \brief Method for setting or changing of the matrix dimensions. @@ -112,7 +112,7 @@ public: * \param columns is a number of matrix columns. */ virtual void - setDimensions( const IndexType rows, const IndexType columns ); + setDimensions( IndexType rows, IndexType columns ); /** * \brief Set the matrix dimensions to be equal to those of the input matrix. diff --git a/src/TNL/Matrices/MatrixReader.h b/src/TNL/Matrices/MatrixReader.h index 91a4f525e4..78879111a9 100644 --- a/src/TNL/Matrices/MatrixReader.h +++ b/src/TNL/Matrices/MatrixReader.h @@ -134,8 +134,8 @@ protected: static void computeCompressedRowLengthsFromMtxFile( std::istream& file, Containers::Vector< int, DeviceType, int >& rowLengths, - const int columns, - const int rows, + int columns, + int rows, bool symmetricSourceMatrix, bool symmetricTargetMatrix, bool verbose ); diff --git a/src/TNL/Matrices/MatrixView.h b/src/TNL/Matrices/MatrixView.h index f3aa4adabb..7c79fc5892 100644 --- a/src/TNL/Matrices/MatrixView.h +++ b/src/TNL/Matrices/MatrixView.h @@ -86,7 +86,7 @@ public: * @param values is a vector view with matrix elements values. */ __cuda_callable__ - MatrixView( const IndexType rows, const IndexType columns, const ValuesView& values ); + MatrixView( IndexType rows, IndexType columns, const ValuesView& values ); /** * @brief Shallow copy constructor. diff --git a/src/TNL/Matrices/MultidiagonalMatrix.h b/src/TNL/Matrices/MultidiagonalMatrix.h index 2fca9ad84a..7ece154907 100644 --- a/src/TNL/Matrices/MultidiagonalMatrix.h +++ b/src/TNL/Matrices/MultidiagonalMatrix.h @@ -171,7 +171,7 @@ public: * \param rows is number of matrix rows. * \param columns is number of matrix columns. */ - MultidiagonalMatrix( const IndexType rows, const IndexType columns ); + MultidiagonalMatrix( IndexType rows, IndexType columns ); /** * \brief Constructor with matrix dimensions and matrix elements offsets. @@ -186,7 +186,7 @@ public: * \include MultidiagonalMatrixExample_Constructor.out */ template< typename Vector > - MultidiagonalMatrix( const IndexType rows, const IndexType columns, const Vector& diagonalsOffsets ); + MultidiagonalMatrix( IndexType rows, IndexType columns, const Vector& diagonalsOffsets ); /** * \brief Constructor with matrix dimensions and diagonals offsets. @@ -201,9 +201,7 @@ public: * \include MultidiagonalMatrixExample_Constructor_init_list_1.out */ template< typename ListIndex > - MultidiagonalMatrix( const IndexType rows, - const IndexType columns, - const std::initializer_list< ListIndex > diagonalsOffsets ); + MultidiagonalMatrix( IndexType rows, IndexType columns, std::initializer_list< ListIndex > diagonalsOffsets ); /** * \brief Constructor with matrix dimensions, diagonals offsets and matrix elements. @@ -226,8 +224,8 @@ public: * \include MultidiagonalMatrixExample_Constructor_init_list_2.out */ template< typename ListIndex, typename ListReal > - MultidiagonalMatrix( const IndexType columns, - const std::initializer_list< ListIndex > diagonalsOffsets, + MultidiagonalMatrix( IndexType columns, + std::initializer_list< ListIndex > diagonalsOffsets, const std::initializer_list< std::initializer_list< ListReal > >& data ); /** @@ -306,7 +304,7 @@ public: */ template< typename Vector > void - setDimensions( const IndexType rows, const IndexType columns, const Vector& diagonalsOffsets ); + setDimensions( IndexType rows, IndexType columns, const Vector& diagonalsOffsets ); /** * @brief Set the diagonals offsets by means of vector-like container. @@ -330,7 +328,7 @@ public: */ template< typename ListIndex > void - setDiagonalsOffsets( const std::initializer_list< ListIndex > diagonalsOffsets ); + setDiagonalsOffsets( std::initializer_list< ListIndex > diagonalsOffsets ); /** * \brief This method is for compatibility with \ref SparseMatrix. @@ -410,7 +408,7 @@ public: getCompressedRowLengths( Vector& rowLengths ) const; [[deprecated]] IndexType - getRowLength( const IndexType row ) const; + getRowLength( IndexType row ) const; /** * \brief Setup the matrix dimensions and diagonals offsets based on another multidiagonal matrix. @@ -562,7 +560,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -589,10 +587,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator = 1.0 ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -617,7 +612,7 @@ public: */ __cuda_callable__ RealType - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows. @@ -1084,9 +1079,9 @@ public: void vectorProduct( const InVector& inVector, OutVector& outVector, - const RealType matrixMultiplicator = 1.0, - const RealType outVectorMultiplicator = 0.0, - const IndexType begin = 0, + RealType matrixMultiplicator = 1.0, + RealType outVectorMultiplicator = 0.0, + IndexType begin = 0, IndexType end = 0 ) const; template< typename Real_, typename Device_, typename Index_, ElementsOrganization Organization_, typename RealAllocator_ > diff --git a/src/TNL/Matrices/MultidiagonalMatrixRowView.h b/src/TNL/Matrices/MultidiagonalMatrixRowView.h index a6fd3964d2..bb0fa35fcd 100644 --- a/src/TNL/Matrices/MultidiagonalMatrixRowView.h +++ b/src/TNL/Matrices/MultidiagonalMatrixRowView.h @@ -108,7 +108,7 @@ public: * \param indexer is object responsible for indexing and organization of matrix elements */ __cuda_callable__ - MultidiagonalMatrixRowView( const IndexType rowIdx, + MultidiagonalMatrixRowView( IndexType rowIdx, const DiagonalsOffsetsView& diagonalsOffsets, const ValuesViewType& values, const IndexerType& indexer ); @@ -140,7 +140,7 @@ public: */ __cuda_callable__ const IndexType - getColumnIndex( const IndexType localIdx ) const; + getColumnIndex( IndexType localIdx ) const; /** * \brief Returns value of matrix element on given subdiagonal. @@ -151,7 +151,7 @@ public: */ __cuda_callable__ const RealType& - getValue( const IndexType localIdx ) const; + getValue( IndexType localIdx ) const; /** * \brief Returns value of matrix element on given subdiagonal. @@ -162,7 +162,7 @@ public: */ __cuda_callable__ RealType& - getValue( const IndexType localIdx ); + getValue( IndexType localIdx ); /** * \brief Changes value of matrix element on given subdiagonal. @@ -172,7 +172,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType localIdx, const RealType& value ); + setElement( IndexType localIdx, const RealType& value ); /** * \brief Returns iterator pointing at the beginning of the matrix row. diff --git a/src/TNL/Matrices/MultidiagonalMatrixView.h b/src/TNL/Matrices/MultidiagonalMatrixView.h index 2ee18d1d3f..54a67446c3 100644 --- a/src/TNL/Matrices/MultidiagonalMatrixView.h +++ b/src/TNL/Matrices/MultidiagonalMatrixView.h @@ -199,7 +199,7 @@ public: getCompressedRowLengths( Vector& rowLengths ) const; [[deprecated]] IndexType - getRowLength( const IndexType row ) const; + getRowLength( IndexType row ) const; /** * \brief Returns number of non-zero matrix elements. @@ -308,7 +308,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -334,10 +334,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator = 1.0 ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -361,7 +358,7 @@ public: */ __cuda_callable__ RealType - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows for constant instances. @@ -823,9 +820,9 @@ public: void vectorProduct( const InVector& inVector, OutVector& outVector, - const RealType matrixMultiplicator = 1.0, - const RealType outVectorMultiplicator = 0.0, - const IndexType begin = 0, + RealType matrixMultiplicator = 1.0, + RealType outVectorMultiplicator = 0.0, + IndexType begin = 0, IndexType end = 0 ) const; template< typename Real_, typename Device_, typename Index_, ElementsOrganization Organization_ > diff --git a/src/TNL/Matrices/Sandbox/SparseSandboxMatrix.h b/src/TNL/Matrices/Sandbox/SparseSandboxMatrix.h index d6c8232e05..ddc9964a44 100644 --- a/src/TNL/Matrices/Sandbox/SparseSandboxMatrix.h +++ b/src/TNL/Matrices/Sandbox/SparseSandboxMatrix.h @@ -256,8 +256,8 @@ public: * \param indexAllocator is used for allocation of matrix elements column indexes. */ template< typename Index_t, std::enable_if_t< std::is_integral< Index_t >::value, int > = 0 > - SparseSandboxMatrix( const Index_t rows, - const Index_t columns, + SparseSandboxMatrix( Index_t rows, + Index_t columns, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -280,7 +280,7 @@ public: */ template< typename ListIndex > explicit SparseSandboxMatrix( const std::initializer_list< ListIndex >& rowCapacities, - const IndexType columns, + IndexType columns, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -305,7 +305,7 @@ public: */ template< typename RowCapacitiesVector, std::enable_if_t< TNL::IsArrayType< RowCapacitiesVector >::value, int > = 0 > explicit SparseSandboxMatrix( const RowCapacitiesVector& rowCapacities, - const IndexType columns, + IndexType columns, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -328,8 +328,8 @@ public: * \par Output * \include SparseMatrixExample_Constructor_init_list_2.out */ - explicit SparseSandboxMatrix( const IndexType rows, - const IndexType columns, + explicit SparseSandboxMatrix( IndexType rows, + IndexType columns, const std::initializer_list< std::tuple< IndexType, IndexType, RealType > >& data, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -356,8 +356,8 @@ public: * \include SparseMatrixExample_Constructor_std_map.out */ template< typename MapIndex, typename MapValue > - explicit SparseSandboxMatrix( const IndexType rows, - const IndexType columns, + explicit SparseSandboxMatrix( IndexType rows, + IndexType columns, const std::map< std::pair< MapIndex, MapIndex >, MapValue >& map, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -420,7 +420,7 @@ public: * \param columns is the number of matrix columns. */ void - setDimensions( const IndexType rows, const IndexType columns ) override; + setDimensions( IndexType rows, IndexType columns ) override; /** * \brief Set the number of matrix rows and columns by the given matrix. @@ -532,7 +532,7 @@ public: */ __cuda_callable__ IndexType - getRowCapacity( const IndexType row ) const; + getRowCapacity( IndexType row ) const; /** * \brief Returns number of non-zero matrix elements. @@ -609,7 +609,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -636,7 +636,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -661,7 +661,7 @@ public: */ __cuda_callable__ RealType - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows. @@ -1047,8 +1047,8 @@ public: OutVector& outVector, const RealType& matrixMultiplicator = 1.0, const RealType& outVectorMultiplicator = 0.0, - const IndexType firstRow = 0, - const IndexType lastRow = 0 ) const; + IndexType firstRow = 0, + IndexType lastRow = 0 ) const; /*template< typename Real2, typename Index2 > void addMatrix( const SparseMatrix< Real2, Segments, Device, Index2 >& matrix, @@ -1062,7 +1062,7 @@ public: template< typename Vector1, typename Vector2 > bool - performSORIteration( const Vector1& b, const IndexType row, Vector2& x, const RealType& omega = 1.0 ) const; + performSORIteration( const Vector1& b, IndexType row, Vector2& x, const RealType& omega = 1.0 ) const; /** * \brief Assignment of exactly the same matrix type. diff --git a/src/TNL/Matrices/Sandbox/SparseSandboxMatrixRowView.h b/src/TNL/Matrices/Sandbox/SparseSandboxMatrixRowView.h index c7ec9900a6..54fbc07710 100644 --- a/src/TNL/Matrices/Sandbox/SparseSandboxMatrixRowView.h +++ b/src/TNL/Matrices/Sandbox/SparseSandboxMatrixRowView.h @@ -141,7 +141,7 @@ public: */ __cuda_callable__ const IndexType& - getColumnIndex( const IndexType localIdx ) const; + getColumnIndex( IndexType localIdx ) const; /** * \brief Returns non-constants reference to a column index of an element with given rank in the row. @@ -152,7 +152,7 @@ public: */ __cuda_callable__ IndexType& - getColumnIndex( const IndexType localIdx ); + getColumnIndex( IndexType localIdx ); /** * \brief Returns constants reference to value of an element with given rank in the row. @@ -163,7 +163,7 @@ public: */ __cuda_callable__ const RealType& - getValue( const IndexType localIdx ) const; + getValue( IndexType localIdx ) const; /** * \brief Returns non-constants reference to value of an element with given rank in the row. @@ -174,7 +174,7 @@ public: */ __cuda_callable__ RealType& - getValue( const IndexType localIdx ); + getValue( IndexType localIdx ); /** * \brief Sets a value of matrix element with given rank in the matrix row. @@ -184,7 +184,7 @@ public: */ __cuda_callable__ void - setValue( const IndexType localIdx, const RealType& value ); + setValue( IndexType localIdx, const RealType& value ); /** * \brief Sets a column index of matrix element with given rank in the matrix row. @@ -194,7 +194,7 @@ public: */ __cuda_callable__ void - setColumnIndex( const IndexType localIdx, const IndexType& columnIndex ); + setColumnIndex( IndexType localIdx, const IndexType& columnIndex ); /** * \brief Sets both a value and a column index of matrix element with given rank in the matrix row. @@ -205,7 +205,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType localIdx, const IndexType columnIndex, const RealType& value ); + setElement( IndexType localIdx, IndexType columnIndex, const RealType& value ); /** * \brief Comparison of two matrix rows. diff --git a/src/TNL/Matrices/Sandbox/SparseSandboxMatrixView.h b/src/TNL/Matrices/Sandbox/SparseSandboxMatrixView.h index f61b3f1b90..ad553a6916 100644 --- a/src/TNL/Matrices/Sandbox/SparseSandboxMatrixView.h +++ b/src/TNL/Matrices/Sandbox/SparseSandboxMatrixView.h @@ -160,8 +160,8 @@ public: * SANDBOX_TODO: Replace `rowPointers` with metadata by your needs. */ __cuda_callable__ - SparseSandboxMatrixView( const IndexType rows, - const IndexType columns, + SparseSandboxMatrixView( IndexType rows, + IndexType columns, const ValuesViewType& values, const ColumnsIndexesViewType& columnIndexes, const RowPointersView& rowPointers ); @@ -265,7 +265,7 @@ public: */ __cuda_callable__ IndexType - getRowCapacity( const IndexType row ) const; + getRowCapacity( IndexType row ) const; /** * \brief Returns number of non-zero matrix elements. @@ -336,7 +336,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -760,14 +760,14 @@ public: void vectorProduct( const InVector& inVector, OutVector& outVector, - const RealType matrixMultiplicator = 1.0, - const RealType outVectorMultiplicator = 0.0, - const IndexType begin = 0, + RealType matrixMultiplicator = 1.0, + RealType outVectorMultiplicator = 0.0, + IndexType begin = 0, IndexType end = 0 ) const; template< typename Vector1, typename Vector2 > bool - performSORIteration( const Vector1& b, const IndexType row, Vector2& x, const RealType& omega = 1.0 ) const; + performSORIteration( const Vector1& b, IndexType row, Vector2& x, const RealType& omega = 1.0 ) const; /** * \brief Assignment of any matrix type. diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h index 98daca49be..a6d7d4fd0b 100644 --- a/src/TNL/Matrices/SparseMatrix.h +++ b/src/TNL/Matrices/SparseMatrix.h @@ -209,8 +209,8 @@ public: * \param indexAllocator is used for allocation of matrix elements column indexes. */ template< typename Index_t, std::enable_if_t< std::is_integral< Index_t >::value, int > = 0 > - SparseMatrix( const Index_t rows, - const Index_t columns, + SparseMatrix( Index_t rows, + Index_t columns, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -233,7 +233,7 @@ public: */ template< typename ListIndex > explicit SparseMatrix( const std::initializer_list< ListIndex >& rowCapacities, - const IndexType columns, + IndexType columns, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -258,7 +258,7 @@ public: */ template< typename RowCapacitiesVector, std::enable_if_t< TNL::IsArrayType< RowCapacitiesVector >::value, int > = 0 > explicit SparseMatrix( const RowCapacitiesVector& rowCapacities, - const IndexType columns, + IndexType columns, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -281,8 +281,8 @@ public: * \par Output * \include SparseMatrixExample_Constructor_init_list_2.out */ - explicit SparseMatrix( const IndexType rows, - const IndexType columns, + explicit SparseMatrix( IndexType rows, + IndexType columns, const std::initializer_list< std::tuple< IndexType, IndexType, RealType > >& data, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -309,8 +309,8 @@ public: * \include SparseMatrixExample_Constructor_std_map.out */ template< typename MapIndex, typename MapValue > - explicit SparseMatrix( const IndexType rows, - const IndexType columns, + explicit SparseMatrix( IndexType rows, + IndexType columns, const std::map< std::pair< MapIndex, MapIndex >, MapValue >& map, const RealAllocatorType& realAllocator = RealAllocatorType(), const IndexAllocatorType& indexAllocator = IndexAllocatorType() ); @@ -373,7 +373,7 @@ public: * \param columns is the number of matrix columns. */ void - setDimensions( const IndexType rows, const IndexType columns ) override; + setDimensions( IndexType rows, IndexType columns ) override; /** * \brief Set number of columns of this matrix. @@ -497,7 +497,7 @@ public: */ __cuda_callable__ IndexType - getRowCapacity( const IndexType row ) const; + getRowCapacity( IndexType row ) const; /** * \brief Returns number of non-zero matrix elements. @@ -574,7 +574,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -601,7 +601,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, const IndexType column, const RealType& value, const RealType& thisElementMultiplicator ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -626,7 +626,7 @@ public: */ __cuda_callable__ RealType - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows. @@ -1081,8 +1081,8 @@ public: OutVector& outVector, const ComputeRealType& matrixMultiplicator = 1.0, const ComputeRealType& outVectorMultiplicator = 0.0, - const IndexType begin = 0, - const IndexType end = 0 ) const; + IndexType begin = 0, + IndexType end = 0 ) const; /*template< typename Real2, typename Index2 > void addMatrix( const SparseMatrix< Real2, Segments, Device, Index2 >& matrix, diff --git a/src/TNL/Matrices/SparseMatrixRowView.h b/src/TNL/Matrices/SparseMatrixRowView.h index 08c1f0c638..468486f4e8 100644 --- a/src/TNL/Matrices/SparseMatrixRowView.h +++ b/src/TNL/Matrices/SparseMatrixRowView.h @@ -144,7 +144,7 @@ public: */ __cuda_callable__ const IndexType& - getColumnIndex( const IndexType localIdx ) const; + getColumnIndex( IndexType localIdx ) const; /** * \brief Returns non-constants reference to a column index of an element with given rank in the row. @@ -155,7 +155,7 @@ public: */ __cuda_callable__ IndexType& - getColumnIndex( const IndexType localIdx ); + getColumnIndex( IndexType localIdx ); /** * \brief Returns constants reference to value of an element with given rank in the row. @@ -166,7 +166,7 @@ public: */ __cuda_callable__ auto - getValue( const IndexType localIdx ) const -> typename ValueGetterType::ConstResultType; + getValue( IndexType localIdx ) const -> typename ValueGetterType::ConstResultType; /** * \brief Returns non-constants reference to value of an element with given rank in the row. @@ -177,7 +177,7 @@ public: */ __cuda_callable__ auto - getValue( const IndexType localIdx ) -> typename ValueGetterType::ResultType; + getValue( IndexType localIdx ) -> typename ValueGetterType::ResultType; /** * \brief Sets a value of matrix element with given rank in the matrix row. @@ -187,7 +187,7 @@ public: */ __cuda_callable__ void - setValue( const IndexType localIdx, const RealType& value ); + setValue( IndexType localIdx, const RealType& value ); /** * \brief Sets a column index of matrix element with given rank in the matrix row. @@ -197,7 +197,7 @@ public: */ __cuda_callable__ void - setColumnIndex( const IndexType localIdx, const IndexType& columnIndex ); + setColumnIndex( IndexType localIdx, const IndexType& columnIndex ); /** * \brief Sets both a value and a column index of matrix element with given rank in the matrix row. @@ -208,7 +208,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType localIdx, const IndexType columnIndex, const RealType& value ); + setElement( IndexType localIdx, IndexType columnIndex, const RealType& value ); /** * \brief Comparison of two matrix rows. diff --git a/src/TNL/Matrices/SparseMatrixView.h b/src/TNL/Matrices/SparseMatrixView.h index 89c4d1a3b0..9ff7caaa3d 100644 --- a/src/TNL/Matrices/SparseMatrixView.h +++ b/src/TNL/Matrices/SparseMatrixView.h @@ -176,8 +176,8 @@ public: * \param segments is a segments view representing the sparse matrix format. */ __cuda_callable__ - SparseMatrixView( const IndexType rows, - const IndexType columns, + SparseMatrixView( IndexType rows, + IndexType columns, const ValuesViewType& values, const ColumnsIndexesViewType& columnIndexes, const SegmentsViewType& segments ); @@ -281,7 +281,7 @@ public: */ __cuda_callable__ IndexType - getRowCapacity( const IndexType row ) const; + getRowCapacity( IndexType row ) const; /** * \brief Returns number of non-zero matrix elements. @@ -352,7 +352,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -851,9 +851,9 @@ public: void vectorProduct( const InVector& inVector, OutVector& outVector, - const ComputeRealType matrixMultiplicator = 1.0, - const ComputeRealType outVectorMultiplicator = 0.0, - const IndexType begin = 0, + ComputeRealType matrixMultiplicator = 1.0, + ComputeRealType outVectorMultiplicator = 0.0, + IndexType begin = 0, IndexType end = 0 ) const; /** diff --git a/src/TNL/Matrices/TridiagonalMatrix.h b/src/TNL/Matrices/TridiagonalMatrix.h index 778647b3ef..47a251f7e6 100644 --- a/src/TNL/Matrices/TridiagonalMatrix.h +++ b/src/TNL/Matrices/TridiagonalMatrix.h @@ -151,7 +151,7 @@ public: * \param rows is number of matrix rows. * \param columns is number of matrix columns. */ - TridiagonalMatrix( const IndexType rows, const IndexType columns ); + TridiagonalMatrix( IndexType rows, IndexType columns ); /** * \brief Constructor with matrix dimensions, diagonals offsets and matrix elements. @@ -172,7 +172,7 @@ public: * \include TridiagonalMatrixExample_Constructor_init_list_1.out */ template< typename ListReal > - TridiagonalMatrix( const IndexType columns, const std::initializer_list< std::initializer_list< ListReal > >& data ); + TridiagonalMatrix( IndexType columns, const std::initializer_list< std::initializer_list< ListReal > >& data ); /** * \brief Copy constructor. @@ -246,7 +246,7 @@ public: * \param columns is number of matrix columns. */ void - setDimensions( const IndexType rows, const IndexType columns ) override; + setDimensions( IndexType rows, IndexType columns ) override; /** * \brief This method is for compatibility with \ref SparseMatrix. @@ -443,7 +443,7 @@ public: * \include TridiagonalMatrixExample_setElement.out */ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -469,10 +469,7 @@ public: * */ void - addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementTriplicator = 1.0 ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementTriplicator = 1.0 ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -495,7 +492,7 @@ public: * \include TridiagonalMatrixExample_getElement.out */ RealType - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows. @@ -963,9 +960,9 @@ public: void vectorProduct( const InVector& inVector, OutVector& outVector, - const RealType matrixTriplicator = 1.0, - const RealType outVectorTriplicator = 0.0, - const IndexType begin = 0, + RealType matrixTriplicator = 1.0, + RealType outVectorTriplicator = 0.0, + IndexType begin = 0, IndexType end = 0 ) const; template< typename Real_, typename Device_, typename Index_, ElementsOrganization Organization_, typename RealAllocator_ > @@ -1067,7 +1064,7 @@ public: protected: __cuda_callable__ IndexType - getElementIndex( const IndexType row, const IndexType localIdx ) const; + getElementIndex( IndexType row, IndexType localIdx ) const; IndexerType indexer; diff --git a/src/TNL/Matrices/TridiagonalMatrixRowView.h b/src/TNL/Matrices/TridiagonalMatrixRowView.h index b9213f9724..b6b7775b92 100644 --- a/src/TNL/Matrices/TridiagonalMatrixRowView.h +++ b/src/TNL/Matrices/TridiagonalMatrixRowView.h @@ -94,7 +94,7 @@ public: * \param indexer is object responsible for indexing and organization of matrix elements */ __cuda_callable__ - TridiagonalMatrixRowView( const IndexType rowIdx, const ValuesViewType& values, const IndexerType& indexer ); + TridiagonalMatrixRowView( IndexType rowIdx, const ValuesViewType& values, const IndexerType& indexer ); /** * \brief Returns number of diagonals of the tridiagonal matrix which is three. @@ -123,7 +123,7 @@ public: */ __cuda_callable__ const IndexType - getColumnIndex( const IndexType localIdx ) const; + getColumnIndex( IndexType localIdx ) const; /** * \brief Returns value of matrix element on given subdiagonal. @@ -134,7 +134,7 @@ public: */ __cuda_callable__ const RealType& - getValue( const IndexType localIdx ) const; + getValue( IndexType localIdx ) const; /** * \brief Returns value of matrix element on given subdiagonal. @@ -145,7 +145,7 @@ public: */ __cuda_callable__ RealType& - getValue( const IndexType localIdx ); + getValue( IndexType localIdx ); /** * \brief Changes value of matrix element on given subdiagonal. @@ -155,7 +155,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType localIdx, const RealType& value ); + setElement( IndexType localIdx, const RealType& value ); /** * \brief Returns iterator pointing at the beginning of the matrix row. diff --git a/src/TNL/Matrices/TridiagonalMatrixView.h b/src/TNL/Matrices/TridiagonalMatrixView.h index 97e24d2203..69b180661a 100644 --- a/src/TNL/Matrices/TridiagonalMatrixView.h +++ b/src/TNL/Matrices/TridiagonalMatrixView.h @@ -287,7 +287,7 @@ public: */ __cuda_callable__ void - setElement( const IndexType row, const IndexType column, const RealType& value ); + setElement( IndexType row, IndexType column, const RealType& value ); /** * \brief Add element at given \e row and \e column to given \e value. @@ -313,10 +313,7 @@ public: */ __cuda_callable__ void - addElement( const IndexType row, - const IndexType column, - const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ); + addElement( IndexType row, IndexType column, const RealType& value, const RealType& thisElementMultiplicator = 1.0 ); /** * \brief Returns value of matrix element at position given by its row and column index. @@ -340,7 +337,7 @@ public: */ __cuda_callable__ RealType - getElement( const IndexType row, const IndexType column ) const; + getElement( IndexType row, IndexType column ) const; /** * \brief Method for performing general reduction on matrix rows for constant instances. @@ -788,9 +785,9 @@ public: void vectorProduct( const InVector& inVector, OutVector& outVector, - const RealType matrixMultiplicator = 1.0, - const RealType outVectorMultiplicator = 0.0, - const IndexType begin = 0, + RealType matrixMultiplicator = 1.0, + RealType outVectorMultiplicator = 0.0, + IndexType begin = 0, IndexType end = 0 ) const; template< typename Real_, typename Device_, typename Index_, ElementsOrganization Organization_ > @@ -868,7 +865,7 @@ public: protected: __cuda_callable__ IndexType - getElementIndex( const IndexType row, const IndexType localIdx ) const; + getElementIndex( IndexType row, IndexType localIdx ) const; IndexerType indexer; }; diff --git a/src/TNL/Meshes/GridDetails/Grid1D.h b/src/TNL/Meshes/GridDetails/Grid1D.h index 9864b44002..1c9d7d82ac 100644 --- a/src/TNL/Meshes/GridDetails/Grid1D.h +++ b/src/TNL/Meshes/GridDetails/Grid1D.h @@ -51,7 +51,7 @@ public: */ Grid(); - Grid( const Index xSize ); + Grid( Index xSize ); // empty destructor is needed only to avoid crappy nvcc warnings ~Grid() {} @@ -61,7 +61,7 @@ public: * \param xSize Size of dimesion x. */ void - setDimensions( const Index xSize ); + setDimensions( Index xSize ); /** * \brief Sets the number of dimensions. diff --git a/src/TNL/Meshes/GridDetails/Grid2D.h b/src/TNL/Meshes/GridDetails/Grid2D.h index 48ea6231bf..29963b40cd 100644 --- a/src/TNL/Meshes/GridDetails/Grid2D.h +++ b/src/TNL/Meshes/GridDetails/Grid2D.h @@ -48,7 +48,7 @@ public: */ Grid(); - Grid( const Index xSize, const Index ySize ); + Grid( Index xSize, Index ySize ); // empty destructor is needed only to avoid crappy nvcc warnings ~Grid() {} @@ -59,7 +59,7 @@ public: * \param ySize Size of dimension y. */ void - setDimensions( const Index xSize, const Index ySize ); + setDimensions( Index xSize, Index ySize ); /** * \brief See Grid1D::setDimensions( const CoordinatesType& dimensions ). diff --git a/src/TNL/Meshes/GridDetails/Grid3D.h b/src/TNL/Meshes/GridDetails/Grid3D.h index 6224f959f3..9bdd30a3a8 100644 --- a/src/TNL/Meshes/GridDetails/Grid3D.h +++ b/src/TNL/Meshes/GridDetails/Grid3D.h @@ -49,7 +49,7 @@ public: */ Grid(); - Grid( const Index xSize, const Index ySize, const Index zSize ); + Grid( Index xSize, Index ySize, Index zSize ); // empty destructor is needed only to avoid crappy nvcc warnings ~Grid() {} @@ -61,7 +61,7 @@ public: * \param zSize Size of dimesion z. */ void - setDimensions( const Index xSize, const Index ySize, const Index zSize ); + setDimensions( Index xSize, Index ySize, Index zSize ); /** * \brief See Grid1D::setDimensions( const CoordinatesType& dimensions ). diff --git a/src/TNL/Meshes/GridDetails/GridTraverser.h b/src/TNL/Meshes/GridDetails/GridTraverser.h index 25f6298797..3077328eb9 100644 --- a/src/TNL/Meshes/GridDetails/GridTraverser.h +++ b/src/TNL/Meshes/GridDetails/GridTraverser.h @@ -42,8 +42,8 @@ public: template< typename GridEntity, typename EntitiesProcessor, typename UserData, bool processOnlyBoundaryEntities > static void processEntities( const GridPointer& gridPointer, - const CoordinatesType begin, - const CoordinatesType end, + const CoordinatesType& begin, + const CoordinatesType& end, UserData& userData, GridTraverserMode mode = synchronousMode, const int& stream = 0 ); @@ -96,8 +96,8 @@ public: typename... GridEntityParameters > static void processEntities( const GridPointer& gridPointer, - const CoordinatesType begin, - const CoordinatesType end, + const CoordinatesType& begin, + const CoordinatesType& end, UserData& userData, // FIXME: hack around nvcc bug (error: default argument not at end of parameter list) // GridTraverserMode mode = synchronousMode, @@ -169,8 +169,8 @@ public: typename... GridEntityParameters > static void processEntities( const GridPointer& gridPointer, - const CoordinatesType begin, - const CoordinatesType end, + const CoordinatesType& begin, + const CoordinatesType& end, UserData& userData, // FIXME: hack around nvcc bug (error: default argument not at end of parameter list) // GridTraverserMode mode = synchronousMode, diff --git a/src/TNL/Meshes/GridDetails/GridTraverser_1D.hpp b/src/TNL/Meshes/GridDetails/GridTraverser_1D.hpp index 64764fbfbc..b71c2a6ac0 100644 --- a/src/TNL/Meshes/GridDetails/GridTraverser_1D.hpp +++ b/src/TNL/Meshes/GridDetails/GridTraverser_1D.hpp @@ -27,8 +27,8 @@ template< typename Real, typename Index > template< typename GridEntity, typename EntitiesProcessor, typename UserData, bool processOnlyBoundaryEntities > void GridTraverser< Meshes::Grid< 1, Real, Devices::Host, Index > >::processEntities( const GridPointer& gridPointer, - const CoordinatesType begin, - const CoordinatesType end, + const CoordinatesType& begin, + const CoordinatesType& end, UserData& userData, GridTraverserMode mode, const int& stream ) diff --git a/src/TNL/Meshes/GridDetails/GridTraverser_2D.hpp b/src/TNL/Meshes/GridDetails/GridTraverser_2D.hpp index 97fe39e126..77171e24cf 100644 --- a/src/TNL/Meshes/GridDetails/GridTraverser_2D.hpp +++ b/src/TNL/Meshes/GridDetails/GridTraverser_2D.hpp @@ -31,8 +31,8 @@ template< typename GridEntity, void GridTraverser< Meshes::Grid< 2, Real, Devices::Host, Index > >::processEntities( const GridPointer& gridPointer, - const CoordinatesType begin, - const CoordinatesType end, + const CoordinatesType& begin, + const CoordinatesType& end, UserData& userData, GridTraverserMode mode, const int& stream, diff --git a/src/TNL/Meshes/GridDetails/GridTraverser_3D.hpp b/src/TNL/Meshes/GridDetails/GridTraverser_3D.hpp index 531dc89966..332360080a 100644 --- a/src/TNL/Meshes/GridDetails/GridTraverser_3D.hpp +++ b/src/TNL/Meshes/GridDetails/GridTraverser_3D.hpp @@ -31,8 +31,8 @@ template< typename GridEntity, void GridTraverser< Meshes::Grid< 3, Real, Devices::Host, Index > >::processEntities( const GridPointer& gridPointer, - const CoordinatesType begin, - const CoordinatesType end, + const CoordinatesType& begin, + const CoordinatesType& end, UserData& userData, GridTraverserMode mode, const int& stream, diff --git a/src/TNL/Meshes/Mesh.h b/src/TNL/Meshes/Mesh.h index 4c7d6ab2a6..bb6c08a567 100644 --- a/src/TNL/Meshes/Mesh.h +++ b/src/TNL/Meshes/Mesh.h @@ -127,7 +127,7 @@ public: template< int Dimension > __cuda_callable__ EntityType< Dimension > - getEntity( const GlobalIndexType entityIndex ) const; + getEntity( GlobalIndexType entityIndex ) const; template< int Dimension > void @@ -142,7 +142,7 @@ public: template< typename EntityType > __cuda_callable__ EntityType - getEntity( const GlobalIndexType entityIndex ) const; + getEntity( GlobalIndexType entityIndex ) const; /** * \brief Returns the spatial coordinates of the vertex with given index. @@ -155,14 +155,14 @@ public: __cuda_callable__ const PointType& - getPoint( const GlobalIndexType vertexIndex ) const; + getPoint( GlobalIndexType vertexIndex ) const; /** * \brief Returns the spatial coordinates of the vertex with given index. */ __cuda_callable__ PointType& - getPoint( const GlobalIndexType vertexIndex ); + getPoint( GlobalIndexType vertexIndex ); /** * \brief Returns the count of subentities of the entity with given index. @@ -170,7 +170,7 @@ public: template< int EntityDimension, int SubentityDimension > __cuda_callable__ constexpr LocalIndexType - getSubentitiesCount( const GlobalIndexType entityIndex ) const; + getSubentitiesCount( GlobalIndexType entityIndex ) const; /** * \brief Returns the global index of the subentity specified by its local index. @@ -178,7 +178,7 @@ public: template< int EntityDimension, int SubentityDimension > __cuda_callable__ GlobalIndexType - getSubentityIndex( const GlobalIndexType entityIndex, const LocalIndexType subentityIndex ) const; + getSubentityIndex( GlobalIndexType entityIndex, LocalIndexType subentityIndex ) const; /** * \brief Returns the count of superentities of the entity with given index. @@ -186,7 +186,7 @@ public: template< int EntityDimension, int SuperentityDimension > __cuda_callable__ LocalIndexType - getSuperentitiesCount( const GlobalIndexType entityIndex ) const; + getSuperentitiesCount( GlobalIndexType entityIndex ) const; /** * \brief Returns the global index of the superentity specified by its local index. @@ -194,7 +194,7 @@ public: template< int EntityDimension, int SuperentityDimension > __cuda_callable__ GlobalIndexType - getSuperentityIndex( const GlobalIndexType entityIndex, const LocalIndexType superentityIndex ) const; + getSuperentityIndex( GlobalIndexType entityIndex, LocalIndexType superentityIndex ) const; /** * \brief Returns the count of neighbor cells of the cell with given index, @@ -202,7 +202,7 @@ public: */ __cuda_callable__ LocalIndexType - getCellNeighborsCount( const GlobalIndexType cellIndex ) const; + getCellNeighborsCount( GlobalIndexType cellIndex ) const; /** * \brief Returns the global index of the cell's specific neighbor cell wigh given local index, @@ -210,7 +210,7 @@ public: */ __cuda_callable__ GlobalIndexType - getCellNeighborIndex( const GlobalIndexType cellIndex, const LocalIndexType neighborIndex ) const; + getCellNeighborIndex( GlobalIndexType cellIndex, LocalIndexType neighborIndex ) const; /** * \brief Execute function \e f in parallel for all mesh entities with dimension \e EntityDimension. diff --git a/src/TNL/Meshes/MeshEntity.h b/src/TNL/Meshes/MeshEntity.h index 2a15a98550..7107d2bc75 100644 --- a/src/TNL/Meshes/MeshEntity.h +++ b/src/TNL/Meshes/MeshEntity.h @@ -45,7 +45,7 @@ public: MeshEntity() = delete; __cuda_callable__ - MeshEntity( const MeshType& mesh, const GlobalIndexType index ); + MeshEntity( const MeshType& mesh, GlobalIndexType index ); __cuda_callable__ MeshEntity( const MeshEntity& entity ) = default; @@ -105,7 +105,7 @@ public: template< int Subdimension > __cuda_callable__ GlobalIndexType - getSubentityIndex( const LocalIndexType localIndex ) const; + getSubentityIndex( LocalIndexType localIndex ) const; /** * \brief Returns the count of superentities of this entity. @@ -121,7 +121,7 @@ public: template< int Superdimension > __cuda_callable__ GlobalIndexType - getSuperentityIndex( const LocalIndexType localIndex ) const; + getSuperentityIndex( LocalIndexType localIndex ) const; /** * \brief Returns the tag associated with this entity. diff --git a/src/TNL/Meshes/Writers/PVTIWriter.h b/src/TNL/Meshes/Writers/PVTIWriter.h index b6b6798030..63f08a030b 100644 --- a/src/TNL/Meshes/Writers/PVTIWriter.h +++ b/src/TNL/Meshes/Writers/PVTIWriter.h @@ -41,7 +41,7 @@ public: writeImageData( const DistributedMeshes::DistributedMesh< Grid >& distributedMesh ); void - writeImageData( const Grid& globalGrid, const unsigned GhostLevel = 0, const unsigned MinCommonVertices = 0 ); + writeImageData( const Grid& globalGrid, unsigned GhostLevel = 0, unsigned MinCommonVertices = 0 ); // Only for compatibility with VTUWriter - calls writeImageData, the EntityDimension is unused template< int EntityDimension = Grid::getMeshDimension() > @@ -51,25 +51,25 @@ public: // Only for compatibility with VTUWriter - calls writeImageData, the EntityDimension is unused template< int EntityDimension = Grid::getMeshDimension() > void - writeEntities( const Grid& grid, const unsigned GhostLevel = 0, const unsigned MinCommonVertices = 0 ); + writeEntities( const Grid& grid, unsigned GhostLevel = 0, unsigned MinCommonVertices = 0 ); template< typename ValueType > void - writePPointData( const std::string& name, const int numberOfComponents = 1 ); + writePPointData( const std::string& name, int numberOfComponents = 1 ); template< typename ValueType > void - writePCellData( const std::string& name, const int numberOfComponents = 1 ); + writePCellData( const std::string& name, int numberOfComponents = 1 ); template< typename ValueType > void - writePDataArray( const std::string& name, const int numberOfComponents = 1 ); + writePDataArray( const std::string& name, int numberOfComponents = 1 ); // add a single piece and return its source path // (useful for sequential writing, e.g. from tnl-decompose-grid) std::string addPiece( const std::string& mainFileName, - const unsigned subdomainIndex, + unsigned subdomainIndex, const typename Grid::CoordinatesType& globalBegin, const typename Grid::CoordinatesType& globalEnd ); diff --git a/src/TNL/Meshes/Writers/PVTUWriter.h b/src/TNL/Meshes/Writers/PVTUWriter.h index e63da61d38..c2837304ce 100644 --- a/src/TNL/Meshes/Writers/PVTUWriter.h +++ b/src/TNL/Meshes/Writers/PVTUWriter.h @@ -39,35 +39,35 @@ public: template< int EntityDimension = Mesh::getMeshDimension() > void - writeEntities( const Mesh& mesh, const unsigned GhostLevel = 0, const unsigned MinCommonVertices = 0 ); + writeEntities( const Mesh& mesh, unsigned GhostLevel = 0, unsigned MinCommonVertices = 0 ); template< typename ValueType > void - writePPointData( const std::string& name, const int numberOfComponents = 1 ); + writePPointData( const std::string& name, int numberOfComponents = 1 ); template< typename ValueType > void - writePCellData( const std::string& name, const int numberOfComponents = 1 ); + writePCellData( const std::string& name, int numberOfComponents = 1 ); template< typename ValueType > void - writePDataArray( const std::string& name, const int numberOfComponents = 1 ); + writePDataArray( const std::string& name, int numberOfComponents = 1 ); // add a single piece and return its source path // (useful for sequential writing, e.g. from tnl-decompose-mesh) std::string - addPiece( const std::string& mainFileName, const unsigned subdomainIndex ); + addPiece( const std::string& mainFileName, unsigned subdomainIndex ); // add all pieces and return the source path for the current rank // (useful for parallel writing) std::string - addPiece( const std::string& mainFileName, const MPI_Comm communicator ); + addPiece( const std::string& mainFileName, MPI_Comm communicator ); ~PVTUWriter(); protected: void - writeHeader( const unsigned GhostLevel = 0, const unsigned MinCommonVertices = 0 ); + writeHeader( unsigned GhostLevel = 0, unsigned MinCommonVertices = 0 ); void writePoints( const Mesh& mesh ); diff --git a/src/TNL/Meshes/Writers/VTIWriter.h b/src/TNL/Meshes/Writers/VTIWriter.h index 94b705ae11..c1cda1dbb4 100644 --- a/src/TNL/Meshes/Writers/VTIWriter.h +++ b/src/TNL/Meshes/Writers/VTIWriter.h @@ -56,15 +56,15 @@ public: template< typename Array > void - writePointData( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writePointData( const Array& array, const std::string& name, int numberOfComponents = 1 ); template< typename Array > void - writeCellData( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writeCellData( const Array& array, const std::string& name, int numberOfComponents = 1 ); template< typename Array > void - writeDataArray( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writeDataArray( const Array& array, const std::string& name, int numberOfComponents = 1 ); ~VTIWriter(); diff --git a/src/TNL/Meshes/Writers/VTKWriter.h b/src/TNL/Meshes/Writers/VTKWriter.h index 9c91612637..576a8a321c 100644 --- a/src/TNL/Meshes/Writers/VTKWriter.h +++ b/src/TNL/Meshes/Writers/VTKWriter.h @@ -42,15 +42,15 @@ public: template< typename Array > void - writePointData( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writePointData( const Array& array, const std::string& name, int numberOfComponents = 1 ); template< typename Array > void - writeCellData( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writeCellData( const Array& array, const std::string& name, int numberOfComponents = 1 ); template< typename Array > void - writeDataArray( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writeDataArray( const Array& array, const std::string& name, int numberOfComponents = 1 ); protected: void diff --git a/src/TNL/Meshes/Writers/VTUWriter.h b/src/TNL/Meshes/Writers/VTUWriter.h index f568b4cb72..c9ee657fef 100644 --- a/src/TNL/Meshes/Writers/VTUWriter.h +++ b/src/TNL/Meshes/Writers/VTUWriter.h @@ -43,15 +43,15 @@ public: template< typename Array > void - writePointData( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writePointData( const Array& array, const std::string& name, int numberOfComponents = 1 ); template< typename Array > void - writeCellData( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writeCellData( const Array& array, const std::string& name, int numberOfComponents = 1 ); template< typename Array > void - writeDataArray( const Array& array, const std::string& name, const int numberOfComponents = 1 ); + writeDataArray( const Array& array, const std::string& name, int numberOfComponents = 1 ); ~VTUWriter(); diff --git a/src/TNL/Solvers/Linear/GMRES.h b/src/TNL/Solvers/Linear/GMRES.h index 2f9b6c3e42..74dd5694de 100644 --- a/src/TNL/Solvers/Linear/GMRES.h +++ b/src/TNL/Solvers/Linear/GMRES.h @@ -141,16 +141,16 @@ protected: public: #endif int - orthogonalize_CGS( const int m, const RealType normb, const RealType beta ); + orthogonalize_CGS( int m, RealType normb, RealType beta ); #ifdef __NVCC__ protected: #endif int - orthogonalize_MGS( const int m, const RealType normb, const RealType beta ); + orthogonalize_MGS( int m, RealType normb, RealType beta ); int - orthogonalize_CWY( const int m, const RealType normb, const RealType beta ); + orthogonalize_CWY( int m, RealType normb, RealType beta ); void compute_residue( VectorViewType r, ConstVectorViewType x, ConstVectorViewType b ); @@ -163,30 +163,30 @@ protected: public: #endif void - hauseholder_generate( const int i, VectorViewType y_i, ConstVectorViewType z ); + hauseholder_generate( int i, VectorViewType y_i, ConstVectorViewType z ); #ifdef __NVCC__ protected: #endif void - hauseholder_apply_trunc( HostView out, const int i, VectorViewType y_i, ConstVectorViewType z ); + hauseholder_apply_trunc( HostView out, int i, VectorViewType y_i, ConstVectorViewType z ); void - hauseholder_cwy( VectorViewType v, const int i ); + hauseholder_cwy( VectorViewType v, int i ); // nvcc allows __cuda_callable__ lambdas only in public methods #ifdef __NVCC__ public: #endif void - hauseholder_cwy_transposed( VectorViewType z, const int i, ConstVectorViewType w ); + hauseholder_cwy_transposed( VectorViewType z, int i, ConstVectorViewType w ); #ifdef __NVCC__ protected: #endif template< typename Vector > void - update( const int k, const int m, const HostVector& H, const HostVector& s, DeviceVector& V, Vector& x ); + update( int k, int m, const HostVector& H, const HostVector& s, DeviceVector& V, Vector& x ); void generatePlaneRotation( RealType& dx, RealType& dy, RealType& cs, RealType& sn ); @@ -195,7 +195,7 @@ protected: applyPlaneRotation( RealType& dx, RealType& dy, RealType& cs, RealType& sn ); void - apply_givens_rotations( const int i, const int m ); + apply_givens_rotations( int i, int m ); void setSize( const VectorViewType& x ); diff --git a/src/TNL/String.h b/src/TNL/String.h index baf2ef1f83..e08a9e4205 100644 --- a/src/TNL/String.h +++ b/src/TNL/String.h @@ -366,7 +366,7 @@ public: * \include StringExampleSplit.out */ std::vector< String > - split( const char separator = ' ', SplitSkip skipEmpty = SplitSkip::NoSkip ) const; + split( char separator = ' ', SplitSkip skipEmpty = SplitSkip::NoSkip ) const; /** * \brief Checks if the string starts with given prefix. -- GitLab