<commit_before>#ifndef _GMTK_MAT_H_
#define _GMTK_MAT_H_

//

#include "..\util.h"
#include "vec.h"
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"

//

#include <math.h>
#include <ostream>

//

#define GMTK_IDENT_LOOP(oper) GMTK_UNROLL_LOOP(i, GMTK_MIN_OF(r, c), oper)

#define GMTK_MAT_LOOP(oper) GMTK_UNROLL_2D_LOOP(i, j, c, r, oper)

#define GMTK_MAT_LOOP2(oper) GMTK_UNROLL_LONG_LOOP(i, r*c, oper)

#define GMTK_MAT_OPERATOR(oper) { mat<T, r, c> res; GMTK_MAT_LOOP(res[i][j] = oper); return res; }

#define GMTK_MAT_OPERATOR2(oper) { mat<T, r, c> res; GMTK_MAT_LOOP2(res(i) = oper); return res; }

#define GMTK_MAT_REF_OPERATOR(oper) { GMTK_MAT_LOOP(oper); return *this; }

#define GMTK_MAT_REF_OPERATOR2(oper) { GMTK_MAT_LOOP2(oper); return *this; }

//

namespace GMTK_NAMESPACE
{////

	//! A column-major matrix spanning r rows and c columns
	template <typename T, int r, int c>
	struct mat
	{
		//////////////////
		//! DATA MEMBERS //
		//////////////////

		inline int rows() const
		{
			return r;
		}

		inline int cols() const
		{
			return c;
		}

		inline int dim() const
		{
			return GMTK_MIN_OF(r, c);
		}

		//! Unioned data members
		union
		{<commit_msg>Add default argument for easy square matrix generation<commit_after>#ifndef _GMTK_MAT_H_
#define _GMTK_MAT_H_

//

#include "..\util.h"
#include "vec.h"
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"

//

#include <math.h>
#include <ostream>

//

#define GMTK_IDENT_LOOP(oper) GMTK_UNROLL_LOOP(i, GMTK_MIN_OF(r, c), oper)

#define GMTK_MAT_LOOP(oper) GMTK_UNROLL_2D_LOOP(i, j, c, r, oper)

#define GMTK_MAT_LOOP2(oper) GMTK_UNROLL_LONG_LOOP(i, r*c, oper)

#define GMTK_MAT_OPERATOR(oper) { mat<T, r, c> res; GMTK_MAT_LOOP(res[i][j] = oper); return res; }

#define GMTK_MAT_OPERATOR2(oper) { mat<T, r, c> res; GMTK_MAT_LOOP2(res(i) = oper); return res; }

#define GMTK_MAT_REF_OPERATOR(oper) { GMTK_MAT_LOOP(oper); return *this; }

#define GMTK_MAT_REF_OPERATOR2(oper) { GMTK_MAT_LOOP2(oper); return *this; }

//

namespace GMTK_NAMESPACE
{////

	//! A column-major matrix spanning r rows and c columns
	template <typename T, int r, int c = r>
	struct mat
	{
		//////////////////
		//! DATA MEMBERS //
		//////////////////

		inline int rows() const
		{
			return r;
		}

		inline int cols() const
		{
			return c;
		}

		inline int dim() const
		{
			return GMTK_MIN_OF(r, c);
		}

		//! Unioned data members
		union
		{
{'fraction_non_alphanumeric': 0.1689497716894977, 'fraction_numerical': 0.007471980074719801, 'mean_word_length': 3.4301470588235294, 'pattern_counts': {'":': 0, '<': 13, '<?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': '6386119', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1027, 'n_words': 230}