Graph Framework
Loading...
Searching...
No Matches
graph::apply_u_node< T > Class Template Referencefinal

U Collision node. More...

#include <particle_in_cell.hpp>

Inheritance diagram for graph::apply_u_node< T >:
graph::no_derivative< T, false, n_branch_node< 7, T, false >, 7 > graph::n_branch_node< 7, T, false > graph::leaf_node< T, SAFE_MATH >

Public Member Functions

 apply_u_node (shared_leaf< T > x, shared_leaf< T > i, shared_leaf< T > rand, shared_leaf< T > mof, shared_leaf< T > tbnu_e_dt, shared_leaf< T > A, shared_leaf< T > B)
 Construct an apply_u_node.
 
virtual backend::buffer< T > evaluate ()
 Evaluate the results of the applying the u operator.
 
virtual shared_leaf< T > reduce ()
 Reduce the apply_u(x, i, rand, mof, tbnu_e_dt, A, B).
 
virtual void compile_preamble (std::ostringstream &stream, jit::register_map &registers, jit::visiter_map &visited, jit::register_usage &usage, jit::texture1d_list &textures1d, jit::texture2d_list &textures2d, jit::preamble_map &pre_funcs, int &avail_const_mem)
 Compile preamble.
 
virtual shared_leaf< T > compile (std::ostringstream &stream, jit::register_map &registers, const jit::register_map &thread_mem, const jit::register_usage &usage)
 Compile the node.
 
virtual bool is_match (shared_leaf< T > x)
 Query if the nodes match.
 
virtual void to_latex () const
 Convert the node to latex.
 
virtual shared_leaf< T > remove_pseudo ()
 Remove pseudo variable nodes.
 
virtual shared_leaf< T > to_vizgraph (std::stringstream &stream, jit::register_map &registers)
 Convert the node to vizgraph.
 
- Public Member Functions inherited from graph::no_derivative< T, false, n_branch_node< 7, T, false >, 7 >
std::shared_ptr< leaf_node< T, SAFE_MATH > > df (std::shared_ptr< leaf_node< T, SAFE_MATH > > x)
 Transform node to derivative.
 
 no_derivative (const std::string s)
 Constructor for base leaf nodes base classes.
 
 no_derivative (shared_leaf< T, SAFE_MATH > arg, const std::string s)
 Constructor for straight node base classes.
 
 no_derivative (shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > r, const std::string s)
 Constructor for base branch nodes base classes.
 
 no_derivative (shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > m, shared_leaf< T, SAFE_MATH > r, const std::string s)
 Constructor for base triple nodes base classes.
 
 no_derivative (std::array< shared_leaf< T, SAFE_MATH >, N > b, const std::string s)
 Constructor for base n branch nodes base classes.
 
- Public Member Functions inherited from graph::n_branch_node< 7, T, false >
 n_branch_node (std::array< shared_leaf< T, SAFE_MATH >, N > branches, const std::string s)
 Reduces and assigns the branches.
 
shared_leaf< T, SAFE_MATH > get_arg (const size_t index) const
 Get the Nth arg.
 
virtual bool is_all_variables () const
 Test if node acts like a variable.
 
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > get_power_exponent () const
 Get the exponent of a power.
 
- Public Member Functions inherited from graph::leaf_node< T, SAFE_MATH >
 leaf_node (const std::string s, const size_t count, const bool pseudo)
 Construct a basic node.
 
virtual ~leaf_node ()
 Destructor.
 
virtual bool is_match (std::shared_ptr< leaf_node< T, SAFE_MATH > > x)
 Query if the nodes match.
 
bool is_power_base_match (std::shared_ptr< leaf_node< T, SAFE_MATH > > x)
 Check if the base of the powers match.
 
virtual void set (const T d)
 Set the value of variable data.
 
virtual void set (const size_t index, const T d)
 Set the value of variable data.
 
virtual void set (const std::vector< T > &d)
 Set the value of variable data.
 
virtual void set (const backend::buffer< T > &d)
 Set the value of variable data.
 
virtual bool is_constant () const
 Test if node is a constant.
 
virtual bool has_constant_zero () const
 Test the constant node has a zero.
 
bool is_normal ()
 Test if the result is normal.
 
virtual bool is_power_like () const
 Test if the node acts like a power of variable.
 
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > get_power_base ()
 Get the base of a power.
 
size_t get_hash () const
 Get the hash for the node.
 
size_t get_complexity () const
 Get the number of nodes in the subgraph.
 
virtual bool has_pseudo () const
 Query if the node contains pseudo variables.
 
virtual void endline (std::ostringstream &stream, const jit::register_usage &usage, const char end=';') const
 End a line in the kernel source.
 

Additional Inherited Members

- Public Types inherited from graph::leaf_node< T, SAFE_MATH >
typedef T base
 Type def to retrieve the backend type.
 
- Static Public Attributes inherited from graph::leaf_node< T, SAFE_MATH >
static thread_local caches_t caches
 A per thread instance of the cache structure.
 
- Protected Member Functions inherited from graph::n_branch_node< 7, T, false >
bool any_has_pseudo (std::array< shared_leaf< T, SAFE_MATH >, N > &branches)
 Check if any sub-node has a pseudo variable.
 
size_t total_complexity (std::array< shared_leaf< T, SAFE_MATH >, N > &branches)
 Check if any sub-node has a pseudo variable.
 
- Protected Attributes inherited from graph::n_branch_node< 7, T, false >
std::array< shared_leaf< T, SAFE_MATH >, N > branches
 Branches of the tree.
 
- Protected Attributes inherited from graph::leaf_node< T, SAFE_MATH >
const size_t hash
 Hash for node.
 
const size_t complexity
 Graph complexity.
 
std::unordered_map< size_t, std::shared_ptr< leaf_node< T, SAFE_MATH > > > df_cache
 Cache derivative terms.
 
const bool contains_pseudo
 Node contains pseudo variables.
 

Detailed Description

template<std::floating_point T>
class graph::apply_u_node< T >

U Collision node.

Template Parameters
TBase type of the calculation.

Constructor & Destructor Documentation

◆ apply_u_node()

template<std::floating_point T>
graph::apply_u_node< T >::apply_u_node ( shared_leaf< T >  x,
shared_leaf< T >  i,
shared_leaf< T >  rand,
shared_leaf< T >  mof,
shared_leaf< T >  tbnu_e_dt,
shared_leaf< T >  A,
shared_leaf< T >  B 
)
inline

Construct an apply_u_node.

Parameters
[in]xArgument to apply collision to.
[in]iNumber of collision iterations.
[in]randA random value of 0s and 1s.
[in]mofMass over 2 e.
[in]tbnu_e_dtTemperature of species b times normalized collision rate.
[in]AA collision factor.
[in]BB collision factor.

Member Function Documentation

◆ compile()

template<std::floating_point T>
virtual shared_leaf< T > graph::apply_u_node< T >::compile ( std::ostringstream &  stream,
jit::register_map &  registers,
const jit::register_map &  thread_mem,
const jit::register_usage &  usage 
)
inlinevirtual

Compile the node.

Parameters
[in,out]streamString buffer stream.
[in,out]registersList of defined registers.
[in]thread_memList of defined thread memory registers.
[in]usageList of register usage count.
Returns
The current node.

Implements graph::leaf_node< T, SAFE_MATH >.

◆ compile_preamble()

template<std::floating_point T>
virtual void graph::apply_u_node< T >::compile_preamble ( std::ostringstream &  stream,
jit::register_map &  registers,
jit::visiter_map &  visited,
jit::register_usage &  usage,
jit::texture1d_list &  textures1d,
jit::texture2d_list &  textures2d,
jit::preamble_map &  pre_funcs,
int &  avail_const_mem 
)
inlinevirtual

Compile preamble.

Parameters
[in,out]streamString buffer stream.
[in,out]registersList of defined registers.
[in,out]visitedList of visited nodes.
[in,out]usageList of register usage count.
[in,out]textures1dList of 1D textures.
[in,out]textures2dList of 2D textures.
[in,out]pre_funcsSet of preamble functions.
[in,out]avail_const_memAvailable constant memory.

Reimplemented from graph::n_branch_node< 7, T, false >.

◆ evaluate()

template<std::floating_point T>
virtual backend::buffer< T > graph::apply_u_node< T >::evaluate ( )
inlinevirtual

Evaluate the results of the applying the u operator.

result = apply_u(x, i, rand, mof, tbnu_e_dt, A, B)

Implements graph::leaf_node< T, SAFE_MATH >.

◆ is_match()

template<std::floating_point T>
virtual bool graph::apply_u_node< T >::is_match ( shared_leaf< T >  x)
inlinevirtual

Query if the nodes match.

Parameters
[in]xOther graph to check if it is a match.
Returns
True if the nodes are a match.

◆ reduce()

template<std::floating_point T>
virtual shared_leaf< T > graph::apply_u_node< T >::reduce ( )
inlinevirtual

Reduce the apply_u(x, i, rand, mof, tbnu_e_dt, A, B).

Returns
Reduced graph from apply_u.

Reimplemented from graph::leaf_node< T, SAFE_MATH >.

◆ remove_pseudo()

template<std::floating_point T>
virtual shared_leaf< T > graph::apply_u_node< T >::remove_pseudo ( )
inlinevirtual

Remove pseudo variable nodes.

Returns
A tree without variable nodes.

Reimplemented from graph::leaf_node< T, SAFE_MATH >.

◆ to_latex()

template<std::floating_point T>
virtual void graph::apply_u_node< T >::to_latex ( ) const
inlinevirtual

Convert the node to latex.

Reimplemented from graph::leaf_node< T, SAFE_MATH >.

◆ to_vizgraph()

template<std::floating_point T>
virtual shared_leaf< T > graph::apply_u_node< T >::to_vizgraph ( std::stringstream &  stream,
jit::register_map &  registers 
)
inlinevirtual

Convert the node to vizgraph.

Parameters
[in,out]streamString buffer stream.
[in,out]registersList of defined registers.
Returns
The current node.

Implements graph::leaf_node< T, SAFE_MATH >.


The documentation for this class was generated from the following file: