pub struct Array {
pub shape: Vec<usize>,
pub data: Data,
}Expand description
形つきの配列
Fields§
§shape: Vec<usize>§data: DataImplementations§
Source§impl Array
impl Array
pub fn f64(shape: Vec<usize>, v: Vec<f64>) -> Result<Self>
pub fn c64(shape: Vec<usize>, v: Vec<C64>) -> Result<Self>
pub fn bool(shape: Vec<usize>, v: Vec<bool>) -> Result<Self>
Sourcepub fn grid<T: Clone>(g: &Grid2<T>) -> Self
pub fn grid<T: Clone>(g: &Grid2<T>) -> Self
2 次元の格子の値(crate::grid::Grid2)→ 形 (ny, nx) の配列(行優先のまま写す。座標は別の配列で渡す)。
解析・拡張の 2 次元の出力はこれで作る
pub fn as_f64(&self) -> Option<&[f64]>
pub fn as_c64(&self) -> Option<&[C64]>
pub fn as_bool(&self) -> Option<&[bool]>
Trait Implementations§
impl StructuralPartialEq for Array
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnsafeUnpin for Array
impl UnwindSafe for Array
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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