Skip to content

Commit

Permalink
chore: update rand to 0.9.0-alpha.2 (#25)
Browse files Browse the repository at this point in the history
* update manifest

* update code

* remove trailing whitespaces

* fix stuff
  • Loading branch information
imrn99 authored Jul 31, 2024
1 parent 322cfaa commit b113c8f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ integraal = { version = "0.0.2", path = "./integraal" }
integraal-examples = { version = "0.0.2", path = "./examples" }

# external
rand = "0.9.0-alpha.1"
rand = "0.9.0-alpha.2"
rustversion = "1.0.15"
num-traits = "0.2.19"
2 changes: 1 addition & 1 deletion examples/examples/montecarlo/hardcoded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn main() {
let count: usize = rets
.map(|y| {
let iter = (&mut rng)
.sample_iter::<f64, _>(rand::distributions::Uniform::new(0.0, 2.0).unwrap())
.sample_iter::<f64, _>(rand::distr::Uniform::new(0.0, 2.0).unwrap())
.take(N_MONTECARLO_SAMPLE);
iter.filter(|sample| *sample <= y).count()
})
Expand Down
9 changes: 3 additions & 6 deletions integraal/src/structure/implementations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ impl<'a, X: Scalar> Integraal<'a, X> {
self
}

#[allow(
clippy::missing_errors_doc,
clippy::missing_panics_doc,
)]
#[allow(clippy::missing_errors_doc, clippy::missing_panics_doc)]
/// This method attempts to compute the integral. If it is successful, it will clear the
/// internal [`FunctionDescriptor`] object before returning the result.
///
Expand Down Expand Up @@ -63,13 +60,13 @@ impl<'a, X: Scalar> Integraal<'a, X> {
// function descriptor -- values
// domain descriptor -- explicit
(
Some(FunctionDescriptor::Values(vals)),
Some(FunctionDescriptor::Values(vals)),
Some(DomainDescriptor::Explicit(args))
) => values_explicit_arm(vals, args, method)?,
// function descriptor -- values
// domain descriptor -- uniform
(
Some(FunctionDescriptor::Values(vals)),
Some(FunctionDescriptor::Values(vals)),
Some(DomainDescriptor::Uniform { .. })
) => values_uniform_arm(vals, domain, method)?,
// function descriptor -- closure
Expand Down
2 changes: 1 addition & 1 deletion integraal/src/structure/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn inconsistent_parameters() {
assert_eq!(
integral.compute(),
Err(IntegraalError::InconsistentParameters(
"provided function and domain value slices have different lengthes"
"function and domain value slices have different lengthes"
))
);

Expand Down

0 comments on commit b113c8f

Please sign in to comment.