pub trait Scalar:
Copy
+ Debug
+ PartialEq
+ Send
+ Sync
+ 'static
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Neg<Output = Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ DivAssign {
const IS_COMPLEX: bool;
Show 13 methods
// Required methods
fn zero() -> Self;
fn one() -> Self;
fn from_real(re: f64) -> Self;
fn conj(self) -> Self;
fn re(self) -> f64;
fn im(self) -> f64;
fn abs(self) -> f64;
fn abs_sqr(self) -> f64;
fn scale(self, r: f64) -> Self;
fn is_finite(self) -> bool;
fn to_complex(self) -> Complex<f64>;
fn from_complex(z: Complex<f64>) -> Self;
unsafe fn gemm_sub(
m: usize,
k: usize,
n: usize,
a: *const Self,
rsa: isize,
csa: isize,
b: *const Self,
rsb: isize,
csb: isize,
c: *mut Self,
rsc: isize,
csc: isize,
);
}Expand description
A real or complex double-precision scalar.
Required Associated Constants§
Sourceconst IS_COMPLEX: bool
const IS_COMPLEX: bool
true for complex scalars.
Required Methods§
fn zero() -> Self
fn one() -> Self
fn from_real(re: f64) -> Self
fn is_finite(self) -> bool
Sourcefn to_complex(self) -> Complex<f64>
fn to_complex(self) -> Complex<f64>
As a complex number.
Sourcefn from_complex(z: Complex<f64>) -> Self
fn from_complex(z: Complex<f64>) -> Self
From a complex number (the real part, for reals).
Sourceunsafe fn gemm_sub(
m: usize,
k: usize,
n: usize,
a: *const Self,
rsa: isize,
csa: isize,
b: *const Self,
rsb: isize,
csb: isize,
c: *mut Self,
rsc: isize,
csc: isize,
)
unsafe fn gemm_sub( m: usize, k: usize, n: usize, a: *const Self, rsa: isize, csa: isize, b: *const Self, rsb: isize, csb: isize, c: *mut Self, rsc: isize, csc: isize, )
C ← C − A B for an m × k matrix A, a k × n matrix B and an m × n matrix C,
each given by a pointer to its first element and its row and column strides.
§Safety
The pointers and strides must describe valid matrices, and C must not overlap A or B.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".