Skip to content

Commit

Permalink
Removed unecessary copy
Browse files Browse the repository at this point in the history
  • Loading branch information
odlomax committed Feb 9, 2024
1 parent 2736d08 commit b292836
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/atlas/interpolation/method/sphericalvector/SparseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class SparseMatrix {
return RowIter(eigenMatrix_, rowIndex);
}
SparseMatrix<Value> adjoint() const {
const EigenMatrix adjoint = eigenMatrix_.adjoint();
return SparseMatrix(adjoint);
auto adjointMatrix = SparseMatrix{};
adjointMatrix.eigenMatrix_ = eigenMatrix_.adjoint();
return adjointMatrix;
}

private:
explicit SparseMatrix(const EigenMatrix& eigenMatrixAdjoint)
: eigenMatrix_{eigenMatrixAdjoint} {}
SparseMatrix() = default;
EigenMatrix eigenMatrix_{};
};
#else
Expand Down

0 comments on commit b292836

Please sign in to comment.