rgsl/filter.rs
1//
2// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
3//
4
5use crate::{Value, VectorF64};
6use ffi::FFI;
7
8/// This function constructs a Gaussian kernel parameterized by `alpha` and stores the output in
9/// `kernel`. The parameter `order` specifies the derivative order, with `0` corresponding to a
10/// Gaussian, `1` corresponding to a first derivative Gaussian, and so on. If `normalize` is set to
11/// `true`, then the kernel will be normalized to sum to one on output. If `normalize` is set to
12/// `false`, no normalization is performed.
13#[doc(alias = "gsl_filter_gaussian_kernel")]
14pub fn gaussian_kernel(
15 alpha: f64,
16 order: usize,
17 normalize: bool,
18 kernel: &mut VectorF64,
19) -> Result<(), Value> {
20 let ret = unsafe {
21 sys::gsl_filter_gaussian_kernel(alpha, order, normalize as _, kernel.unwrap_unique())
22 };
23 result_handler!(ret, ())
24}