Feat C++ API
A feature engineering automation tool
n_not.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_not.h"
6 
7 namespace FT{
8 
9 
10  namespace Pop{
11  namespace Op{
13  {
14  name = "not";
15  otype = 'b';
16  arity['b'] = 1;
17  complexity = 1;
18  }
19 
20  #ifndef USE_CUDA
22  void NodeNot::evaluate(const Data& data, State& state)
23  {
24  state.push<bool>(!state.pop<bool>());
25  }
26  #else
27  void NodeNot::evaluate(const Data& data, State& state)
28  {
29  GPU_Not(state.dev_b, state.idx[otype], state.N);
30  }
31  #endif
32 
34  void NodeNot::eval_eqn(State& state)
35  {
36  state.push<bool>("NOT(" + state.popStr<bool>() + ")");
37  }
38 
39  NodeNot* NodeNot::clone_impl() const { return new NodeNot(*this); }
40 
41  NodeNot* NodeNot::rnd_clone_impl() const { return new NodeNot(); }
42  }
43  }
44 }
data holding X, y, and Z data
Definition: data.h:42
NodeNot * rnd_clone_impl() const override
Definition: n_not.cc:41
NodeNot * clone_impl() const override
Definition: n_not.cc:39
void eval_eqn(State &state)
Evaluates the node symbolically.
Definition: n_not.cc:34
void evaluate(const Data &data, State &state)
Evaluates the node and updates the state states.
Definition: n_not.cc:22
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_Not(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