#ifndef UTILS__HPP
#define UTILS_HPP

#include <Eigen/Core>

class Utils
{
public:
  static float* interp(const float* x, const unsigned int tx, const Eigen::RowVectorXf& xd, const Eigen::RowVectorXf& yd);
  static float interp(float x, float xd1, float yd1, float xd2, float yd2);
  
  static unsigned int search(float to_search, const Eigen::RowVectorXf& data);
  static unsigned int search(float to_search, const float* data, unsigned int first, unsigned int last);

  static float* NPlinearWeightMask(float* x, unsigned int length, float xMin, float xMax, float xTolerance);
};

#endif
