#pragma once

#include "./core/omp_config.h"
#include "./utils/matrix.h"
#include "./utils/vector.h"
#include "./utils/random.h"

//#include <math.h>


namespace neural_networks{

		template <typename TX, typename Ty>
		void create_vertical_data(const uint64_t samples, const uint64_t classes, utils::Matrix<TX>& X, utils::Matrix<Ty>& y) {

			const uint64_t rows = samples*classes;
			uint64_t row_idx;


			if ((rows != X.rows()) || (X.cols() != 2)){
				X.resize(samples*classes, 2);
			}
			if (rows != y.rows()){
				y.resize(rows, 1);
			}

			for (uint64_t i = 0; i < classes; ++i){
				for (uint64_t j = 0; j < samples; ++j){

					row_idx = (i*samples) + j;

					X(row_idx, 0) = static_cast<TX>(i)/static_cast<TX>(classes) + utils::random(TX{-0.1}, TX{0.1});
					X(row_idx, 1) = TX{0.5} + utils::random(TX{-0.5}, TX{0.5});
					y(row_idx, 0) = static_cast<Ty>(i);
				}
			}
		}


} // end namesoace NN