<commit_before>#pragma once
#include <iostream>
#include <iomanip> // setprecision
#include <cstddef> // size_t
#include <stdexcept>
#include "vector.hpp" // vector operations (*, +, ...)

template <typename T>
class AbstractSquareMatrix { // abstract class for square matricies
	virtual T& _set(size_t, size_t) = 0; // set / get value of element using indicies of traditional form of matrix
	virtual T _get(size_t, size_t) const = 0;
protected: // interface for derivative classes
	size_t _n; // n := order of square matrix
public:
	AbstractSquareMatrix(size_t n) : _n(n) {
		if (_n < 1) throw std::out_of_range("order of matrix must be at least one");
	}
	virtual ~AbstractSquareMatrix() {}
	T operator()(size_t i, size_t j) const {
		if (i >= _n || j >= _n) throw std::out_of_range("matrix doesnt contain element w/ these indicies");
		return _get(i, j);
	}
	T& operator()(size_t i, size_t j) { 
		if (i >= _n || j >= _n) throw std::out_of_range("matrix doesnt contain element w/ these indicies");
		return _set(i, j); 
	}
	size_t getOrder() const { return _n; }
	std::ostream& save(std::ostream& output = std::cout) const {
		output << _n << '\n';
		output << std::setprecision(15) << std::scientific << showpos;
		for (size_t i = 0; i < _n; ++i) {
			for (size_t j = 0; j < _n; ++j)
				output << _get(i, j) << ' ';
			output << '\n';
		}
		return output;
	}
	std::istream& load(std::istream& input = std::cin) {
		T dummy;
		for (size_t i = 0; i < _n; ++i)
			for (size_t j = 0; j < _n; ++i)
				input >> dummy;
				try {
					_set(i, j) = dummy;
				} catch (std::invalid_argument const &) {} // you cannot set some values of sparse matrices because they are zeros
		return input;
	}
};<commit_msg>fix misprint<commit_after>#pragma once
#include <iostream>
#include <iomanip> // setprecision
#include <cstddef> // size_t
#include <stdexcept>
#include "vector.hpp" // vector operations (*, +, ...)

template <typename T>
class AbstractSquareMatrix { // abstract class for square matricies
	virtual T& _set(size_t, size_t) = 0; // set / get value of element using indicies of traditional form of matrix
	virtual T _get(size_t, size_t) const = 0;
protected: // interface for derivative classes
	size_t _n; // n := order of square matrix
public:
	AbstractSquareMatrix(size_t n) : _n(n) {
		if (_n < 1) throw std::out_of_range("order of matrix must be at least one");
	}
	virtual ~AbstractSquareMatrix() {}
	T operator()(size_t i, size_t j) const {
		if (i >= _n || j >= _n) throw std::out_of_range("matrix doesnt contain element w/ these indicies");
		return _get(i, j);
	}
	T& operator()(size_t i, size_t j) { 
		if (i >= _n || j >= _n) throw std::out_of_range("matrix doesnt contain element w/ these indicies");
		return _set(i, j); 
	}
	size_t getOrder() const { return _n; }
	std::ostream& save(std::ostream& output = std::cout) const {
		output << _n << '\n';
		output << std::setprecision(15) << std::scientific << std::showpos;
		for (size_t i = 0; i < _n; ++i) {
			for (size_t j = 0; j < _n; ++j)
				output << _get(i, j) << ' ';
			output << '\n';
		}
		return output;
	}
	std::istream& load(std::istream& input = std::cin) {
		T dummy;
		for (size_t i = 0; i < _n; ++i)
			for (size_t j = 0; j < _n; ++i)
				input >> dummy;
				try {
					_set(i, j) = dummy;
				} catch (std::invalid_argument const &) {} // you cannot set some values of sparse matrices because they are zeros
		return input;
	}
};
{'fraction_non_alphanumeric': 0.15641476274165203, 'fraction_numerical': 0.005272407732864675, 'mean_word_length': 3.639945652173913, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 25, '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': '2472314', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1226, 'n_words': 409}