<commit_before>#include "modules/operators.h"
#include "ptr_protect.h"
#include "core/internal_helper.h"
#include "core/function_obj.h"
#include "core/mathNode.h"
#include "exception_helper.h"
#include "core/type.h"
#include "core/type_helper.h"
namespace operators
{

   	template<EXCEPTION T> void stdOperatorOops()
	{
		__mathlibra__raise<T,STD_OPERATORS>();
	}
	type* add(double  x, double y)
	{
		return make_type(x+y);
                
	}
	type* __add(tree::nodeDataInterface*n)
	{
		return internal_helper::forward_fast<double,double>(add, n);
	}

        type* multi(num_mat x, num_mat y)
	{
		if(x.isNumber() && y.isNumber())
		{
			*x.begin() = (*x.begin())*(*y.begin());
			return x.copy();
		}
		else if(x.isNumber())
		{
			double oper = *x.begin();
			for(auto it = y.begin(); it < y.end(); it++)
			{
				*it=oper*(*it);
			}
			return y.copy();
		}
		else if(y.isNumber())
		{
			return multi(std::move(y),std::move(x));
		}
		//Preform matrix multiplication
		else if(x.sizeM() == y.sizeN())
		{
			//The return value must be an pointer, thus we allocate the 
			//result matrice on the heap
			num_mat*  res = new num_mat(x.sizeN(),y.sizeM());
			auto itr = res->begin();
			auto itx = x.begin();
			for(size_t i=0; i < x.sizeN(); i++)
			{
				std::cout << "itx " << *itx << std::endl;
				auto ity = y.begin<true>();
				for(size_t j=0; j < y.sizeM(); j++)
				{
					std::cout << "ity " << *ity << std::endl;
					double sum=0;
					for(size_t k=0; k < y.sizeN(); k++)
					{
						sum += (*(ity+k)) * (*(itx+k));
					}
					*itr=sum;
					++itr;
					//Move ity to begining of next column
					ity+=y.sizeN();
				}
				//Move itx to begining of next row
				itx+=x.sizeM();
			}
			return res;

		}
		stdOperatorOops<MUL_OPR_INVALID_ARGS>();
		
	}
	type* __multi(tree::nodeDataInterface* n)
	{
		return internal_helper::forward_fast<num_mat, num_mat>(multi, n);
	}
	type* divide(double x, double y)
	{
		return make_type(x/y);
	}
        type* declare_func(tree::nodeDataInterface* n)
        {
            tree::node*  node = static_cast<tree::node*>(nodeDataInterface_wrapper_access(n));
            <commit_msg>Removed printing of debug data from multiplication operator<commit_after>#include "modules/operators.h"
#include "ptr_protect.h"
#include "core/internal_helper.h"
#include "core/function_obj.h"
#include "core/mathNode.h"
#include "exception_helper.h"
#include "core/type.h"
#include "core/type_helper.h"
namespace operators
{

   	template<EXCEPTION T> void stdOperatorOops()
	{
		__mathlibra__raise<T,STD_OPERATORS>();
	}
	type* add(double  x, double y)
	{
		return make_type(x+y);
                
	}
	type* __add(tree::nodeDataInterface*n)
	{
		return internal_helper::forward_fast<double,double>(add, n);
	}

        type* multi(num_mat x, num_mat y)
	{
		if(x.isNumber() && y.isNumber())
		{
			*x.begin() = (*x.begin())*(*y.begin());
			return x.copy();
		}
		else if(x.isNumber())
		{
			double oper = *x.begin();
			for(auto it = y.begin(); it < y.end(); it++)
			{
				*it=oper*(*it);
			}
			return y.copy();
		}
		else if(y.isNumber())
		{
			return multi(std::move(y),std::move(x));
		}
		//Preform matrix multiplication
		else if(x.sizeM() == y.sizeN())
		{
			//The return value must be an pointer, thus we allocate the 
			//result matrice on the heap
			num_mat*  res = new num_mat(x.sizeN(),y.sizeM());
			auto itr = res->begin();
			auto itx = x.begin();
			for(size_t i=0; i < x.sizeN(); i++)
			{
				auto ity = y.begin<true>();
				for(size_t j=0; j < y.sizeM(); j++)
				{
					double sum=0;
					for(size_t k=0; k < y.sizeN(); k++)
					{
						sum += (*(ity+k)) * (*(itx+k));
					}
					*itr=sum;
					++itr;
					//Move ity to begining of next column
					ity+=y.sizeN();
				}
				//Move itx to begining of next row
				itx+=x.sizeM();
			}
			return res;

		}
		stdOperatorOops<MUL_OPR_INVALID_ARGS>();
		
	}
	type* __multi(tree::nodeDataInterface* n)
	{
		return internal_helper::forward_fast<num_mat, num_mat>(multi, n);
	}
	type* divide(double x, double y)
	{
		return make_type(x/y);
	}
        type* declare_func(tree::nodeDataInterface* n)
        {
            tree::node*  node = static_cast<tree::node*>(nodeDataInterface_wrapper_access(n));
            
{'fraction_non_alphanumeric': 0.1782927406006148, 'fraction_numerical': 0.0018917001655237645, 'mean_word_length': 2.9943342776203967, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '3712868', 'n_tokens_mistral': 1875, 'n_tokens_neox': 1630, 'n_words': 335}