Feat C++ API
A feature engineering automation tool
n_and.cc
Go to the documentation of this file.
1 /* FEAT
2 copyright 2017 William La Cava
3 license: GNU/GPL v3
4 */
5 #include "n_and.h"
6 
7 namespace FT{
8 
9  namespace Pop{
10  namespace Op{
12  {
13  name = "and";
14  otype = 'b';
15  arity['b'] = 2;
16  complexity = 2;
17  }
18 
19  #ifndef USE_CUDA
21  void NodeAnd::evaluate(const Data& data, State& state)
22  {
23  state.push<bool>(state.pop<bool>() && state.pop<bool>());
24 
25  }
26  #else
27  void NodeAnd::evaluate(const Data& data, State& state)
28  {
29  GPU_And(state.dev_b, state.idx[otype], state.N);
30  }
31  #endif
32 
34  void NodeAnd::eval_eqn(State& state)
35  {
36  state.push<bool>("AND(" + state.popStr<bool>() + ","
37  + state.popStr<bool>() + ")");
38  }
39 
40  NodeAnd* NodeAnd::clone_impl() const { return new NodeAnd(*this); }
41 
42  NodeAnd* NodeAnd::rnd_clone_impl() const { return new NodeAnd(); }
43  }
44  }
45 }
data holding X, y, and Z data
Definition: data.h:42
NodeAnd * clone_impl() const override
Definition: n_and.cc:40
void eval_eqn(State &state)
Evaluates the node symbolically.
Definition: n_and.cc:34
void evaluate(const Data &data, State &state)
Evaluates the node and updates the state states.
Definition: n_and.cc:21
NodeAnd * rnd_clone_impl() const override
Definition: n_and.cc:42
string name
node type
Definition: node.h:56
std::map< char, unsigned int > arity
arity of the operator
Definition: node.h:59
char otype
output type
Definition: node.h:58
int complexity
complexity of node
Definition: node.h:60
void GPU_And(bool *x, size_t idx, size_t N)
main Feat namespace
Definition: data.cc:13
contains various types of State actually used by feat
Definition: state.h:102
string popStr()
Definition: state.h:143
Eigen::Array< T, Eigen::Dynamic, 1 > pop()
Definition: state.h:128
void push(Eigen::Array< T, Eigen::Dynamic, 1 > value)
Definition: state.h:123