Table2D

Struct Table2D 

Source
pub struct Table2D<T>(pub Vec<Vec<T>>);
Expand description

2D table of constants.

Tuple Fields§

§0: Vec<Vec<T>>

Implementations§

Source§

impl<T> Table2D<T>

Source

pub fn new(vector: Vec<Vec<T>>) -> Table2D<T>

Returns a new table.

Source

pub fn get(&self, x: Element, y: Element) -> &T

Returns a constant.

§Panics

Panics if the index is out of bound.

Source

pub fn set(&mut self, x: Element, y: Element, v: T)

Sets a constant.

§Panics

Panics if the index is out of bound.

Source

pub fn update(&mut self, vector: Vec<Vec<T>>)

Updates the table.

Source§

impl<T: Copy> Table2D<T>

Source

pub fn eval(&self, x: Element, y: Element) -> T

Returns a constant.

§Panics

Panics if the index is out of bound.

Source§

impl Table2D<Set>

Source

pub fn capacity_of_set(&self) -> usize

Return the capacity of a set constant.

§Panics

Panics if the table is empty.

Trait Implementations§

Source§

impl<T: AbsDiffEq> AbsDiffEq for Table2D<T>
where T::Epsilon: Copy,

Source§

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> T::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq(&self, other: &Self, epsilon: T::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl<T: Clone> Clone for Table2D<T>

Source§

fn clone(&self) -> Table2D<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Table2D<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> HasShape for Table2D<T>

Source§

fn shape(&self) -> Vec<usize>

Returns the size of the Table.
Source§

impl<T: PartialEq> PartialEq for Table2D<T>

Source§

fn eq(&self, other: &Table2D<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: RelativeEq> RelativeEq for Table2D<T>
where T::Epsilon: Copy,

Source§

fn default_max_relative() -> T::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Source§

fn relative_eq( &self, other: &Self, epsilon: T::Epsilon, max_relative: T::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Source§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
Source§

impl<T> StructuralPartialEq for Table2D<T>

Auto Trait Implementations§

§

impl<T> Freeze for Table2D<T>

§

impl<T> RefUnwindSafe for Table2D<T>
where T: RefUnwindSafe,

§

impl<T> Send for Table2D<T>
where T: Send,

§

impl<T> Sync for Table2D<T>
where T: Sync,

§

impl<T> Unpin for Table2D<T>
where T: Unpin,

§

impl<T> UnwindSafe for Table2D<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.