Skip to content

Commit 7397c40

Browse files
committed
Matrix structure created only once
1 parent 57bbbd9 commit 7397c40

File tree

4 files changed

+293
-274
lines changed

4 files changed

+293
-274
lines changed

highs/ipm/hipo/factorhighs/FactorHiGHS.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ class FHsolver {
9191
const std::string& ordering = "metis");
9292

9393
// Perform factorise phase of matrix given by rows, ptr, vals, and store
94-
// numerical factorisation in object N. Matrix is moved into the object, so
95-
// rows, ptr, vals are invalid afterwards.
96-
// See ReturnValues.h for errors.
94+
// numerical factorisation in object N. See ReturnValues.h for errors.
9795
Int factorise(const Symbolic& S, const std::vector<Int>& rows,
9896
const std::vector<Int>& ptr, const std::vector<double>& vals);
9997

highs/ipm/hipo/factorhighs/Factorise.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Factorise::Factorise(const Symbolic& S, const std::vector<Int>& rowsA,
2929
// Input the symmetric matrix to be factorised in CSC format and the symbolic
3030
// factorisation coming from Analyse.
3131
// Only the lower triangular part of the matrix is used.
32-
// The Factorise object takes ownership of the matrix; rowsA, ptrA and valA
33-
// are not valid anymore.
3432

3533
n_ = ptrA.size() - 1;
3634

@@ -42,10 +40,10 @@ Factorise::Factorise(const Symbolic& S, const std::vector<Int>& rowsA,
4240
return;
4341
}
4442

45-
// take ownership of the matrix
46-
rowsA_ = std::move(rowsA);
47-
valA_ = std::move(valA);
48-
ptrA_ = std::move(ptrA);
43+
// Make a copy of the matrix to be factorised
44+
rowsA_ = rowsA;
45+
valA_ = valA;
46+
ptrA_ = ptrA;
4947

5048
// Permute the matrix.
5149
// This also removes any entry not in the lower triangle.

0 commit comments

Comments
 (0)