bug #887: use ei_declare_aligned_stack_constructed_variable instead of manual new[]/delete[] pairs in AMD and Paralellizer

This commit is contained in:
Gael Guennebaud
2014-10-06 11:54:30 +02:00
parent fb53ff1eda
commit 893bfcf95f
2 changed files with 3 additions and 6 deletions

View File

@@ -106,7 +106,8 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
t = cnz + cnz/5 + 2*n; /* add elbow room to C */
C.resizeNonZeros(t);
Index* W = new Index[8*(n+1)]; /* get workspace */
// get workspace
ei_declare_aligned_stack_constructed_variable(Index,W,8*(n+1),0);
Index* len = W;
Index* nv = W + (n+1);
Index* next = W + 2*(n+1);
@@ -424,8 +425,6 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
}
perm.indices().conservativeResize(n);
delete[] W;
}
} // namespace internal