Skip to content
Snippets Groups Projects
Commit c43c9b37 authored by Oliver Sander's avatar Oliver Sander
Browse files

Introduce MultiTypeBlockVector::N() for the number of vector entries

This is the name mandated by the dune-istl interface.

Deprecate the old name 'count'.
parent fee9d0e2
No related branches found
No related tags found
1 merge request!346Add missing Multitypeblockvector size methods
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
- The interface methods `dot()` and `norm()` of ScalarProduct are now `const`. You will - The interface methods `dot()` and `norm()` of ScalarProduct are now `const`. You will
have to adjust the method signatures in your own scalar product implementations. have to adjust the method signatures in your own scalar product implementations.
- `MultiTypeBlockVector` now implements the interface method `N()`, which
returns the number of vector entries.
- `MultiTypeBlockVector::count()` is now `const` - `MultiTypeBlockVector::count()` is now `const`
- `SeqILU` can now be used with SIMD data types. - `SeqILU` can now be used with SIMD data types.
...@@ -55,6 +58,9 @@ ...@@ -55,6 +58,9 @@
- The method `getSolverCategory` of `OwnerOverlapCopyCommunication` is deprecated and - The method `getSolverCategory` of `OwnerOverlapCopyCommunication` is deprecated and
will be removed after Dune 2.7. Use `category()` instead. will be removed after Dune 2.7. Use `category()` instead.
- The method `MultiTypeBlockVector::count()` has been deprecated, because its name
is inconsistent with the name mandated by the `dune-istl` vector interface.
# Release 2.6 # Release 2.6
- `BDMatrix` objects can now be constructed and assigned from `std::initializer_list`. - `BDMatrix` objects can now be constructed and assigned from `std::initializer_list`.
......
...@@ -86,10 +86,17 @@ namespace Dune { ...@@ -86,10 +86,17 @@ namespace Dune {
return sizeof...(Args); return sizeof...(Args);
} }
/** \brief Number of elements
*/
static constexpr size_type N()
{
return sizeof...(Args);
}
/** /**
* number of elements * number of elements
*/ */
int count() const int count() const DUNE_DEPRECATED_MSG("Use method 'N' instead")
{ {
return sizeof...(Args); return sizeof...(Args);
} }
......
...@@ -33,12 +33,17 @@ void testMultiVector(const MultiTypeBlockVector<Args...>& multiVector) ...@@ -33,12 +33,17 @@ void testMultiVector(const MultiTypeBlockVector<Args...>& multiVector)
std::cout << multiVector << std::endl; std::cout << multiVector << std::endl;
// test method 'count' // test method 'count'
std::cout << "multi vector has " << multiVector.count() << " first level blocks" << std::endl; std::cout << "multi vector has " << multiVector.N() << " first level blocks" << std::endl;
static_assert(MultiTypeBlockVector<Args...>::size()==2, "Method MultiTypeBlockVector::size() returned wrong value!"); static_assert(MultiTypeBlockVector<Args...>::size()==2, "Method MultiTypeBlockVector::size() returned wrong value!");
DUNE_NO_DEPRECATED_BEGIN
if (multiVector.count() != 2) if (multiVector.count() != 2)
DUNE_THROW(Exception, "Method MultiTypeBlockVector::count returned wrong value!"); DUNE_THROW(Exception, "Method MultiTypeBlockVector::count returned wrong value!");
DUNE_NO_DEPRECATED_END
if (multiVector.N() != 2)
DUNE_THROW(Exception, "Method MultiTypeBlockVector::N returned wrong value!");
// Test copy construction // Test copy construction
auto multiVector2 = multiVector; auto multiVector2 = multiVector;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment