mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Added size() member for ease of use.
This makes it easier to write for example templated code acting on either AD vectors or non-ad vectors.
This commit is contained in:
+7
-1
@@ -173,7 +173,13 @@ namespace AutoDiff
|
||||
return os;
|
||||
}
|
||||
|
||||
/// Number of variables or Jacobian blocks.
|
||||
/// Number of elements
|
||||
int size() const
|
||||
{
|
||||
return val_.size();
|
||||
}
|
||||
|
||||
/// Number of Jacobian blocks.
|
||||
int numBlocks() const
|
||||
{
|
||||
return jac_.size();
|
||||
|
||||
Reference in New Issue
Block a user