<commit_before>/////////////////////////////////////////////////////////////////////////////////////////
///
///           \file  Variable.h
///
/// __Description__:     Declares the variables used for the expression template
///
/// __Last modified__:   <2014-07-08 19:14:47 alex>\n
/// __Version__:         1.0\n
/// __Author__:          <NAME>, <EMAIL>\n
/// __Organization__:    Columbia University
///
/////////////////////////////////////////////////////////////////////////////////////////

#ifndef  _VARIABLE_H_
#define  _VARIABLE_H_

#include "cudaControl.h"

namespace CudaLE {

template <int Argument, typename Data = double>
struct Var
{
  HOST_DEVICE Var() {}
  HOST_DEVICE Var(int f) {}
  HD_INLINE Data operator() (Data x1, Data x2 = 0.0, Data x3 = 0.0) const {
    if (1 == Argument)
      return x1;
    else if (2 == Argument)
      return x2;
    else if (3 == Argument)
      return x3;
    else
      return Data();
  }
};

// static Var<1, double> _1;
// static Var<2, double> _2;
// static Var<3, double> _3;
}

// #define _1 Var<1, double>()
// #define _2 Var<2, double>()
// #define _3 Var<3, double>()

#endif   // ----- #ifndef _VARIABLE_H_  ----- <commit_msg>Added back the predefined variables _1, _2, _3 for backward compatibility<commit_after>/////////////////////////////////////////////////////////////////////////////////////////
///
///           \file  Variable.h
///
/// __Description__:     Declares the variables used for the expression template
///
/// __Last modified__:   <2014-07-08 19:14:47 alex>\n
/// __Version__:         1.0\n
/// __Author__:          <NAME>, <EMAIL>\n
/// __Organization__:    Columbia University
///
/////////////////////////////////////////////////////////////////////////////////////////

#ifndef  _VARIABLE_H_
#define  _VARIABLE_H_

#include "cudaControl.h"

namespace CudaLE {

template <int Argument, typename Data = double>
struct Var
{
  HOST_DEVICE Var() {}
  HOST_DEVICE Var(int f) {}
  HD_INLINE Data operator() (Data x1, Data x2 = 0.0, Data x3 = 0.0) const {
    if (1 == Argument)
      return x1;
    else if (2 == Argument)
      return x2;
    else if (3 == Argument)
      return x3;
    else
      return Data();
  }
};

static Var<1, double> _1;
static Var<2, double> _2;
static Var<3, double> _3;

}

// #define _1 Var<1, double>()
// #define _2 Var<2, double>()
// #define _3 Var<3, double>()

#endif   // ----- #ifndef _VARIABLE_H_  ----- 
{'fraction_non_alphanumeric': 0.2802967848309975, 'fraction_numerical': 0.03503709810387469, 'mean_word_length': 1.5254942767950053, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3992305', 'n_tokens_mistral': 772, 'n_tokens_neox': 740, 'n_words': 220}