Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 23, 2024
1 parent fd36f04 commit 5090691
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ static mut CALLBACK: Option<fn(&str, &str, u32, crate::Value)> = None;
/// restore a new error handler,
///
/// ```
/// use rgsl::error::set_error_handler;
/// use rgsl::Value;
/// use crate::rgsl::error::set_error_handler;
/// use crate::rgsl::Value;
///
/// fn error_handling(error_str: &str, file: &str, line: u32, error_value: Value) {
/// println!("[{:?}] '{}:{}': {}", error_value, file, line, error_str);
Expand All @@ -193,7 +193,7 @@ static mut CALLBACK: Option<fn(&str, &str, u32, crate::Value)> = None;
/// To use the default behavior (abort on error) set the error handler to NULL,
///
/// ```
/// # use rgsl::error::set_error_handler;
/// # use crate::rgsl::error::set_error_handler;
/// let old_handler = set_error_handler(None);
/// ```
#[doc(alias = "gsl_set_error_handler")]
Expand Down Expand Up @@ -249,7 +249,7 @@ extern "C" fn inner_error_handler(

#[test]
fn test_error_handler() {
use {bessel, Value};
use crate::{bessel, Value};

set_error_handler_off();
match bessel::K0_e(1e3) {
Expand Down
4 changes: 2 additions & 2 deletions src/power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::mem::MaybeUninit;
/// underflow conditions.
///
/// ```rust
/// use rgsl::power::pow_int;
/// use crate::rgsl::power::pow_int;
///
/// /* compute 3.0**12 */
/// println!("{}", pow_int(3., 12));
Expand All @@ -30,7 +30,7 @@ pub fn pow_int(x: f64, n: i32) -> f64 {
/// underflow conditions.
///
/// ```rust
/// use rgsl::power::pow_int_e;
/// use crate::rgsl::power::pow_int_e;
///
/// /* compute 3.0**12 */
/// println!("{:?}", pow_int_e(3., 12));
Expand Down
2 changes: 1 addition & 1 deletion src/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This chapter describes the statistical functions in the library. The basic statistical functions include routines to compute the mean,
variance and standard deviation. More advanced functions allow you to calculate absolute deviations, skewness, and kurtosis as well as the
median and arbitrary percentiles. The algorithms use recurrence relations to compute average quantities in a stable way, without large
median and arbitrary percentiles. The algorithms use crate::recurrence relations to compute average quantities in a stable way, without large
intermediate values that might overflow.
## Weighted Samples
Expand Down
4 changes: 2 additions & 2 deletions src/types/eigen_symmetric_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ fn eigen_symmetric_vworkspace() {
// ```
#[test]
fn eigen_hermitian_workspace() {
use ComplexF64;
use crate::ComplexF64;
use MatrixComplexF64;
use VectorF64;

Expand Down Expand Up @@ -944,7 +944,7 @@ fn eigen_hermitian_workspace() {
// ```
#[test]
fn eigen_hermitian_vworkspace() {
use ComplexF64;
use crate::ComplexF64;

let mut e = EigenHermitianVWorkspace::new(3).unwrap();
let mut m = MatrixComplexF64::new(2, 2).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/types/interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Interp {
/// size data-points.
///
/// ```
/// use rgsl::{Interp, InterpType};
/// use crate::rgsl::{Interp, InterpType};
///
/// let interp_type = InterpType::linear();
/// let interp = Interp::new(interp_type, 2).expect("Failed to initialize `Interp`...");
Expand Down Expand Up @@ -121,7 +121,7 @@ impl Interp {
/// This function returns the name of the interpolation type used by interp. For example,
///
/// ```
/// use rgsl::{Interp, InterpType};
/// use crate::rgsl::{Interp, InterpType};
///
/// let interp_type = InterpType::linear();
/// let interp = Interp::new(interp_type, 2).expect("Failed to initialize `Interp`...");
Expand Down
10 changes: 5 additions & 5 deletions src/types/minimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ mod test {
/// This doc block will be used to ensure that the closure can't be set everywhere!
///
/// ```compile_fail
/// use rgsl::*;
/// use rgsl::minimizer::test_interval;
/// use crate::rgsl::*;
/// use crate::rgsl::minimizer::test_interval;
///
/// fn set(min: &mut Minimizer) {
/// let y = "lalal".to_owned();
Expand All @@ -304,8 +304,8 @@ mod test {
/// Same but a working version:
///
/// ```
/// use rgsl::*;
/// use rgsl::minimizer::test_interval;
/// use crate::rgsl::*;
/// use crate::rgsl::minimizer::test_interval;
///
/// fn set(min: &mut Minimizer) {
/// min.set(|x| x * x - 5., 1.0, -5.0, 5.0);
Expand All @@ -316,7 +316,7 @@ mod test {
/// let status = min.iterate();
/// ```
use super::*;
use minimizer::test_interval;
use crate::minimizer::test_interval;

fn quadratic_test_fn(x: f64) -> f64 {
x.powf(2.0) - 5.0
Expand Down
6 changes: 3 additions & 3 deletions src/types/multimin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ mod test {
///
/// ```compile_fail
/// extern crate rgsl;
/// use rgsl::types::multimin::{Minimizer,MinimizerType};
/// use crate::rgsl::types::multimin::{Minimizer,MinimizerType};
///
/// fn set(m: &mut Minimizer) {
/// let dummy = "lalal".to_owned();
Expand All @@ -218,7 +218,7 @@ mod test {
///
/// ```
/// extern crate rgsl;
/// use rgsl::types::multimin::{Minimizer,MinimizerType};
/// use crate::rgsl::types::multimin::{Minimizer,MinimizerType};
///
/// fn set(m: &mut Minimizer) {
/// m.set(|x| {
Expand All @@ -232,7 +232,7 @@ mod test {
/// }
/// ```
use super::*;
use multimin::test_size;
use crate::multimin::test_size;

fn print_state(min: &Minimizer, iter: usize) {
let f = min.minimum();
Expand Down
10 changes: 5 additions & 5 deletions src/types/multiroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ mod tests {
/// This doc block will be used to ensure that the closure can't be set everywhere!
///
/// ```compile_fail
/// use rgsl::*;
/// use rgsl::types::multiroot::{MultiRootFSolver, MultiRootFSolverType};
/// use crate::rgsl::*;
/// use crate::rgsl::types::multiroot::{MultiRootFSolver, MultiRootFSolverType};
///
/// fn set(root: &mut MultiRootFSolver) {
/// let dummy = "lalal".to_owned();
Expand All @@ -259,8 +259,8 @@ mod tests {
/// Same but a working version:
///
/// ```
/// use rgsl::types::multiroot::{MultiRootFSolver, MultiRootFSolverType};
/// use rgsl::*;
/// use crate::rgsl::types::multiroot::{MultiRootFSolver, MultiRootFSolverType};
/// use crate::rgsl::*;
///
/// fn set(root: &mut MultiRootFSolver) {
/// root.set(|x, y| {
Expand All @@ -275,7 +275,7 @@ mod tests {
/// ```
///
use super::*;
use multiroot::test_residual;
use crate::multiroot::test_residual;

/// checking a test function
/// must return a success criteria (or failure)
Expand Down
6 changes: 3 additions & 3 deletions src/types/roots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ mod test {
/// This doc block will be used to ensure that the closure can't be set everywhere!
///
/// ```compile_fail
/// use rgsl::*;
/// use crate::rgsl::*;
///
/// fn set(root: &mut RootFSolver) {
/// let y = "lalal".to_owned();
Expand All @@ -382,7 +382,7 @@ mod test {
/// Same but a working version:
///
/// ```
/// use rgsl::*;
/// use crate::rgsl::*;
///
/// fn set(root: &mut RootFSolver) {
/// root.set(|x| x * x - 5., 0.0, 5.0);
Expand All @@ -393,7 +393,7 @@ mod test {
/// let status = root.iterate();
/// ```
use super::*;
use roots::{test_delta, test_interval};
use crate::roots::{test_delta, test_interval};

// support functions
fn quadratic_test_fn(x: f64) -> f64 {
Expand Down

0 comments on commit 5090691

Please sign in to comment.