pub struct Ast<'a> {
pub kind: AstKind<'a>,
pub span: Option<StringSpan>,
}
Fields§
§kind: AstKind<'a>
§span: Option<StringSpan>
Implementations§
Source§impl<'a> Ast<'a>
impl<'a> Ast<'a>
pub fn tangent(&self) -> Self
pub fn new_named_gradient(gradient_of: Ast<'a>, gradient_wrt: Ast<'a>) -> Self
pub fn new_tensor_elmt(expr: Ast<'a>, indices: Option<Ast<'a>>) -> Self
pub fn new_name(name: &'a str, indices: Vec<char>, is_tangent: bool) -> Self
pub fn new_call_arg(name: Option<&'a str>, expression: Ast<'a>) -> Self
pub fn new_call(fn_name: &'a str, args: Vec<Ast<'a>>, is_tangent: bool) -> Self
pub fn new_monop(op: char, child: Ast<'a>) -> Self
pub fn new_binop(op: char, lhs: Ast<'a>, rhs: Ast<'a>) -> Self
pub fn new_number(num: f64) -> Self
pub fn clone_and_subst<'b>( &self, replacements: &HashMap<&'a str, &'b Ast<'a>>, ) -> Self
pub fn get_dependents(&self) -> HashSet<&'a str>
pub fn get_indices(&self) -> Vec<char>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Ast<'a>
impl<'a> RefUnwindSafe for Ast<'a>
impl<'a> Send for Ast<'a>
impl<'a> Sync for Ast<'a>
impl<'a> Unpin for Ast<'a>
impl<'a> UnwindSafe for Ast<'a>
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