Skip to content

Commit 3754464

Browse files
committed
Update blas and lapack
1 parent 318a194 commit 3754464

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ enum-error-derive = "0.1"
2121
num-traits = "0.1"
2222
num-complex = "0.1"
2323
ndarray = { version = "0.9", default-features = false, features = ["blas"] }
24-
lapack = { version = "0.11", default-features = false }
25-
blas = { version = "0.15", default-features = false }
24+
lapack = { version = "0.13", default-features = false }
25+
blas = { version = "0.16", default-features = false }

src/lapack_traits/cholesky.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ macro_rules! impl_cholesky {
1717
impl Cholesky_ for $scalar {
1818
fn cholesky(l: MatrixLayout, uplo: UPLO, mut a: &mut [Self]) -> Result<()> {
1919
let (n, _) = l.size();
20-
let info = $potrf(l.lapacke_layout(), uplo as u8, n, &mut a, n);
20+
let info = unsafe { $potrf(l.lapacke_layout(), uplo as u8, n, &mut a, n) };
2121
into_result(info, ())
2222
}
2323
}

src/lapack_traits/eigh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Eigh_ for $scalar {
2121
let (n, _) = l.size();
2222
let jobz = if calc_v { b'V' } else { b'N' };
2323
let mut w = vec![Self::Real::zero(); n as usize];
24-
let info = $ev(l.lapacke_layout(), jobz, uplo as u8, n, &mut a, n, &mut w);
24+
let info = unsafe { $ev(l.lapacke_layout(), jobz, uplo as u8, n, &mut a, n, &mut w) };
2525
into_result(info, w)
2626
}
2727
}

src/lapack_traits/opnorm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ macro_rules! impl_opnorm {
3232
impl OperatorNorm_ for $scalar {
3333
fn opnorm(t: NormType, l: MatrixLayout, a: &[Self]) -> Self::Real {
3434
match l {
35-
MatrixLayout::F((col, lda)) => $lange(cm, t as u8, lda, col, a, lda),
36-
MatrixLayout::C((row, lda)) => $lange(cm, t.transpose() as u8, lda, row, a, lda),
35+
MatrixLayout::F((col, lda)) => unsafe { $lange(cm, t as u8, lda, col, a, lda) },
36+
MatrixLayout::C((row, lda)) => unsafe { $lange(cm, t.transpose() as u8, lda, row, a, lda) },
3737
}
3838
}
3939
}

src/lapack_traits/qr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ impl QR_ for $scalar {
2424
let (row, col) = l.size();
2525
let k = min(row, col);
2626
let mut tau = vec![Self::zero(); k as usize];
27-
let info = $qrf(l.lapacke_layout(), row, col, &mut a, l.lda(), &mut tau);
27+
let info = unsafe { $qrf(l.lapacke_layout(), row, col, &mut a, l.lda(), &mut tau) };
2828
into_result(info, tau)
2929
}
3030

3131
fn q(l: MatrixLayout, mut a: &mut [Self], tau: &[Self]) -> Result<()> {
3232
let (row, col) = l.size();
3333
let k = min(row, col);
34-
let info = $gqr(l.lapacke_layout(), row, k, k, &mut a, l.lda(), &tau);
34+
let info = unsafe { $gqr(l.lapacke_layout(), row, k, k, &mut a, l.lda(), &tau) };
3535
into_result(info, ())
3636
}
3737

src/lapack_traits/solve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ impl Solve_ for $scalar {
2525
let (row, col) = l.size();
2626
let k = ::std::cmp::min(row, col);
2727
let mut ipiv = vec![0; k as usize];
28-
let info = $getrf(l.lapacke_layout(), row, col, a, l.lda(), &mut ipiv);
28+
let info = unsafe { $getrf(l.lapacke_layout(), row, col, a, l.lda(), &mut ipiv) };
2929
into_result(info, ipiv)
3030
}
3131

3232
fn inv(l: MatrixLayout, a: &mut [Self], ipiv: &Pivot) -> Result<()> {
3333
let (n, _) = l.size();
34-
let info = $getri(l.lapacke_layout(), n, a, l.lda(), ipiv);
34+
let info = unsafe { $getri(l.lapacke_layout(), n, a, l.lda(), ipiv) };
3535
into_result(info, ())
3636
}
3737

3838
fn solve(l: MatrixLayout, t: Transpose, a: &[Self], ipiv: &Pivot, b: &mut [Self]) -> Result<()> {
3939
let (n, _) = l.size();
4040
let nrhs = 1;
4141
let ldb = 1;
42-
let info = $getrs(l.lapacke_layout(), t as u8, n, nrhs, a, l.lda(), ipiv, b, ldb);
42+
let info = unsafe { $getrs(l.lapacke_layout(), t as u8, n, nrhs, a, l.lda(), ipiv, b, ldb) };
4343
into_result(info, ())
4444
}
4545
}

src/lapack_traits/svd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl SVD_ for $scalar {
5252
};
5353
let mut s = vec![Self::Real::zero(); k as usize];
5454
let mut superb = vec![Self::Real::zero(); (k-2) as usize];
55-
let info = $gesvd(l.lapacke_layout(), ju as u8, jvt as u8, m, n, &mut a, lda, &mut s, &mut u, ldu, &mut vt, ldvt, &mut superb);
55+
let info = unsafe { $gesvd(l.lapacke_layout(), ju as u8, jvt as u8, m, n, &mut a, lda, &mut s, &mut u, ldu, &mut vt, ldvt, &mut superb) };
5656
into_result(info, SVDOutput {
5757
s: s,
5858
u: if ldu > 0 { Some(u) } else { None },

src/lapack_traits/triangular.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl Triangular_ for $scalar {
2727
fn inv_triangular(l: MatrixLayout, uplo: UPLO, diag: Diag, a: &mut [Self]) -> Result<()> {
2828
let (n, _) = l.size();
2929
let lda = l.lda();
30-
let info = $trtri(l.lapacke_layout(), uplo as u8, diag as u8, n, a, lda);
30+
let info = unsafe { $trtri(l.lapacke_layout(), uplo as u8, diag as u8, n, a, lda) };
3131
into_result(info, ())
3232
}
3333

@@ -42,7 +42,7 @@ impl Triangular_ for $scalar {
4242
println!("lda = {}", lda);
4343
println!("nrhs = {}", nrhs);
4444
println!("ldb = {}", ldb);
45-
let info = $trtrs(al.lapacke_layout(), uplo as u8, Transpose::No as u8, diag as u8, n, nrhs, a, lda, &mut b, ldb);
45+
let info = unsafe { $trtrs(al.lapacke_layout(), uplo as u8, Transpose::No as u8, diag as u8, n, nrhs, a, lda, &mut b, ldb) };
4646
into_result(info, ())
4747
}
4848
}

0 commit comments

Comments
 (0)