Skip to content

Commit a78aafd

Browse files
committed
Fix dependent crates in workspace
1 parent a456b78 commit a78aafd

File tree

3 files changed

+14
-9
lines changed
  • sprs-benches/src
  • suitesparse_bindings
    • sprs_suitesparse_camd/src
    • sprs_suitesparse_ldl/src

3 files changed

+14
-9
lines changed

sprs-benches/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@ fn scipy_mat<'a>(
1010
py: &Python,
1111
mat: &sprs::CsMat<f64>,
1212
) -> Result<&'a PyAny, String> {
13+
let indptr = mat.indptr().to_proper().to_vec();
1314
scipy_sparse
1415
.call(
1516
"csr_matrix",
16-
((
17-
mat.data().to_vec(),
18-
mat.indices().to_vec(),
19-
mat.indptr().to_vec(),
20-
),),
17+
((mat.data().to_vec(), mat.indices().to_vec(), indptr),),
2118
Some([("shape", mat.shape())].into_py_dict(*py)),
2219
)
2320
.map_err(|e| {

suitesparse_bindings/sprs_suitesparse_camd/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ where
3838
mat.to_other_types();
3939
let mut perm: Vec<SuiteSparseInt> = vec![0; n];
4040
let camd_res = unsafe {
41+
let indptr = mat.indptr();
42+
let indptr_proper = indptr.to_proper();
4143
camd_order(
4244
n as SuiteSparseInt,
43-
mat.indptr().as_ptr(),
45+
indptr_proper.as_ptr(),
4446
mat.indices().as_ptr(),
4547
perm.as_mut_ptr(),
4648
control.as_mut_ptr(),
@@ -56,9 +58,11 @@ where
5658
mat.to_other_types();
5759
let mut perm: Vec<SuiteSparseLong> = vec![0; n];
5860
let camd_res = unsafe {
61+
let indptr = mat.indptr();
62+
let indptr_proper = indptr.to_proper();
5963
camd_l_order(
6064
n as SuiteSparseLong,
61-
mat.indptr().as_ptr(),
65+
indptr_proper.as_ptr(),
6266
mat.indices().as_ptr(),
6367
perm.as_mut_ptr(),
6468
control.as_mut_ptr(),

suitesparse_bindings/sprs_suitesparse_ldl/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ macro_rules! ldl_impl {
8484
let n = mat.rows();
8585
let n_ = n as $int;
8686
let mat: CsMatI<f64, $int> = mat.to_other_types();
87-
let ap = mat.indptr().as_ptr();
87+
let indptr = mat.indptr();
88+
let indptr_proper = indptr.to_proper();
89+
let ap = indptr_proper.as_ptr();
8890
let ai = mat.indices().as_ptr();
8991
let valid_mat = unsafe { $valid_matrix(n_, ap, ai) };
9092
assert!(valid_mat == 1);
@@ -225,7 +227,9 @@ macro_rules! ldl_impl {
225227
I: SpIndex,
226228
{
227229
let mat: CsMatI<f64, $int> = mat.to_other_types();
228-
let ap = mat.indptr().as_ptr();
230+
let indptr = mat.indptr();
231+
let indptr_proper = indptr.to_proper();
232+
let ap = indptr_proper.as_ptr();
229233
let ai = mat.indices().as_ptr();
230234
let ax = mat.data().as_ptr();
231235
assert!(unsafe { $valid_matrix(self.symbolic.n, ap, ai) } != 0);

0 commit comments

Comments
 (0)