#ifndef EM_CIRCULAR_H
#define EM_CIRCULAR_H

#include <vector>
#include <stdint.h>
#include <stdio.h>
#include <fstream>

class EMCircular
{
  public:
    EMCircular();
    EMCircular(unsigned int cluster_count_);
    ~EMCircular();

    virtual void train() = 0;
    virtual void add_time(double phase) = 0;

    virtual void print() = 0;

    virtual double get_density_at(double phase) const = 0;

    double get_loglikelihood() const;
    static double time_to_phase(uint32_t time);

  protected:
    unsigned int cluster_count;

    class Timestamp {
      public:
        Timestamp(double phase_, unsigned int cluster_count);
        double phase;
        std::vector<double> alpha;
    };

    std::vector<Timestamp> timestamps;
    std::ofstream likelihood;
};

#endif // EM_CIRCULAR_H
