<commit_before>﻿using System;

namespace cs_smallpt {

    public class Vector3 : IEquatable< Vector3 > {

        protected double[] raw = new double[3];

        public double x {
            get {
                return raw[0];
            }
            set {
                raw[0] = value;
            }
        }
        public double y {
            get {
                return raw[1];
            }
            set {
                raw[1] = value;
            }
        }
        public double z {
            get {
                return raw[2];
            }
            set {
                raw[2] = value;
            }
        }

        public Vector3(double a = 0.0) : this(a, a, a) {
        }
        public Vector3(double x, double y, double z) {
            raw[0] = x;
            raw[1] = y;
            raw[2] = z;
        }
        public Vector3(Vector3 v) : this(v[0], v[1], v[2]) {
        }
        public Vector3 Clone() {
            return new Vector3(this);
        }

        public bool HasNaNs() {
            return double.IsNaN(raw[0]) || double.IsNaN(raw[1]) || double.IsNaN(raw[2]);
        }

        public double this[int i] {
            get {
                return raw[i];
            }
            set {
                raw[i] = value;
            }
        }

        public static Vector3 operator -(Vector3 v) {
            return new Vector3(-v[0], -v[1], -v[2]);
        }
        public static Vector3 operator +(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]);
        }
        public static Vector3 operator -(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]);
        }
        public static Vector3 operator *(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] * v2[0], v1[1] * v2[1], v1[2] * v2[2]);
        }
        public static Vector3 operator /(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] / v2[0], v1[1] / v2[1], v1[2] / v2[2]);
        }
        public static Vector3 operator +(Vector3 v, double a) {
            return new Vector3(v[0] + a, v[1] + a, v[2] + a);
        }
        public static Vector3 operator -(Vector3 v, double a) {
            return new Vector3(v[0] - a, v[1] - a, v[2] - a);
        }
        public static Vector3 operator *(Vector3 v, double a) {
            return new Vector3(v[0] * a, v[1] * a, v[2] * a);
        }
        public static Vector3 operator /(Vector3 v, double a) {
            double inv_a = 1.0 / a;
            return new Vector3(v[0] * inv_a, v[1] * inv_a, v[2] * inv_a);
        }
        public static Vector3 operator +(double a, Vector3 v) {
            return new Vector3(a + v[0], a + v[1], a + v[2]);
        }
        public static Vector3 operator -(double a, Vector3 v) {
            return new Vector3(a - v[0], a - v[1], a - v[2]);
        }
        public static Vector3 operator *(double a, Vector3 v) {
            return new Vector3(a * v[0], a * v[1], a * v[2]);
        }
        public static Vector3 operator /(double a, Vector3 v) {
            return new Vector3(a / v[0], a / v[1], a / v[2]);
        }

        public double Dot(Vector3 v) {
            return raw[0] * v[0] + raw[1] * v[1] + raw[2] * v[2];
        }
        public Vector3 Cross(Vector3 v) {
            return new Vector3(raw[1] * v[2] - raw[2] * v[1], raw[2] * v[0] - raw[0] * v[2], raw[0] * v[1] - raw[1] * v[0]);
        }

        public override int GetHashCode() {
            int hashCode = 0;
            hashCode ^= raw[0].GetHashCode();
            hashCode ^= raw[1].GetHashCode();
            hashCode ^= raw[2].GetHashCode();
            return hashCode;
        }
        public override bool Equals(System.Object obj) {
            if (obj == null) {
                return false;
            }

            Vector3 v1 = obj as Vector3;
            if ((System.Object)v1 == null) {
                return false;
            }

            return (raw[0] == v1[0]) && (raw[1] == v1[1]) && (raw[2] == v1[2]);
        }
        public static bool operator ==(Vector3 v1, Vector3 v2) {
            return (v1[0] == v2[0]) && (v1[1] == v2[1]) && (v1[2] == v2[2]);
        }
        public static bool operator !=(Vector3 v1, Vector3 v2) {
            return (v1[0] != v2[0]) || (v1[1] != v2[1]) || (v1[2] != v2[2]);
        }
        public static bool operator <(Vector3 v1, Vector3 v2) {
            return (v1[0] < v2[0]) && (v1[1] < v2[1]) && (v1[2] < v2[2]);
        }
        public static bool operator <=(Vector3 v1, Vector3 v2) {
            return (v1[0] <= v2[0]) && (v1[1] <= v2[1]) && (v1[2] <= v2[2]);
        }
        public static bool operator >(Vector3 v1, Vector3 v2) {
            return (v1[0] > v2[0]) && (v1[1] > v2[1]) && (v1[2] > v2[2]);
        }
        public static bool operator >=(Vector3 v1, Vector3 v2) {
            return (v1[0] >= v2[0]) && (v1[1] >= v2[1]) && (v1[2] >= v2[2]);
        }<commit_msg>Update Vector3.cs<commit_after>﻿using System;

namespace cs_smallpt {

    public class Vector3 : IEquatable< Vector3 > {

        protected double[] raw = new double[3];

        public double x {
            get {
                return raw[0];
            }
            set {
                raw[0] = value;
            }
        }
        public double y {
            get {
                return raw[1];
            }
            set {
                raw[1] = value;
            }
        }
        public double z {
            get {
                return raw[2];
            }
            set {
                raw[2] = value;
            }
        }

        public Vector3(double a = 0.0) : this(a, a, a) {
        }
        public Vector3(double x, double y, double z) {
            raw[0] = x;
            raw[1] = y;
            raw[2] = z;
        }
        public Vector3(Vector3 v) : this(v[0], v[1], v[2]) {
        }
        public Vector3 Clone() {
            return new Vector3(this);
        }

        public bool HasNaNs() {
            return double.IsNaN(raw[0]) || double.IsNaN(raw[1]) || double.IsNaN(raw[2]);
        }

        public double this[int i] {
            get {
                return raw[i];
            }
            set {
                raw[i] = value;
            }
        }

        public static Vector3 operator -(Vector3 v) {
            return new Vector3(-v[0], -v[1], -v[2]);
        }
        public static Vector3 operator +(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]);
        }
        public static Vector3 operator -(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]);
        }
        public static Vector3 operator *(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] * v2[0], v1[1] * v2[1], v1[2] * v2[2]);
        }
        public static Vector3 operator /(Vector3 v1, Vector3 v2) {
            return new Vector3(v1[0] / v2[0], v1[1] / v2[1], v1[2] / v2[2]);
        }
        public static Vector3 operator +(Vector3 v, double a) {
            return new Vector3(v[0] + a, v[1] + a, v[2] + a);
        }
        public static Vector3 operator -(Vector3 v, double a) {
            return new Vector3(v[0] - a, v[1] - a, v[2] - a);
        }
        public static Vector3 operator *(Vector3 v, double a) {
            return new Vector3(v[0] * a, v[1] * a, v[2] * a);
        }
        public static Vector3 operator /(Vector3 v, double a) {
            double inv_a = 1.0 / a;
            return new Vector3(v[0] * inv_a, v[1] * inv_a, v[2] * inv_a);
        }
        public static Vector3 operator +(double a, Vector3 v) {
            return new Vector3(a + v[0], a + v[1], a + v[2]);
        }
        public static Vector3 operator -(double a, Vector3 v) {
            return new Vector3(a - v[0], a - v[1], a - v[2]);
        }
        public static Vector3 operator *(double a, Vector3 v) {
            return new Vector3(a * v[0], a * v[1], a * v[2]);
        }
        public static Vector3 operator /(double a, Vector3 v) {
            return new Vector3(a / v[0], a / v[1], a / v[2]);
        }

        public double Dot(Vector3 v) {
            return raw[0] * v[0] + raw[1] * v[1] + raw[2] * v[2];
        }
        public Vector3 Cross(Vector3 v) {
            return new Vector3(raw[1] * v[2] - raw[2] * v[1], raw[2] * v[0] - raw[0] * v[2], raw[0] * v[1] - raw[1] * v[0]);
        }

        public override int GetHashCode() {
            int hashCode = 0;
            hashCode ^= raw[0].GetHashCode();
            hashCode ^= raw[1].GetHashCode();
            hashCode ^= raw[2].GetHashCode();
            return hashCode;
        }
        public override bool Equals(System.Object obj) {
            if (obj == null) {
                return false;
            }

            return Equals(obj as Vector3);
        }
		public bool Equals(Vector3 v) {
            if (v == null) {
                return false;
            }

            return (raw[0] == v[0]) && (raw[1] == v[1]) && (raw[2] == v[2]);
        }
        public static bool operator ==(Vector3 v1, Vector3 v2) {
            return (v1[0] == v2[0]) && (v1[1] == v2[1]) && (v1[2] == v2[2]);
        }
        public static bool operator !=(Vector3 v1, Vector3 v2) {
            return (v1[0] != v2[0]) || (v1[1] != v2[1]) || (v1[2] != v2[2]);
        }
        public static bool operator <(Vector3 v1, Vector3 v2) {
            return (v1[0] < v2[0]) && (v1[1] < v2[1]) && (v1[2] < v2[2]);
        }
        public static bool operator <=(Vector3 v1, Vector3 v2) {
            return (v1[0] <= v2[0]) && (v1[1] <= v2[1]) && (v1[2] <= v2[2]);
        }
        public static bool operator >(Vector3 v1, Vector3 v2) {
            return (v1[0] > v2[0]) && (v1[1] > v2[1]) && (v1[2] > v2[2]);
        }
        public static bool operator >=(Vector3 v1, Vector3 v2) {
            return (v1[0] >= v2[0]) && (v1[1] >= v2[1]) && (v1[2] >= v2[2]);
        }
{'fraction_non_alphanumeric': 0.15766350474288568, 'fraction_numerical': 0.05731402895656515, 'mean_word_length': 1.4512971120900637, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '6058142', 'n_tokens_mistral': 3520, 'n_tokens_neox': 3459, 'n_words': 920}