<commit_before>package org.jtrfp.trcl.math;

import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;



public class Vect3D {

    public static void subtract(double[] l, double[] r, double[] dest) {
	dest[0]=l[0]-r[0];
	dest[1]=l[1]-r[1];
	dest[2]=l[2]-r[2];
    }

    public static double[] scalarMultiply(double [] src,
	    double scalar, double[] dest) {
	dest[0]=src[0]*scalar;
	dest[1]=src[1]*scalar;
	dest[2]=src[2]*scalar;
	return dest;
    }
    
    public static double[] normalize(double[] src){
	return normalize(src,new double[3]);
    }
    
    public static double[] normalize(double[] src, double [] dest) {
	final double norm = norm(src);
	dest[0]=src[0]/norm;
	dest[1]=src[1]/norm;
	dest[2]=src[2]/norm;
	return dest;
    }

    private static double norm(double[] src) {
	final double x=src[0];
	final double y=src[1];
	final double z=src[2];
	return Math.sqrt(x*x+y*y+z*z);
    }

    public static double [] add(double[] l, double rx, double ry,
	    double rz, double[] dest) {<commit_msg>Made norm() public in Vect3D<commit_after>package org.jtrfp.trcl.math;

import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;



public class Vect3D {

    public static void subtract(double[] l, double[] r, double[] dest) {
	dest[0]=l[0]-r[0];
	dest[1]=l[1]-r[1];
	dest[2]=l[2]-r[2];
    }

    public static double[] scalarMultiply(double [] src,
	    double scalar, double[] dest) {
	dest[0]=src[0]*scalar;
	dest[1]=src[1]*scalar;
	dest[2]=src[2]*scalar;
	return dest;
    }
    
    public static double[] normalize(double[] src){
	return normalize(src,new double[3]);
    }
    
    public static double[] normalize(double[] src, double [] dest) {
	final double norm = norm(src);
	dest[0]=src[0]/norm;
	dest[1]=src[1]/norm;
	dest[2]=src[2]/norm;
	return dest;
    }

    public static double norm(double[] src) {
	final double x=src[0];
	final double y=src[1];
	final double z=src[2];
	return Math.sqrt(x*x+y*y+z*z);
    }

    public static double [] add(double[] l, double rx, double ry,
	    double rz, double[] dest) {
{'fraction_non_alphanumeric': 0.17504835589941972, 'fraction_numerical': 0.02756286266924565, 'mean_word_length': 3.961630695443645, 'pattern_counts': {'":': 0, '<': 3, '<?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': '666069', 'n_tokens_mistral': 808, 'n_tokens_neox': 768, 'n_words': 176}