Struct SlogdetResult
pub struct SlogdetResult<T, R = T>{
pub sign: Tensor<T>,
pub logabsdet: Tensor<R>,
}Expand description
Sign-and-log-determinant result: det(A) = sign * exp(logabsdet).
§Examples
use tenferro_device::LogicalMemorySpace;
use tenferro_linalg::slogdet;
use tenferro_prims::CpuContext;
use tenferro_tensor::{MemoryOrder, Tensor};
let mut ctx = CpuContext::new(1);
let a = Tensor::<f64>::zeros(
&[3, 3],
LogicalMemorySpace::MainMemory,
MemoryOrder::ColumnMajor,
).unwrap();
let result = slogdet(&mut ctx, &a).unwrap();
assert_eq!(result.sign.ndim(), 0);Fields§
§sign: Tensor<T>Sign of the determinant.
logabsdet: Tensor<R>Log of the absolute determinant.
Trait Implementations§
Auto Trait Implementations§
impl<T, R> Freeze for SlogdetResult<T, R>
impl<T, R = T> !RefUnwindSafe for SlogdetResult<T, R>
impl<T, R> Send for SlogdetResult<T, R>
impl<T, R> Sync for SlogdetResult<T, R>
impl<T, R> Unpin for SlogdetResult<T, R>
impl<T, R = T> !UnwindSafe for SlogdetResult<T, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more