Enum AstKind

Source
pub enum AstKind<'a> {
Show 25 variants Model(Model<'a>), DsModel(DsModel<'a>), Unknown(Unknown<'a>), Definition(Definition<'a>), Tensor(Tensor<'a>), Indice(Indice<'a>), Vector(Vector<'a>), TensorElmt(TensorElmt<'a>), Assignment(Assignment<'a>), Submodel(Submodel<'a>), Equation(Equation<'a>), RateEquation(RateEquation<'a>), Range(Range), Domain(Domain<'a>), IntRange(IntRange), Binop(Binop<'a>), Monop(Monop<'a>), Call(Call<'a>), CallArg(CallArg<'a>), Index(Index<'a>), Slice(Slice<'a>), Name(Name<'a>), Number(f64), Integer(i64), NamedGradient(NamedGradient<'a>),
}

Variants§

§

Model(Model<'a>)

§

DsModel(DsModel<'a>)

§

Unknown(Unknown<'a>)

§

Definition(Definition<'a>)

§

Tensor(Tensor<'a>)

§

Indice(Indice<'a>)

§

Vector(Vector<'a>)

§

TensorElmt(TensorElmt<'a>)

§

Assignment(Assignment<'a>)

§

Submodel(Submodel<'a>)

§

Equation(Equation<'a>)

§

RateEquation(RateEquation<'a>)

§

Range(Range)

§

Domain(Domain<'a>)

§

IntRange(IntRange)

§

Binop(Binop<'a>)

§

Monop(Monop<'a>)

§

Call(Call<'a>)

§

CallArg(CallArg<'a>)

§

Index(Index<'a>)

§

Slice(Slice<'a>)

§

Name(Name<'a>)

§

Number(f64)

§

Integer(i64)

§

NamedGradient(NamedGradient<'a>)

Implementations§

Source§

impl<'a> AstKind<'a>

Source

pub fn as_tensor(&self) -> Option<&Tensor<'_>>

Source

pub fn as_assignment(&self) -> Option<&Assignment<'_>>

Source

pub fn as_model(&self) -> Option<&Model<'_>>

Source

pub fn as_ds_model(&self) -> Option<&DsModel<'_>>

Source

pub fn to_ds_model(self) -> Option<DsModel<'a>>

Source

pub fn as_domain(&self) -> Option<&Domain<'_>>

Source

pub fn into_model(self) -> Option<Model<'a>>

Source

pub fn as_call_arg(&self) -> Option<&CallArg<'_>>

Source

pub fn as_named_gradient(&self) -> Option<&NamedGradient<'_>>

Source

pub fn as_name(&self) -> Option<&Name<'_>>

Source

pub fn as_array(&self) -> Option<&Tensor<'_>>

Source

pub fn as_vector(&self) -> Option<&Vector<'_>>

Source

pub fn as_real(&self) -> Option<f64>

Source

pub fn as_integer(&self) -> Option<i64>

Source

pub fn as_indice(&self) -> Option<&Indice<'_>>

Source

pub fn as_tensor_elmt(&self) -> Option<&TensorElmt<'_>>

Source

pub fn as_range(&self) -> Option<&Range>

Source

pub fn into_array(self) -> Option<Tensor<'a>>

Source

pub fn new_binop(op: char, left: Ast<'a>, right: Ast<'a>) -> Self

Source

pub fn new_dot(child: Ast<'a>) -> Self

Source

pub fn new_indice( first: Ast<'a>, last: Option<Ast<'a>>, sep: Option<&'a str>, ) -> Self

Source

pub fn new_index(left: Ast<'a>, right: Ast<'a>) -> Self

Source

pub fn new_vector(data: Vec<Ast<'a>>) -> Self

Source

pub fn new_indexed_name(name: &'a str, indices: Vec<char>) -> Self

Source

pub fn new_name(name: &'a str) -> Self

Source

pub fn new_tangent_indexed_name(name: &'a str, indices: Vec<char>) -> Self

Source

pub fn new_time_derivative(name: &'a str, indices: Vec<char>) -> Self

Source

pub fn new_int(num: i64) -> Self

Source

pub fn new_irange(range: (usize, usize)) -> Self

Source

pub fn new_num(num: f64) -> Self

Source

pub fn new_integer(num: i64) -> Self

Source

pub fn new_tensor( name: &'a str, indices: Vec<char>, elmts: Vec<Ast<'a>>, ) -> Self

Source

pub fn new_tensor_elmt(expr: Ast<'a>, indices: Option<Ast<'a>>) -> Self

Trait Implementations§

Source§

impl<'a> Clone for AstKind<'a>

Source§

fn clone(&self) -> AstKind<'a>

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<'a> Debug for AstKind<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for AstKind<'a>

§

impl<'a> RefUnwindSafe for AstKind<'a>

§

impl<'a> Send for AstKind<'a>

§

impl<'a> Sync for AstKind<'a>

§

impl<'a> Unpin for AstKind<'a>

§

impl<'a> UnwindSafe for AstKind<'a>

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.