Skip to main content

TensorReadLinalgExt

Trait TensorReadLinalgExt 

Source
pub trait TensorReadLinalgExt {
Show 22 methods // Required methods fn svd_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor)>; fn svd_with_options_read<B: LinalgBackend>( self, options: SvdOptions, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor)>; fn qr_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>; fn qr_with_options_read<B: LinalgBackend>( self, options: QrOptions, backend: &mut B, ) -> Result<(Tensor, Tensor)>; fn lu_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor, Tensor)>; fn full_piv_lu_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor, Tensor, Tensor)>; fn full_piv_lu_solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, backend: &mut B, ) -> Result<Tensor>; fn solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, backend: &mut B, ) -> Result<Tensor>; fn cholesky_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>; fn eigh_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>; fn eigh_with_options_read<B: LinalgBackend>( self, options: EighOptions, backend: &mut B, ) -> Result<(Tensor, Tensor)>; fn eig_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>; fn triangular_solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, left_side: bool, lower: bool, transpose_a: bool, unit_diagonal: bool, backend: &mut B, ) -> Result<Tensor>; fn slogdet_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>; fn det_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>; fn inv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>; fn eigvalsh_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>; fn eigvals_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>; fn pinv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>; fn pinv_with_rtol_read<B: LinalgBackend>( self, rtol: f64, backend: &mut B, ) -> Result<Tensor>; fn norm_read<B: LinalgBackend>( self, ord: Option<f64>, dim: Option<&[usize]>, keepdim: bool, backend: &mut B, ) -> Result<Tensor>; // Provided method fn solve_read_into<B: LinalgBackend>( self, b: TensorRead<'_>, out: TensorWrite<'_>, backend: &mut B, ) -> Result<()> where Self: Sized { ... }
}
Expand description

Linear algebra methods for borrowed tensor reads.

§Examples

use tenferro_cpu::{with_cpu_exec_session, CpuBackend};
use tenferro_linalg::TensorReadLinalgExt;
use tenferro_tensor::{BackendSessionHost, Tensor, TensorRead};

let input = Tensor::from_vec_col_major(vec![2, 2], vec![2.0_f64, 0.0, 0.0, 4.0])?;
let mut host = CpuBackend::new();
let (_q, r) = host.with_backend_session(|session| {
    with_cpu_exec_session(session, |backend| {
        TensorRead::from_tensor(&input).qr_read(backend)
    })
    .expect("CpuBackend must expose a CpuExecSession")
})?;
assert_eq!(r.shape(), &[2, 2]);

Required Methods§

Source

fn svd_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, same-placement materialization, backend, numerical, or contract errors.

Source

fn svd_with_options_read<B: LinalgBackend>( self, options: SvdOptions, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation errors for metadata/options, plus read/materialization or SVD errors.

Source

fn qr_read<B: LinalgBackend>(self, backend: &mut B) -> Result<(Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, same-placement materialization, backend, numerical, or contract errors.

Source

fn qr_with_options_read<B: LinalgBackend>( self, options: QrOptions, backend: &mut B, ) -> Result<(Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation errors for metadata/options, plus read/materialization or QR errors.

Source

fn lu_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, same-placement materialization, backend, numerical, or contract errors.

Source

fn full_piv_lu_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor, Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, same-placement materialization, backend, numerical, or contract errors.

Source

fn full_piv_lu_solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, backend: &mut B, ) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns incompatible-input validation, read/materialization, backend, or singular errors.

Source

fn solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, backend: &mut B, ) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns incompatible-input validation, read/materialization, backend, or singular errors.

Source

fn cholesky_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns matrix validation, read/materialization, backend, or positive-definiteness errors.

Source

fn eigh_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, convergence, or contract errors.

Source

fn eigh_with_options_read<B: LinalgBackend>( self, options: EighOptions, backend: &mut B, ) -> Result<(Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation errors for metadata/options, plus read or Eigh backend errors.

Source

fn eig_read<B: LinalgBackend>(self, backend: &mut B) -> Result<(Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, convergence, or contract errors.

Source

fn triangular_solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, left_side: bool, lower: bool, transpose_a: bool, unit_diagonal: bool, backend: &mut B, ) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns incompatible-input/flag validation, read, backend, or singular errors.

Source

fn slogdet_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, numerical, or LU contract errors.

Source

fn det_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, numerical, or contract errors.

Source

fn inv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, or singular-solve errors.

Source

fn eigvalsh_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, convergence, or contract errors.

Source

fn eigvals_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, convergence, or contract errors.

Source

fn pinv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation, read/materialization, backend, numerical, or SVD contract errors.

Source

fn pinv_with_rtol_read<B: LinalgBackend>( self, rtol: f64, backend: &mut B, ) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns a validation error for invalid rtol, plus errors from Self::pinv_read.

Source

fn norm_read<B: LinalgBackend>( self, ord: Option<f64>, dim: Option<&[usize]>, keepdim: bool, backend: &mut B, ) -> Result<Tensor>

§Errors

Returns tenferro_tensor::Error::Unsupported when the selected backend does not support the operation. Returns validation errors for axes/order combinations or required read/backend operations.

Provided Methods§

Source

fn solve_read_into<B: LinalgBackend>( self, b: TensorRead<'_>, out: TensorWrite<'_>, backend: &mut B, ) -> Result<()>
where Self: Sized,

Solve into a caller-owned destination without allocating the result at the public API boundary.

Backends with a native path may write directly into a compatible target; the trait default preserves the ordinary solve-read plus copy behavior.

§Errors

Returns tenferro_tensor_core::ShapeMismatch or tenferro_tensor_core::ValidationError::DTypeMismatch for incompatible destination metadata, tenferro_tensor_core::ValidationError::InvalidArgument for aliasing or placement violations, Error::Unsupported when the extension implementation or provider is unavailable, and Error::Singular for a singular system.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TensorReadLinalgExt for TensorRead<'_>

Source§

fn svd_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor)>

Source§

fn svd_with_options_read<B: LinalgBackend>( self, options: SvdOptions, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor)>

Source§

fn qr_read<B: LinalgBackend>(self, backend: &mut B) -> Result<(Tensor, Tensor)>

Source§

fn qr_with_options_read<B: LinalgBackend>( self, options: QrOptions, backend: &mut B, ) -> Result<(Tensor, Tensor)>

Source§

fn lu_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor, Tensor)>

Source§

fn full_piv_lu_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor, Tensor, Tensor, Tensor)>

Source§

fn full_piv_lu_solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, backend: &mut B, ) -> Result<Tensor>

Source§

fn solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, backend: &mut B, ) -> Result<Tensor>

Source§

fn solve_read_into<B: LinalgBackend>( self, b: TensorRead<'_>, out: TensorWrite<'_>, backend: &mut B, ) -> Result<()>

Source§

fn cholesky_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

Source§

fn eigh_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>

Source§

fn eigh_with_options_read<B: LinalgBackend>( self, options: EighOptions, backend: &mut B, ) -> Result<(Tensor, Tensor)>

Source§

fn eig_read<B: LinalgBackend>(self, backend: &mut B) -> Result<(Tensor, Tensor)>

Source§

fn triangular_solve_read<B: LinalgBackend>( self, b: TensorRead<'_>, left_side: bool, lower: bool, transpose_a: bool, unit_diagonal: bool, backend: &mut B, ) -> Result<Tensor>

Source§

fn slogdet_read<B: LinalgBackend>( self, backend: &mut B, ) -> Result<(Tensor, Tensor)>

Source§

fn det_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

Source§

fn inv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

Source§

fn eigvalsh_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

Source§

fn eigvals_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

Source§

fn pinv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>

Source§

fn pinv_with_rtol_read<B: LinalgBackend>( self, rtol: f64, backend: &mut B, ) -> Result<Tensor>

Source§

fn norm_read<B: LinalgBackend>( self, ord: Option<f64>, dim: Option<&[usize]>, keepdim: bool, backend: &mut B, ) -> Result<Tensor>

Implementors§