Skip to main content

InplaceFitter

Trait InplaceFitter 

Source
pub trait InplaceFitter {
    // Required methods
    fn n_points(&self) -> usize;
    fn basis_size(&self) -> usize;

    // Provided methods
    fn evaluate_nd_dd_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        coeffs: &TypedTensorView<'_, f64>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, f64>,
    ) -> Result<()> { ... }
    fn evaluate_nd_dz_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        coeffs: &TypedTensorView<'_, f64>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, Complex<f64>>,
    ) -> Result<()> { ... }
    fn evaluate_nd_zd_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        coeffs: &TypedTensorView<'_, Complex<f64>>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, f64>,
    ) -> Result<()> { ... }
    fn evaluate_nd_zz_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        coeffs: &TypedTensorView<'_, Complex<f64>>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, Complex<f64>>,
    ) -> Result<()> { ... }
    fn fit_nd_dd_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        values: &TypedTensorView<'_, f64>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, f64>,
    ) -> Result<()> { ... }
    fn fit_nd_dz_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        values: &TypedTensorView<'_, f64>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, Complex<f64>>,
    ) -> Result<()> { ... }
    fn fit_nd_zd_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        values: &TypedTensorView<'_, Complex<f64>>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, f64>,
    ) -> Result<()> { ... }
    fn fit_nd_zz_to(
        &self,
        backend: Option<&GemmBackendHandle>,
        values: &TypedTensorView<'_, Complex<f64>>,
        dim: usize,
        out: &mut TypedTensorViewMut<'_, Complex<f64>>,
    ) -> Result<()> { ... }
}
Expand description

Evaluation and fitting along one axis of an N-dimensional tensor, writing into a caller-provided output view.

Method suffixes follow BLAS naming (d = f64, z = Complex<f64>): evaluate_nd_dz_to maps real coefficients to complex values.

Inputs may have any strided host layout (non-contiguous inputs are copied once). Outputs must be host-resident compact column-major views whose shape equals the input shape with axis dim replaced by the output extent.

Each method returns Ok(()) after writing the result to out. On an error nothing is written to out:

  • Error::NotSupported if the fitter does not support this pair of types (the default implementations), or if out is not a compact column-major view;
  • Error::AxisOutOfRange if dim is not an axis of the input;
  • Error::ShapeMismatch of the input if it does not have basis_size (evaluate) or n_points (fit) along dim, and of the output if out does not have the shape of the input with n_points (evaluate) or basis_size (fit) along dim;
  • Error::DecompositionFailed if a fit needs the singular value decomposition of the matrix and it fails.

An empty input of the right shape (a batch axis of extent 0) gives Ok(()) without computing anything.

Required Methods§

Source

fn n_points(&self) -> usize

Number of sampling points.

Source

fn basis_size(&self) -> usize

Number of basis functions.

Provided Methods§

Source

fn evaluate_nd_dd_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &TypedTensorView<'_, f64>, dim: usize, out: &mut TypedTensorViewMut<'_, f64>, ) -> Result<()>

Evaluate: f64 coefficients to f64 values.

Source

fn evaluate_nd_dz_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &TypedTensorView<'_, f64>, dim: usize, out: &mut TypedTensorViewMut<'_, Complex<f64>>, ) -> Result<()>

Evaluate: f64 coefficients to Complex<f64> values.

Source

fn evaluate_nd_zd_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &TypedTensorView<'_, Complex<f64>>, dim: usize, out: &mut TypedTensorViewMut<'_, f64>, ) -> Result<()>

Evaluate: Complex<f64> coefficients to f64 values.

Source

fn evaluate_nd_zz_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &TypedTensorView<'_, Complex<f64>>, dim: usize, out: &mut TypedTensorViewMut<'_, Complex<f64>>, ) -> Result<()>

Evaluate: Complex<f64> coefficients to Complex<f64> values.

Source

fn fit_nd_dd_to( &self, backend: Option<&GemmBackendHandle>, values: &TypedTensorView<'_, f64>, dim: usize, out: &mut TypedTensorViewMut<'_, f64>, ) -> Result<()>

Fit: f64 values to f64 coefficients.

Source

fn fit_nd_dz_to( &self, backend: Option<&GemmBackendHandle>, values: &TypedTensorView<'_, f64>, dim: usize, out: &mut TypedTensorViewMut<'_, Complex<f64>>, ) -> Result<()>

Fit: f64 values to Complex<f64> coefficients.

Source

fn fit_nd_zd_to( &self, backend: Option<&GemmBackendHandle>, values: &TypedTensorView<'_, Complex<f64>>, dim: usize, out: &mut TypedTensorViewMut<'_, f64>, ) -> Result<()>

Fit: Complex<f64> values to f64 coefficients.

Source

fn fit_nd_zz_to( &self, backend: Option<&GemmBackendHandle>, values: &TypedTensorView<'_, Complex<f64>>, dim: usize, out: &mut TypedTensorViewMut<'_, Complex<f64>>, ) -> Result<()>

Fit: Complex<f64> values to Complex<f64> coefficients.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S: StatisticsType> InplaceFitter for MatsubaraSampling<S>

Source§

impl<S: StatisticsType> InplaceFitter for MatsubaraSamplingPositiveOnly<S>

Source§

impl<S: StatisticsType> InplaceFitter for TauSampling<S>

InplaceFitter implementation for TauSampling

Delegates to RealMatrixFitter which supports dd and zz operations.