Skip to content
Snippets Groups Projects
Commit a8bfe818 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Implement resizeInitialize() for BitSetVector

parent 69329dd6
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -30,6 +30,27 @@ void resizeInitialize(Vector& x, const Vector& y, Value&& value) ...@@ -30,6 +30,27 @@ void resizeInitialize(Vector& x, const Vector& y, Value&& value)
x = value; x = value;
} }
/**
* \brief Resize and initialization vector to match size of given vector
*
* \param x Vector to resize
* \param y Model for resizing
* \param value Value to use for initialization
*
* This will resize the given vector x to match
* the size of the given vector and assign the given
* value to it.
*/
template<int size, class Alloc, class Vector, class Value>
void resizeInitialize(Dune::BitSetVector<size, Alloc>& x, const Vector& y, Value&& value)
{
x.resize(y.size());
if (value)
x.setAll();
else
x.unsetAll();
}
/** /**
* \brief Resize and initialization vector to match size of given vector * \brief Resize and initialization vector to match size of given vector
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment