<commit_before>package ie.dit;

public class Matrix
{
	private int rows;
	private int cols;
	
	private float[][] elements;
	
	// Accessor
	public int getRows()
	{
		return rows;
	}
	public int getCols()
	{
		return cols;
	}
	
	public void setElement(int row, int col, float val)
	{
		elements[row][col] = val;
	}
	
	public float getElement(int row, int col)
	{
		return elements[row][col];
	}
	
	public Matrix(int rows, int cols)
	{
		this.rows = rows;
		this.cols = cols;
		elements = new float[rows][cols];
	}
	
	public void identity()
	{
		for(int row = 0 ; row < rows ; row ++)
		{
			for(int col = 0 ; col < cols ; col ++)
			{
				elements[row][col] = (row == col) ? 1 : 0;
			}
		}
	}
	
	public String toString()
	{
		String ret = "";
		for(int row = 0 ; row < rows ; row ++)
		{
			for(int col = 0 ; col < cols ; col ++)
			{
				ret += elements[row][col] + "\t";
			}
			ret += "\n";
		}
		return ret;
	}
	
	public void add(Matrix m)
	{
		for(int row = 0 ; row < rows ; row ++)
		{
			for(int col = 0 ; col < cols ; col++)
			{
				this.elements[row][col] += m.elements[row][col];
			}
		}
	}
	
	public static Matrix add(Matrix a, Matrix b)
	{
		Matrix m = new Matrix(a.rows, a.cols);

		for(int row = 0 ; row < a.rows ; row ++)
		{
			for(int col = 0 ; col < a.cols ; col++)
			{
				m.elements[row][col] = a.elements[row][col] 
					+ b.elements[row][col]; 
			}
		}
		return m;
	}

	public void mult(Matrix x)
	{

	}

	public static Matrix mult(Matrix a, Matrix b)
	{

	}
	
}<commit_msg>Matrix mult<commit_after>package ie.dit;

public class Matrix
{
	private int rows;
	private int cols;
	
	private float[][] elements;
	
	// Accessor
	public int getRows()
	{
		return rows;
	}
	public int getCols()
	{
		return cols;
	}
	
	public void setElement(int row, int col, float val)
	{
		elements[row][col] = val;
	}
	
	public float getElement(int row, int col)
	{
		return elements[row][col];
	}
	
	public Matrix(int rows, int cols)
	{
		this.rows = rows;
		this.cols = cols;
		elements = new float[rows][cols];
	}
	
	public void identity()
	{
		for(int row = 0 ; row < rows ; row ++)
		{
			for(int col = 0 ; col < cols ; col ++)
			{
				elements[row][col] = (row == col) ? 1 : 0;
			}
		}
	}
	
	public String toString()
	{
		String ret = "";
		for(int row = 0 ; row < rows ; row ++)
		{
			for(int col = 0 ; col < cols ; col ++)
			{
				ret += elements[row][col] + "\t";
			}
			ret += "\n";
		}
		return ret;
	}
	
	public void add(Matrix m)
	{
		for(int row = 0 ; row < rows ; row ++)
		{
			for(int col = 0 ; col < cols ; col++)
			{
				this.elements[row][col] += m.elements[row][col];
			}
		}
	}
	
	public static Matrix add(Matrix a, Matrix b)
	{
		Matrix m = new Matrix(a.rows, a.cols);

		for(int row = 0 ; row < a.rows ; row ++)
		{
			for(int col = 0 ; col < a.cols ; col++)
			{
				m.elements[row][col] = a.elements[row][col] 
					+ b.elements[row][col]; 
			}
		}
		return m;
	}

	public void mult(Matrix a)
	{
		for(int row = 0; row < this.rows ; row ++)
		{
			for(int col = 0 ; col < a.cols ; col ++)
			{
				float sum = 0;
				for(int i = 0 ; i < cols ; i ++)
				{
					sum += a.elements[row][i] * b.elements[i][col];
				}
				elements[row][col] = sum;
			}
		}
	}

	public static Matrix mult(Matrix a, Matrix b)
	{
		Matrix c = new Matrix(a.rows, b.cols);
		for(int row = 0; row < a.rows ; row ++)
		{
			for(int col = 0 ; col < b.cols ; col ++)
			{
				for(int i = 0 ; i < a.cols ; i ++)
				{
					c.elements[row][col] += a.elements[row][i] * b.elements[i][col];
				}
			}
		}
		return c;
	}
	
}
{'fraction_non_alphanumeric': 0.171671388101983, 'fraction_numerical': 0.00764872521246459, 'mean_word_length': 2.3092783505154637, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 3, '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': '2229797', 'n_tokens_mistral': 1668, 'n_tokens_neox': 1413, 'n_words': 369}