mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-20 11:48:25 -06:00
Add move constructor and assignment to AutoDiffMatrix.
This is necessary, and done using swap(), since (current version) Eigen::SparseMatrix does not support move semantics.
This commit is contained in:
parent
097542a527
commit
61c352ca3b
@ -87,6 +87,26 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
AutoDiffMatrix(const AutoDiffMatrix& other) = default;
|
||||
AutoDiffMatrix& operator=(const AutoDiffMatrix& other) = default;
|
||||
|
||||
|
||||
|
||||
AutoDiffMatrix(AutoDiffMatrix&& other)
|
||||
{
|
||||
swap(other);
|
||||
}
|
||||
|
||||
|
||||
|
||||
AutoDiffMatrix& operator=(AutoDiffMatrix&& other)
|
||||
{
|
||||
swap(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void swap(AutoDiffMatrix& other)
|
||||
{
|
||||
std::swap(type_, other.type_);
|
||||
|
Loading…
Reference in New Issue
Block a user