#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_spital_data(const uint64_t samples, const uint64_t classes, utils::Matrix<TX>& X, utils::Matrix<Ty>& y) {

			const uint64_t rows = samples*classes;
			TX r, t;
			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){
					r = static_cast<TX>(j)/static_cast<TX>(samples);
					t =  static_cast<TX>(i)*4.0 + (4.0+r);
					row_idx = (i*samples) + j;

					X(row_idx, 0) = r*std::cos(t*2.5) + utils::random(TX{-0.15}, TX{0.15});
					X(row_idx, 1) = r*std::sin(t*2.5) + utils::random(TX{-0.15}, TX{0.15});
					y(row_idx, 0) = static_cast<Ty>(i);
				}
			}
		}


} // end namesoace NN