<commit_before>package nz.gen.geek_central.GLUseful;
/*
    Functional 3D matrix operations. Matrix elements are in row-major order.
    Vectors are treated as column vectors and premultiplied, i.e.

    [x']   [m11 m12 m13 m14]   [x]
    [y'] = [m21 m22 m23 m24] × [y]
    [z']   [m31 m32 m33 m34]   [z]
    [w']   [m41 m42 m43 m44]   [w]

    Copyright 2011, 2012 by <NAME> <<EMAIL>>.

    Licensed under the Apache License, Version 2.0 (the "License"); you may not
    use this file except in compliance with the License. You may obtain a copy of
    the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    License for the specific language governing permissions and limitations under
    the License.
*/

import android.util.FloatMath;

public class Mat4f
  /* 4x4 matrices */<commit_msg>rationale for the functional approach<commit_after>package nz.gen.geek_central.GLUseful;
/*
    Functional 3D matrix operations. Matrix elements are in row-major order.
    Vectors are treated as column vectors and premultiplied, i.e.

        [x']   [m11 m12 m13 m14]   [x]
        [y'] = [m21 m22 m23 m24] × [y]
        [z']   [m31 m32 m33 m34]   [z]
        [w']   [m41 m42 m43 m44]   [w]

    Q: Why not use the android.opengl.Matrix class?
    A: Because that is procedural (updates state in an existing
       object), this is functional (computes values from
       expressions). The procedural approach requires you to perform a
       sequence of calls on intermediate variables to set up a complex
       transformation, whereas the functional approach allows you to
       write it as a single expression, closer to the way it is
       formulated mathematically. For an example in this source file,
       see below how general rotation about an arbitrary axis is
       composed out of a sequence of simpler rotation components.
    Q: But doesn't that involve a whole lot of extra heap allocations?
    A: Isn't that the point of using Java?

    Copyright 2011, 2012 by <NAME> <<EMAIL>>.

    Licensed under the Apache License, Version 2.0 (the "License"); you may not
    use this file except in compliance with the License. You may obtain a copy of
    the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    License for the specific language governing permissions and limitations under
    the License.
*/

import android.util.FloatMath;

public class Mat4f
  /* 4x4 matrices */
{'fraction_non_alphanumeric': 0.06769016050244243, 'fraction_numerical': 0.03349616189811584, 'mean_word_length': 2.99860529986053, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7269824', 'n_tokens_mistral': 861, 'n_tokens_neox': 797, 'n_words': 390}