<commit_before>//============================================================================
// Name        : REK-CPP.cpp
// Author      : <NAME>
// Version     :
// Copyright   : Apache 2.0 License
// Description : Hello World in C, Ansi-style
//============================================================================

#include <iostream>

#include "samplers/AliasSampler.hpp"
#include "algorithms/REKSolver.hpp"


#include "matrix/impl/DenseMatrix.hpp"
#include "vector/DenseVector.hpp"

using namespace std;

int main(void) {


	int n = 10;
	std::vector<double> test(n);

	test[0] = n;
	for(int i = 1; i <n ; i++){
		test[i] = 1;
	}

	AliasSampler alias(test);

	alias.initSampler();


	std::vector<uint>* samples = alias.sample(30);

	for(int i = 0 ; i < samples->size(); i++){
		cout<<"Sample " << samples->at(i) << endl;
	}

	DoubleMatrix* A = new DenseMatrix(10,10);
	DoubleVector* xopt = new DenseVector(10);
	xopt->random();
	A->random();
	DoubleVector* b = A->times(*xopt);

	cout<< "xopt is " <<endl;
	for (int i = 0 ; i < xopt->size(); i++){
		cout<< xopt->get(i) <<endl;
	}

	cout<< "B is " <<endl;
	for (int i = 0 ; i < b->size(); i++){
		cout<< b->get(i) <<endl;
	}

	cout<< "B is " <<endl;
	for (int i = 0 ; i < A->getRowDimension(); i++){
		for (int j = 0 ; j < A->getColumnDimension(); j++){
		cout<< A->get(i,j)<< " , ";
		}
		cout<<endl;
	}


	REKSolver solver = REKSolver();

	long ITERS = 1000;
	DoubleVector* x = solver.solve(*A, *b, ITERS);


	x->minus(*xopt);
	cout<< "Error is " << x->DNRM2();


	cout<<"Hello World" <<endl;
	return 0;
}<commit_msg>Remove uneccessary couts<commit_after>//============================================================================
// Name        : REK-CPP.cpp
// Author      : <NAME>
// Version     :
// Copyright   : Apache 2.0 License
// Description : Hello World in C, Ansi-style
//============================================================================

#include <iostream>

#include "samplers/AliasSampler.hpp"
#include "algorithms/REKSolver.hpp"


#include "matrix/impl/DenseMatrix.hpp"
#include "vector/DenseVector.hpp"

using namespace std;

int main(void) {
	int n = 10;

	DoubleMatrix* A = new DenseMatrix(n,n);
	DoubleVector* xopt = new DenseVector(n);
	xopt->random();
	A->random();
	DoubleVector* b = A->times(*xopt);

	cout<< "xopt is " <<endl;
	for (int i = 0 ; i < xopt->size(); i++){
		cout<< xopt->get(i) <<endl;
	}

	cout<< "B is " <<endl;
	for (int i = 0 ; i < b->size(); i++){
		cout<< b->get(i) <<endl;
	}

	cout<< "A is " <<endl;
	for (int i = 0 ; i < A->getRowDimension(); i++){
		for (int j = 0 ; j < A->getColumnDimension(); j++){
		cout<< A->get(i,j)<< " , ";
		}
		cout<<endl;
	}

	REKSolver solver = REKSolver();

	long ITERS = 10000000;
	DoubleVector* x = solver.solve(*A, *b, ITERS);

	cout<<"(x, xopt)"<<endl;
	for (int j = 0 ; j < A->getColumnDimension(); j++){
		cout<< x->get(j) << " , " << xopt->get(j) <<endl;
	}

	x->minus(*xopt);
	cout<< "Error is " << x->DNRM2() << endl;


	return 0;
}
{'fraction_non_alphanumeric': 0.2981987991994663, 'fraction_numerical': 0.015010006671114077, 'mean_word_length': 3.7377567140600316, 'pattern_counts': {'":': 0, '<': 104, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '602884', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1093, 'n_words': 274}