/** * * * Created on: 23 jun. 2018 * Author: AKKA IS */ #include "Sign.hh" #include template int _sign(const Type& el) { double dEl = (double)el; if (dEl < 0.) { return -1; } else if (dEl > 0.) { return 1; } return 0; } template std::vector _sign(const std::vector& el) { std::vector result; for (typename std::vector::const_iterator it = el.begin(); it != el.end(); ++it) { result.push_back(_sign(*it)); } return result; } int Sign(const float& el) { return _sign(el); } int Sign(const double& el) { return _sign(el); } int Sign(const long double& el) { return _sign(el); } int Sign(const int& el) { return _sign(el); } int Sign(const short& el) { return _sign(el); } std::vector Sign(const std::vector& el) { return _sign(el); } std::vector Sign_(const std::vector& el) { return _sign(el); } std::vector Sign_(const std::vector& el) { return _sign(el); } std::vector Sign_(const std::vector& el) { return _sign(el); } std::vector Sign_(const std::vector& el) { return _sign(el); }