C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
exprtk::details::vec_binop_vecvec_node< T, Operation > Class Template Reference

#include <exprtk.hpp>

Inheritance diagram for exprtk::details::vec_binop_vecvec_node< T, Operation >:
[legend]
Collaboration diagram for exprtk::details::vec_binop_vecvec_node< T, Operation >:
[legend]

Public Types

typedef expression_node< T > * expression_ptr
typedef vector_node< T > * vector_node_ptr
typedef vector_holder< T > vector_holder_t
typedef vector_holder_t * vector_holder_ptr
typedef vec_data_store< T > vds_t
typedef memory_context_t< T > memory_context
Public Types inherited from exprtk::details::binary_node< T >
typedef expression_node< T > * expression_ptr
typedef std::pair< expression_ptr, bool > branch_t
Public Types inherited from exprtk::details::expression_node< T >
enum  node_type {
  e_none , e_null , e_constant , e_unary ,
  e_binary , e_binary_ext , e_trinary , e_quaternary ,
  e_vararg , e_conditional , e_while , e_repeat ,
  e_for , e_switch , e_mswitch , e_return ,
  e_retenv , e_variable , e_stringvar , e_stringconst ,
  e_stringvarrng , e_cstringvarrng , e_strgenrange , e_strconcat ,
  e_stringvarsize , e_strswap , e_stringsize , e_stringvararg ,
  e_function , e_vafunction , e_genfunction , e_strfunction ,
  e_strcondition , e_strccondition , e_add , e_sub ,
  e_mul , e_div , e_mod , e_pow ,
  e_lt , e_lte , e_gt , e_gte ,
  e_eq , e_ne , e_and , e_nand ,
  e_or , e_nor , e_xor , e_xnor ,
  e_in , e_like , e_ilike , e_inranges ,
  e_ipow , e_ipowinv , e_abs , e_acos ,
  e_acosh , e_asin , e_asinh , e_atan ,
  e_atanh , e_ceil , e_cos , e_cosh ,
  e_exp , e_expm1 , e_floor , e_log ,
  e_log10 , e_log2 , e_log1p , e_neg ,
  e_pos , e_round , e_sin , e_sinc ,
  e_sinh , e_sqrt , e_tan , e_tanh ,
  e_cot , e_sec , e_csc , e_r2d ,
  e_d2r , e_d2g , e_g2d , e_notl ,
  e_sgn , e_erf , e_erfc , e_ncdf ,
  e_frac , e_trunc , e_uvouv , e_vov ,
  e_cov , e_voc , e_vob , e_bov ,
  e_cob , e_boc , e_vovov , e_vovoc ,
  e_vocov , e_covov , e_covoc , e_vovovov ,
  e_vovovoc , e_vovocov , e_vocovov , e_covovov ,
  e_covocov , e_vocovoc , e_covovoc , e_vococov ,
  e_sf3ext , e_sf4ext , e_nulleq , e_strass ,
  e_vector , e_vecsize , e_vecelem , e_veccelem ,
  e_vecelemrtc , e_veccelemrtc , e_rbvecelem , e_rbvecelemrtc ,
  e_rbveccelem , e_rbveccelemrtc , e_vecinit , e_vecvalass ,
  e_vecvecass , e_vecopvalass , e_vecopvecass , e_vecfunc ,
  e_vecvecswap , e_vecvecineq , e_vecvalineq , e_valvecineq ,
  e_vecvecarith , e_vecvalarith , e_valvecarith , e_vecunaryop ,
  e_vecondition , e_break , e_continue , e_swap ,
  e_assert
}
typedef T value_type
typedef expression_node< T > * expression_ptr
typedef node_collector_interface< expression_node< T > > nci_t
typedef nci_t::noderef_list_t noderef_list_t
typedef node_depth_base< expression_node< T > > ndb_t
Public Types inherited from exprtk::details::node_collector_interface< expression_node< T > >
typedef expression_node< T > * node_ptr_t
typedef expression_node< T > ** node_pp_t
typedef std::vector< node_pp_t > noderef_list_t
Public Types inherited from exprtk::details::node_depth_base< expression_node< T > >
typedef expression_node< T > * node_ptr_t
typedef std::pair< node_ptr_t, bool > nb_pair_t
Public Types inherited from exprtk::details::vector_interface< T >
typedef vector_node< T > * vector_node_ptr
typedef vec_data_store< T > vds_t

Public Member Functions

 vec_binop_vecvec_node (const operator_type &opr, expression_ptr branch0, expression_ptr branch1)
 ~vec_binop_vecvec_node ()
T value () const
vector_node_ptr vec () const
vector_node_ptr vec ()
expression_node< T >::node_type type () const
bool valid () const
std::size_t size () const
std::size_t base_size () const
vds_t & vds ()
const vds_t & vds () const
Public Member Functions inherited from exprtk::details::binary_node< T >
 binary_node (const operator_type &opr, expression_ptr branch0, expression_ptr branch1)
operator_type operation ()
expression_node< T > * branch (const std::size_t &index=0) const
void collect_nodes (typename expression_node< T >::noderef_list_t &node_delete_list)
std::size_t node_depth () const
Public Member Functions inherited from exprtk::details::expression_node< T >
virtual ~expression_node ()
Public Member Functions inherited from exprtk::details::node_collector_interface< expression_node< T > >
virtual ~node_collector_interface ()
virtual void collect_nodes (noderef_list_t &)
Public Member Functions inherited from exprtk::details::node_depth_base< expression_node< T > >
 node_depth_base ()
virtual ~node_depth_base ()
std::size_t compute_node_depth (const expression_node< T > *const &node) const
std::size_t compute_node_depth (const nb_pair_t &branch) const
std::size_t compute_node_depth (const nb_pair_t(&branch)[N]) const
std::size_t max_node_depth (const BranchType &n0, const BranchType &n1) const
std::size_t max_node_depth (const BranchType &n0, const BranchType &n1, const BranchType &n2) const
std::size_t max_node_depth (const BranchType &n0, const BranchType &n1, const BranchType &n2, const BranchType &n3) const
std::size_t compute_node_depth (const BranchType &n0, const BranchType &n1) const
std::size_t compute_node_depth (const BranchType &n0, const BranchType &n1, const BranchType &n2) const
std::size_t compute_node_depth (const BranchType &n0, const BranchType &n1, const BranchType &n2, const BranchType &n3) const
std::size_t compute_node_depth (const Sequence< node_ptr_t, Allocator > &branch_list) const
std::size_t compute_node_depth (const Sequence< nb_pair_t, Allocator > &branch_list) const
void collect (node_ptr_t const &node, const bool deletable, NodeSequence &delete_node_list) const
void collect (const nb_pair_t &branch, NodeSequence &delete_node_list) const
void collect (expression_node< T > *&node, NodeSequence &delete_node_list) const
void collect (const nb_pair_t(&branch)[N], NodeSequence &delete_node_list) const
void collect (const Sequence< nb_pair_t, Allocator > &branch, NodeSequence &delete_node_list) const
void collect (const Sequence< node_ptr_t, Allocator > &branch_list, NodeSequence &delete_node_list) const
void collect (const Sequence< node_ptr_t, AllocatorT > &branch_list, const Sequence< Boolean, AllocatorB > &branch_deletable_list, NodeSequence &delete_node_list) const
Public Member Functions inherited from exprtk::details::vector_interface< T >
virtual ~vector_interface ()
virtual bool side_effect () const

Private Attributes

vector_node_ptr vec0_node_ptr_
vector_node_ptr vec1_node_ptr_
bool initialised_
vds_t vds_
memory_context memory_context_

Additional Inherited Members

Public Attributes inherited from exprtk::details::node_depth_base< expression_node< T > >
bool depth_set
std::size_t depth

Detailed Description

template<typename T, typename Operation>
class exprtk::details::vec_binop_vecvec_node< T, Operation >

Definition at line 13738 of file exprtk.hpp.

Member Typedef Documentation

◆ expression_ptr

template<typename T, typename Operation>
typedef expression_node<T>* exprtk::details::vec_binop_vecvec_node< T, Operation >::expression_ptr

Definition at line 13744 of file exprtk.hpp.

◆ memory_context

template<typename T, typename Operation>
typedef memory_context_t<T> exprtk::details::vec_binop_vecvec_node< T, Operation >::memory_context

Definition at line 13749 of file exprtk.hpp.

◆ vds_t

template<typename T, typename Operation>
typedef vec_data_store<T> exprtk::details::vec_binop_vecvec_node< T, Operation >::vds_t

Definition at line 13748 of file exprtk.hpp.

◆ vector_holder_ptr

template<typename T, typename Operation>
typedef vector_holder_t* exprtk::details::vec_binop_vecvec_node< T, Operation >::vector_holder_ptr

Definition at line 13747 of file exprtk.hpp.

◆ vector_holder_t

template<typename T, typename Operation>
typedef vector_holder<T> exprtk::details::vec_binop_vecvec_node< T, Operation >::vector_holder_t

Definition at line 13746 of file exprtk.hpp.

◆ vector_node_ptr

template<typename T, typename Operation>
typedef vector_node<T>* exprtk::details::vec_binop_vecvec_node< T, Operation >::vector_node_ptr

Definition at line 13745 of file exprtk.hpp.

Constructor & Destructor Documentation

◆ vec_binop_vecvec_node()

template<typename T, typename Operation>
exprtk::details::vec_binop_vecvec_node< T, Operation >::vec_binop_vecvec_node ( const operator_type & opr,
expression_ptr branch0,
expression_ptr branch1 )
inline

Definition at line 13753 of file exprtk.hpp.

13757 , vec0_node_ptr_(0)
13758 , vec1_node_ptr_(0)
13759 , initialised_(false)
13760 {
13761 bool v0_is_ivec = false;
13762 bool v1_is_ivec = false;
13763
13764 if (is_vector_node(branch(0)))
13765 {
13766 vec0_node_ptr_ = static_cast<vector_node_ptr>(branch(0));
13767 }
13768 else if (is_ivector_node(branch(0)))
13769 {
13770 vector_interface<T>* vi = reinterpret_cast<vector_interface<T>*>(0);
13771
13772 if (0 != (vi = dynamic_cast<vector_interface<T>*>(branch(0))))
13773 {
13774 vec0_node_ptr_ = vi->vec();
13775 v0_is_ivec = true;
13776 }
13777 }
13778
13779 if (is_vector_node(branch(1)))
13780 {
13781 vec1_node_ptr_ = static_cast<vector_node_ptr>(branch(1));
13782 }
13783 else if (is_ivector_node(branch(1)))
13784 {
13785 vector_interface<T>* vi = reinterpret_cast<vector_interface<T>*>(0);
13786
13787 if (0 != (vi = dynamic_cast<vector_interface<T>*>(branch(1))))
13788 {
13789 vec1_node_ptr_ = vi->vec();
13790 v1_is_ivec = true;
13791 }
13792 }
13793
13795 {
13796 vector_holder<T>& vec0 = vec0_node_ptr_->vec_holder();
13797 vector_holder<T>& vec1 = vec1_node_ptr_->vec_holder();
13798
13799 if (v0_is_ivec && (vec0.base_size() <= vec1.base_size()))
13800 {
13801 vds_ = vds_t(vec0_node_ptr_->vds());
13802 }
13803 else if (v1_is_ivec && (vec1.base_size() <= vec0.base_size()))
13804 {
13805 vds_ = vds_t(vec1_node_ptr_->vds());
13806 }
13807 else
13808 {
13810 }
13811
13813
13814 initialised_ =
13815 (size() <= base_size()) &&
13817 }
13818
13819 assert(valid());
13820 }
binary_node(const operator_type &opr, expression_ptr branch0, expression_ptr branch1)
Definition exprtk.hpp:7110
expression_node< T > * branch(const std::size_t &index=0) const
Definition exprtk.hpp:7139
bool is_ivector_node(const expression_node< T > *node)
Definition exprtk.hpp:5904
memory_context_t< T > make_memory_context(vector_holder< T > &vec_holder, vec_data_store< T > &vds)
Definition exprtk.hpp:13698
bool is_vector_node(const expression_node< T > *node)
Definition exprtk.hpp:5898

References base_size(), exprtk::details::vector_holder< Type >::base_size(), exprtk::details::binary_node< T >::binary_node(), exprtk::details::binary_node< T >::branch(), initialised_, exprtk::details::is_ivector_node(), exprtk::details::is_vector_node(), exprtk::details::make_memory_context(), memory_context_, size(), exprtk::details::binary_node< T >::valid(), valid(), vds(), vds_, exprtk::details::vector_interface< T >::vec(), vec0_node_ptr_, and vec1_node_ptr_.

Here is the call graph for this function:

◆ ~vec_binop_vecvec_node()

template<typename T, typename Operation>
exprtk::details::vec_binop_vecvec_node< T, Operation >::~vec_binop_vecvec_node ( )
inline

Definition at line 13822 of file exprtk.hpp.

13823 {
13824 memory_context_.clear();
13825 }

References memory_context_.

Member Function Documentation

◆ base_size()

template<typename T, typename Operation>
std::size_t exprtk::details::vec_binop_vecvec_node< T, Operation >::base_size ( ) const
inlinevirtual

Implements exprtk::details::vector_interface< T >.

Definition at line 13915 of file exprtk.hpp.

13916 {
13917 return std::min(
13918 vec0_node_ptr_->vec_holder().base_size(),
13919 vec1_node_ptr_->vec_holder().base_size());
13920 }

References exprtk_override, vec0_node_ptr_, and vec1_node_ptr_.

Referenced by vec_binop_vecvec_node().

Here is the caller graph for this function:

◆ size()

template<typename T, typename Operation>
std::size_t exprtk::details::vec_binop_vecvec_node< T, Operation >::size ( ) const
inlinevirtual

Implements exprtk::details::vector_interface< T >.

Definition at line 13907 of file exprtk.hpp.

13908 {
13909 return std::min(vds().size(),
13910 std::min(
13911 vec0_node_ptr_->vec_holder().size(),
13912 vec1_node_ptr_->vec_holder().size()));
13913 }

References exprtk_override, size(), vds(), vec0_node_ptr_, and vec1_node_ptr_.

Referenced by size(), value(), and vec_binop_vecvec_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

template<typename T, typename Operation>
expression_node< T >::node_type exprtk::details::vec_binop_vecvec_node< T, Operation >::type ( ) const
inlinevirtual

Reimplemented from exprtk::details::binary_node< T >.

Definition at line 13897 of file exprtk.hpp.

13898 {
13900 }

References exprtk::details::expression_node< T >::e_vecvecarith, and exprtk_override.

◆ valid()

template<typename T, typename Operation>
bool exprtk::details::vec_binop_vecvec_node< T, Operation >::valid ( ) const
inlinevirtual

Reimplemented from exprtk::details::binary_node< T >.

Definition at line 13902 of file exprtk.hpp.

13903 {
13904 return initialised_;
13905 }

References exprtk_override, and initialised_.

Referenced by vec_binop_vecvec_node().

Here is the caller graph for this function:

◆ value()

template<typename T, typename Operation>
T exprtk::details::vec_binop_vecvec_node< T, Operation >::value ( ) const
inlinevirtual

Reimplemented from exprtk::details::binary_node< T >.

Definition at line 13827 of file exprtk.hpp.

13828 {
13829 branch(0)->value();
13830 branch(1)->value();
13831
13832 const T* vec0 = vec0_node_ptr_->vds().data();
13833 const T* vec1 = vec1_node_ptr_->vds().data();
13834 T* vec2 = vds().data();
13835
13837 const T* upper_bound = vec2 + lud.upper_bound;
13838
13839 while (vec2 < upper_bound)
13840 {
13841 #define exprtk_loop(N) \
13842 vec2[N] = Operation::process(vec0[N], vec1[N]); \
13843
13844 exprtk_loop( 0) exprtk_loop( 1)
13845 exprtk_loop( 2) exprtk_loop( 3)
13846 #ifndef exprtk_disable_superscalar_unroll
13847 exprtk_loop( 4) exprtk_loop( 5)
13848 exprtk_loop( 6) exprtk_loop( 7)
13849 exprtk_loop( 8) exprtk_loop( 9)
13850 exprtk_loop(10) exprtk_loop(11)
13851 exprtk_loop(12) exprtk_loop(13)
13852 exprtk_loop(14) exprtk_loop(15)
13853 #endif
13854
13855 vec0 += lud.batch_size;
13856 vec1 += lud.batch_size;
13857 vec2 += lud.batch_size;
13858 }
13859
13860 int i = 0;
13861
13862 switch (lud.remainder)
13863 {
13864 #define case_stmt(N) \
13865 case N : { vec2[i] = Operation::process(vec0[i], vec1[i]); ++i; } \
13866 exprtk_fallthrough \
13867
13868 #ifndef exprtk_disable_superscalar_unroll
13869 case_stmt(15) case_stmt(14)
13870 case_stmt(13) case_stmt(12)
13871 case_stmt(11) case_stmt(10)
13872 case_stmt( 9) case_stmt( 8)
13873 case_stmt( 7) case_stmt( 6)
13874 case_stmt( 5) case_stmt( 4)
13875 #endif
13876 case_stmt( 3) case_stmt( 2)
13877 case_stmt( 1)
13878 default: break;
13879 }
13880
13881 #undef exprtk_loop
13882 #undef case_stmt
13883
13884 return (vds().data())[0];
13885 }
#define case_stmt(N)
Definition exprtk.hpp:33330
#define exprtk_loop(N)

References exprtk::details::loop_unroll::details::batch_size, exprtk::details::binary_node< T >::branch(), case_stmt, exprtk::details::vec_data_store< T >::data(), exprtk_loop, exprtk_override, exprtk::details::loop_unroll::details::remainder, size(), exprtk::details::loop_unroll::details::upper_bound, vds(), vec0_node_ptr_, and vec1_node_ptr_.

Here is the call graph for this function:

◆ vds() [1/2]

template<typename T, typename Operation>
vds_t & exprtk::details::vec_binop_vecvec_node< T, Operation >::vds ( )
inlinevirtual

Implements exprtk::details::vector_interface< T >.

Definition at line 13922 of file exprtk.hpp.

13923 {
13924 return vds_;
13925 }

References exprtk_override, and vds_.

Referenced by size(), value(), and vec_binop_vecvec_node().

Here is the caller graph for this function:

◆ vds() [2/2]

template<typename T, typename Operation>
const vds_t & exprtk::details::vec_binop_vecvec_node< T, Operation >::vds ( ) const
inlinevirtual

Implements exprtk::details::vector_interface< T >.

Definition at line 13927 of file exprtk.hpp.

13928 {
13929 return vds_;
13930 }

References exprtk_override, and vds_.

◆ vec() [1/2]

template<typename T, typename Operation>
vector_node_ptr exprtk::details::vec_binop_vecvec_node< T, Operation >::vec ( )
inlinevirtual

Implements exprtk::details::vector_interface< T >.

Definition at line 13892 of file exprtk.hpp.

13893 {
13894 return memory_context_.temp_vec_node_;
13895 }

References exprtk_override, and memory_context_.

◆ vec() [2/2]

template<typename T, typename Operation>
vector_node_ptr exprtk::details::vec_binop_vecvec_node< T, Operation >::vec ( ) const
inlinevirtual

Implements exprtk::details::vector_interface< T >.

Definition at line 13887 of file exprtk.hpp.

13888 {
13889 return memory_context_.temp_vec_node_;
13890 }

References exprtk_override, and memory_context_.

Member Data Documentation

◆ initialised_

template<typename T, typename Operation>
bool exprtk::details::vec_binop_vecvec_node< T, Operation >::initialised_
private

Definition at line 13936 of file exprtk.hpp.

Referenced by valid(), and vec_binop_vecvec_node().

◆ memory_context_

template<typename T, typename Operation>
memory_context exprtk::details::vec_binop_vecvec_node< T, Operation >::memory_context_
private

Definition at line 13938 of file exprtk.hpp.

Referenced by vec(), vec(), vec_binop_vecvec_node(), and ~vec_binop_vecvec_node().

◆ vds_

template<typename T, typename Operation>
vds_t exprtk::details::vec_binop_vecvec_node< T, Operation >::vds_
private

Definition at line 13937 of file exprtk.hpp.

Referenced by vds(), vds(), and vec_binop_vecvec_node().

◆ vec0_node_ptr_

template<typename T, typename Operation>
vector_node_ptr exprtk::details::vec_binop_vecvec_node< T, Operation >::vec0_node_ptr_
private

Definition at line 13934 of file exprtk.hpp.

Referenced by base_size(), size(), value(), and vec_binop_vecvec_node().

◆ vec1_node_ptr_

template<typename T, typename Operation>
vector_node_ptr exprtk::details::vec_binop_vecvec_node< T, Operation >::vec1_node_ptr_
private

Definition at line 13935 of file exprtk.hpp.

Referenced by base_size(), size(), value(), and vec_binop_vecvec_node().


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