Graph Framework
Loading...
Searching...
No Matches
node.hpp File Reference

Base nodes of graph computation framework. More...

#include <iostream>
#include <string>
#include <memory>
#include <iomanip>
#include <functional>
#include "backend.hpp"

Go to the source code of this file.

Classes

class  graph::leaf_node< T, SAFE_MATH >
 Class representing a node leaf. More...
 
struct  graph::leaf_node< T, SAFE_MATH >::caches_t
 Data structure to contain the two caches. More...
 
class  graph::constant_node< T, SAFE_MATH >
 Class representing data that cannot change. More...
 
class  graph::straight_node< T, SAFE_MATH >
 Class representing a straight node. More...
 
class  graph::branch_node< T, SAFE_MATH >
 Class representing a branch node. More...
 
class  graph::triple_node< T, SAFE_MATH >
 Class representing a triple branch node. More...
 
class  graph::variable_node< T, SAFE_MATH >
 Class representing data that can change. More...
 
class  graph::pseudo_variable_node< T, SAFE_MATH >
 Class representing a subexpression that acts like a variable. More...
 

Namespaces

namespace  graph
 Name space for graph nodes.
 

Typedefs

template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::shared_leaf = std::shared_ptr< leaf_node< T, SAFE_MATH > >
 Convenience type alias for shared leaf nodes.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::output_nodes = std::vector< shared_leaf< T, SAFE_MATH > >
 Convenience type alias for a vector of output nodes.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::shared_constant = std::shared_ptr< constant_node< T, SAFE_MATH > >
 Convenience type alias for shared constant nodes.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::shared_variable = std::shared_ptr< variable_node< T, SAFE_MATH > >
 Convenience type alias for shared variable nodes.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::input_nodes = std::vector< shared_variable< T, SAFE_MATH > >
 Convenience type alias for a vector of inputs.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::map_nodes = std::vector< std::pair< shared_leaf< T, SAFE_MATH >, shared_variable< T, SAFE_MATH > > >
 Convenience type alias for maping end codes back to inputs.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
using graph::shared_pseudo_variable = std::shared_ptr< pseudo_variable_node< T, SAFE_MATH > >
 Convenience type alias for shared pseudo variable nodes.
 

Functions

template<jit::float_scalar T, bool SAFE_MATH = false>
constexpr shared_leaf< T, SAFE_MATHgraph::null_leaf ()
 Create a null leaf.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
constexpr shared_leaf< T, SAFE_MATH > graph::zero ()
 Forward declare for zero.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
constexpr shared_leaf< T, SAFE_MATHgraph::one ()
 Forward declare for one.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
void graph::make_vizgraph (shared_leaf< T, SAFE_MATH > node)
 Build the vizgraph input.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::constant (const backend::buffer< T > &d)
 Construct a constant.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::constant (const T d)
 Construct a constant.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
constexpr shared_leaf< T, SAFE_MATHgraph::none ()
 Create a one constant.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_constant< T, SAFE_MATHgraph::constant_cast (shared_leaf< T, SAFE_MATH > x)
 Cast to a constant node.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::variable (const size_t s, const std::string &symbol)
 Construct a variable.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::variable (const size_t s, const T d, const std::string &symbol)
 Construct a variable.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::variable (const std::vector< T > &d, const std::string &symbol)
 Construct a variable.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::variable (const backend::buffer< T > &d, const std::string &symbol)
 Construct a variable.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_variable< T, SAFE_MATHgraph::variable_cast (shared_leaf< T, SAFE_MATH > x)
 Cast to a variable node.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_leaf< T, SAFE_MATHgraph::pseudo_variable (shared_leaf< T, SAFE_MATH > x)
 Define pseudo variable convience function.
 
template<jit::float_scalar T, bool SAFE_MATH = false>
shared_pseudo_variable< T, SAFE_MATHgraph::pseudo_variable_cast (shared_leaf< T, SAFE_MATH > &x)
 Cast to a pseudo variable node.
 

Variables

template<jit::complex_scalar T>
constexprgraph::i = T(0.0, 1.0)
 Convinece type for imaginary constant.
 

Detailed Description

Base nodes of graph computation framework.

Defines a tree of operations that allows automatic differentiation.