<commit_before>#include "Material.h"

namespace TMM {

	Chi2Tensor::Chi2Tensor() : chi2(3, 3, 3), chi2Rotated(3, 3, 3) {
		Clear();
		SetDistinctFields(true);
		SetRotation(0.0, 0.0, 0.0);
	}

	void Chi2Tensor::SetDistinctFields(bool distinctFields_) {
		distinctFields = distinctFields_;
	}

	void Chi2Tensor::SetRotation(double phiX_, double phiY_, double phiZ_) {
		phiX = phiX_;
		phiY = phiY_;
		phiZ = phiZ_;
		needRotationRecalc = true;
	}

	void Chi2Tensor::SetChi2(int i1, int i2, int i3, double value) {
		// indices are from 1..3
		isNonlinear = true;

		if (std::max<int>(i1, std::max<int>(i2, i3)) > 3 || std::min<int>(i1, std::min<int>(i2, i3))) {
			throw std::runtime_error("chi2 index not in range 1..3");
		}

		needRotationRecalc = true;
		chi2(i1 - 1, i2 - 1, i3 - 1) = value;
	}

	void Chi2Tensor::SetD(int i1, int i2, double value) {<commit_msg>Bugfix<commit_after>#include "Material.h"

namespace TMM {

	Chi2Tensor::Chi2Tensor() : chi2(3, 3, 3), chi2Rotated(3, 3, 3) {
		Clear();
		SetDistinctFields(true);
		SetRotation(0.0, 0.0, 0.0);
	}

	void Chi2Tensor::SetDistinctFields(bool distinctFields_) {
		distinctFields = distinctFields_;
	}

	void Chi2Tensor::SetRotation(double phiX_, double phiY_, double phiZ_) {
		phiX = phiX_;
		phiY = phiY_;
		phiZ = phiZ_;
		needRotationRecalc = true;
	}

	void Chi2Tensor::SetChi2(int i1, int i2, int i3, double value) {
		// indices are from 1..3
		isNonlinear = true;

		if (std::max<int>(i1, std::max<int>(i2, i3)) > 3 || std::min<int>(i1, std::min<int>(i2, i3)) < 1) {
			throw std::runtime_error("chi2 index not in range 1..3");
		}

		needRotationRecalc = true;
		chi2(i1 - 1, i2 - 1, i3 - 1) = value;
	}

	void Chi2Tensor::SetD(int i1, int i2, double value) {
{'fraction_non_alphanumeric': 0.1611785095320624, 'fraction_numerical': 0.05257076834199884, 'mean_word_length': 4.0791788856304985, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, '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': '4042504', 'n_tokens_mistral': 793, 'n_tokens_neox': 710, 'n_words': 165}