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::NotSupportedif the fitter does not support this pair of types (the default implementations), or ifoutis not a compact column-major view;Error::AxisOutOfRangeifdimis not an axis of the input;Error::ShapeMismatchof the input if it does not havebasis_size(evaluate) orn_points(fit) alongdim, and of the output ifoutdoes not have the shape of the input withn_points(evaluate) orbasis_size(fit) alongdim;Error::DecompositionFailedif 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§
Sourcefn basis_size(&self) -> usize
fn basis_size(&self) -> usize
Number of basis functions.
Provided Methods§
Sourcefn evaluate_nd_dd_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &TypedTensorView<'_, f64>,
dim: usize,
out: &mut TypedTensorViewMut<'_, f64>,
) -> Result<()>
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.
Sourcefn evaluate_nd_dz_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &TypedTensorView<'_, f64>,
dim: usize,
out: &mut TypedTensorViewMut<'_, Complex<f64>>,
) -> Result<()>
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.
Sourcefn evaluate_nd_zd_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &TypedTensorView<'_, Complex<f64>>,
dim: usize,
out: &mut TypedTensorViewMut<'_, f64>,
) -> Result<()>
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.
Sourcefn evaluate_nd_zz_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &TypedTensorView<'_, Complex<f64>>,
dim: usize,
out: &mut TypedTensorViewMut<'_, Complex<f64>>,
) -> Result<()>
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.
Sourcefn fit_nd_dd_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &TypedTensorView<'_, f64>,
dim: usize,
out: &mut TypedTensorViewMut<'_, f64>,
) -> Result<()>
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.
Sourcefn fit_nd_dz_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &TypedTensorView<'_, f64>,
dim: usize,
out: &mut TypedTensorViewMut<'_, Complex<f64>>,
) -> Result<()>
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.
Sourcefn fit_nd_zd_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &TypedTensorView<'_, Complex<f64>>,
dim: usize,
out: &mut TypedTensorViewMut<'_, f64>,
) -> Result<()>
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.
Sourcefn fit_nd_zz_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &TypedTensorView<'_, Complex<f64>>,
dim: usize,
out: &mut TypedTensorViewMut<'_, Complex<f64>>,
) -> Result<()>
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§
impl<S: StatisticsType> InplaceFitter for MatsubaraSampling<S>
impl<S: StatisticsType> InplaceFitter for MatsubaraSamplingPositiveOnly<S>
impl<S: StatisticsType> InplaceFitter for TauSampling<S>
InplaceFitter implementation for TauSampling
Delegates to RealMatrixFitter which supports dd and zz operations.