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§
Sourcefn svd_read<B: LinalgBackend>(
self,
backend: &mut B,
) -> Result<(Tensor, Tensor, Tensor)>
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.
Sourcefn svd_with_options_read<B: LinalgBackend>(
self,
options: SvdOptions,
backend: &mut B,
) -> Result<(Tensor, Tensor, Tensor)>
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.
Sourcefn qr_read<B: LinalgBackend>(self, backend: &mut B) -> Result<(Tensor, Tensor)>
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.
Sourcefn qr_with_options_read<B: LinalgBackend>(
self,
options: QrOptions,
backend: &mut B,
) -> Result<(Tensor, Tensor)>
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.
Sourcefn lu_read<B: LinalgBackend>(
self,
backend: &mut B,
) -> Result<(Tensor, Tensor, Tensor, Tensor)>
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.
Sourcefn full_piv_lu_read<B: LinalgBackend>(
self,
backend: &mut B,
) -> Result<(Tensor, Tensor, Tensor, Tensor, Tensor)>
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.
Sourcefn full_piv_lu_solve_read<B: LinalgBackend>(
self,
b: TensorRead<'_>,
backend: &mut B,
) -> Result<Tensor>
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.
Sourcefn 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>
§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.
Sourcefn cholesky_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>
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.
Sourcefn eigh_read<B: LinalgBackend>(
self,
backend: &mut B,
) -> Result<(Tensor, Tensor)>
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.
Sourcefn eigh_with_options_read<B: LinalgBackend>(
self,
options: EighOptions,
backend: &mut B,
) -> Result<(Tensor, Tensor)>
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.
Sourcefn eig_read<B: LinalgBackend>(self, backend: &mut B) -> Result<(Tensor, Tensor)>
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.
Sourcefn 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 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.
Sourcefn slogdet_read<B: LinalgBackend>(
self,
backend: &mut B,
) -> Result<(Tensor, Tensor)>
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.
Sourcefn det_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>
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.
Sourcefn inv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>
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.
Sourcefn eigvalsh_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>
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.
Sourcefn eigvals_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>
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.
Sourcefn pinv_read<B: LinalgBackend>(self, backend: &mut B) -> Result<Tensor>
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.
Sourcefn pinv_with_rtol_read<B: LinalgBackend>(
self,
rtol: f64,
backend: &mut B,
) -> Result<Tensor>
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.
Sourcefn norm_read<B: LinalgBackend>(
self,
ord: Option<f64>,
dim: Option<&[usize]>,
keepdim: bool,
backend: &mut B,
) -> Result<Tensor>
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§
Sourcefn solve_read_into<B: LinalgBackend>(
self,
b: TensorRead<'_>,
out: TensorWrite<'_>,
backend: &mut B,
) -> Result<()>where
Self: Sized,
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.