Type Definition quantity::QuantityArray1 [−][src]
type QuantityArray1<U> = QuantityArray<U, Ix1>;
Implementations
pub fn linspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
pub fn linspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
Create a one-dimensional array with n evenly spaced elements from start
to end
(inclusive) if start
and end
have the same unit.
Example
let x = SIArray1::linspace(1.0 * METER, 3.0 * METER, 5)?; assert_relative_eq!(x, &(arr1(&[1.0, 1.5, 2.0, 2.5, 3.0]) * METER));
pub fn logspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
pub fn logspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
Create a one-dimensional array with n logarithmically spaced elements from start
to end
(inclusive) if start
and end
have the same unit.
Example
let x = SIArray1::logspace(1.0 * METER, 16.0 * METER, 5)?; assert_relative_eq!(x, &(arr1(&[1.0, 2.0, 4.0, 8.0, 16.0]) * METER));