#include <config.h>
#include <functions/Step.h>
#include <sarray/SArray.h>

using std::vector;

Step::Step ()
  : ScalarFunc ("step", 1)
{
}

double
Step::eval (vector <SArray const *> const &args) const
{
  return args[0]->value ()[0] >= 0 ? 1 : 0;
}

bool Step::isDiscreteValued(vector<SArray const *> const &args) const
{
  return true;
}


syntax highlighted by Code2HTML, v. 0.9.1