#ifndef CAPPEDSTORAGE_H #define CAPPEDSTORAGE_H #include #include #include #include #include #include #include #include namespace c = std::chrono; //Class for one dimensional double values class CappedStorage { private: //Stored values Eigen::Matrix X; Eigen::Matrix y; std::unique_ptr accessMtx; //If set, storage is extended by bias column (X(:, 1)) //to perform ML Algorithms const bool biased; public: CappedStorage(bool _biased); void store(const std::vector &d); long size() const{ return X.rows(); }; void clear(); Eigen::Matrix& getX(){return X;} Eigen::Matrix& getY(){return y;} long long getN(){return X.cols();} long long getM(){return X.rows();} friend std::ostream &operator<<(std::ostream& os, const CappedStorage& c); void lock(); void unlock(); }; #endif // CAPPEDSTORAGE_H