MagnitudeCorrection trait should be public
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
Research direction
Start at the public exports for the ndarray-linalg::lobpcg module and trace how MagnitudeCorrection is defined and used by TruncatedSvd. Reproduce the provided generic-Float example, then verify that the trait can be imported and used as a bound and that the example compiles.
Written by the indexing model from the issue text.
Description
I tried to use TruncatedSvd with a generic Float type but it can not compile as it has to use the MagnitudeCorrection trait which is not exported from ndarray-linalg::lobpcg module. My test program here:
use ndarray::{arr1, arr2, Array1, Array2, ScalarOperand};
use ndarray_linalg::{close_l2, Lapack, TruncatedOrder, TruncatedSvd}; // should use MagnitudeCorrection as well
use num_traits::Float;
fn test_truncated_svd<F: Float + Lapack + ScalarOperand + Default>( // should add MagnitudeCorrection trait bound
a: Array2<F>,
) -> Array1<F> {
let res = TruncatedSvd::new(a, TruncatedOrder::Largest)
.precision(1e-5)
.maxiter(10)
.decompose(2)
.unwrap();
let (_, sigma, _) = res.values_vectors();
sigma
}
fn main() {
let a = arr2(&[[3., 2., 2.], [2., 3., -2.]]);
let sigma = test_truncated_svd(a);
close_l2(&sigma, &arr1(&[5.0, 3.0]), 1e-5);
}
- Dominant language
- Rust
- Stars
- 452
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray-linalg
-
Thin SVD Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
rust-ndarray/ndarray-linalg#413 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-ndarray/ndarray-linalg#404 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#402 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#401 · 2 reactions ·
All issues in rust-ndarray/ndarray-linalg
Similar issues
-
risk:low runtime status:in-progress type:test
Difficulty 1/5 Under an hour Newbie friendliness 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
EricSpencer00/Resilient#4835 · 1 comment ·
-
agent:ready documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cesarferreira/stax#890 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100