Co-authored-by: Sanjeeb Poudel <paudelsanjeeb@gmail.com>
system_rhs.reinit(n_dofs);
- if (solution.size() == 0)
+ if (solution.empty())
{
solution.reinit(n_dofs);
solution_old.reinit(n_dofs);
for (unsigned int s = 0; s < n_steps; ++s)
{
deallog << "Step " << s << std::endl;
- if (estimates.block(0).size() == 0)
+ if (estimates.block(0).empty())
triangulation.refine_global(1);
else
{
*/
virtual ~Vector() override = default;
+
+ /**
+ * This function is equivalent to writing <code>size() == 0</code>.
+ */
+ bool
+ empty() const;
+
/**
* This function does nothing but exists for compatibility with the parallel
* vector classes.
}
+template <typename Number>
+inline bool
+Vector<Number>::empty() const
+{
+ return this->size() == 0;
+}
template <typename Number>
inline void
for (typename std::vector<DataVector>::const_iterator i = dof_data.begin();
i != dof_data.end();
++i)
- Assert(i->data.size() == 0, ExcDataNotCleared());
+ Assert(i->data.empty(), ExcDataNotCleared());
for (typename std::vector<DataVector>::const_iterator i = cell_data.begin();
i != cell_data.end();
++i)
- Assert(i->data.size() == 0, ExcDataNotCleared());
+ Assert(i->data.empty(), ExcDataNotCleared());
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams