espdev / csaps-rs Goto Github PK
View Code? Open in Web Editor NEWCubic spline approximation (smoothing) in Rust
License: MIT License
Cubic spline approximation (smoothing) in Rust
License: MIT License
I cannot run the example, I surely did something wrong, but the &x
, &y
and &w
are underlined basically saying the AsRef trait is not implemented?Cargo.toml:
ndarray = {version = "0.15.6", feature =["rayon"]}
ndarray-linalg = { version = "0.16.0", features = ["intel-mkl-static"] }
csaps = "0.3.0"
// some of the imports are not used
use csaps::CubicSmoothingSpline;
use ndarray::{array, Array1, Array2, Zip, Axis, ArrayView2, ArrayView1, stack, Array, Dim, ArrayViewMut};
let x = array![1.0, 2.0, 3.0, 4.0];
let y = array![0.5, 1.2, 3.4, 2.5];
let w = array![1.0, 0.7, 0.5, 1.0];
let smooth = 0.85;
let s = CubicSmoothingSpline::new(&x, &y)
.with_weights(&w)
.with_smooth(smooth)
.make().unwrap();
error[E0277]: the trait bound `ArrayBase<OwnedRepr<{float}>, Dim<[usize; 1]>>: AsRef<[_]>` is not satisfied
--> src\wmap\apply.rs:61:39
|
61 | let s = CubicSmoothingSpline::new(&x, &y)
| ------------------------- ^^ the trait `AsRef<[_]>` is not implemented for `ArrayBase<OwnedRepr<{float}>, Dim<[usize; 1]>>`
| |
| required by a bound introduced by this call
|
= note: required for `ndarray::ArrayBase<ndarray::ViewRepr<&_>, ndarray::dimension::dim::Dim<[usize; 1]>>` to implement `From<&ArrayBase<OwnedRepr<{float}>, Dim<[usize; 1]>>>`
= note: required for `&ArrayBase<OwnedRepr<{float}>, Dim<[usize; 1]>>` to implement `Into<ndarray::ArrayBase<ndarray::ViewRepr<&_>, ndarray::dimension::dim::Dim<[usize; 1]>>>`
= note: required for `&ArrayBase<OwnedRepr<{float}>, Dim<[usize; 1]>>` to implement `ndarray::arraytraits::AsArray<'_, _>`
note: required by a bound in `CubicSmoothingSpline::<'a, T, D>::new`
The ndarray, sprs, and sprs-ldl crates have changed a bit since the last release of csaps. I think the performance bug due to sprs might have been fixed by now? How much work is it to update csaps to the newest versions of those?
I'm having some issues using it currently, due to other dependencies using newer versions of ndarray.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.