// Path: src/gwt/java/pythagoras/util/Platform.java
// public class Platform
// {
//     /**
//      * Returns a hash code for the supplied float value.
//      */
//     public static int hashCode (float f1) {
//         return (int)f1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Returns a hash code for the supplied double value.
//      */
//     public static int hashCode (double d1) {
//         return (int)d1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Clones the supplied array of bytes.
//      */
//     public static native byte[] clone (byte[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of ints.
//      */
//     public static native int[] clone (int[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of floats.
//      */
//     public static native float[] clone (float[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of doubles.
//      */
//     public static native double[] clone (double[] values) /*-{
//         return values.slice(0);
//     }-*/;
// }


import pythagoras.util.Platform;
import java.io.Serializable;
import java.nio.DoubleBuffer;
    @Override // from interface IVector4
    public Vector4 mult (double v, Vector4 result) {
        return result.set(x*v, y*v, z*v, w*v);
    }

    @Override // from IVector4
    public Vector4 mult (IMatrix4 matrix) {
        return mult(matrix, new Vector4());
    }

    @Override // from IVector4
    public Vector4 mult (IMatrix4 matrix, Vector4 result) {
        double m00 = matrix.m00(), m10 = matrix.m10(), m20 = matrix.m20(), m30 = matrix.m30();
        double m01 = matrix.m01(), m11 = matrix.m11(), m21 = matrix.m21(), m31 = matrix.m31();
        double m02 = matrix.m02(), m12 = matrix.m12(), m22 = matrix.m22(), m32 = matrix.m32();
        double m03 = matrix.m03(), m13 = matrix.m13(), m23 = matrix.m23(), m33 = matrix.m33();
        double vx = x, vy = y, vz = z, vw = w;
        return result.set(m00*vx + m01*vy + m02*vz + m03*vw,
                          m10*vx + m11*vy + m12*vz + m13*vw,
                          m20*vx + m21*vy + m22*vz + m23*vw,
                          m30*vx + m31*vy + m32*vz + m33*vw);
    }

    @Override
    public String toString () {
        return "[" + x + ", " + y + ", " + z + ", " + w + "]";
    }

    @Override
    public int hashCode () {
// Path: src/gwt/java/pythagoras/util/Platform.java
// public class Platform
// {
//     /**
//      * Returns a hash code for the supplied float value.
//      */
//     public static int hashCode (float f1) {
//         return (int)f1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Returns a hash code for the supplied double value.
//      */
//     public static int hashCode (double d1) {
//         return (int)d1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Clones the supplied array of bytes.
//      */
//     public static native byte[] clone (byte[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of ints.
//      */
//     public static native int[] clone (int[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of floats.
//      */
//     public static native float[] clone (float[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of doubles.
//      */
//     public static native double[] clone (double[] values) /*-{
//         return values.slice(0);
//     }-*/;
// }


// Path: src/main/java/pythagoras/d/Vector4.java
import pythagoras.util.Platform;
import java.io.Serializable;
import java.nio.DoubleBuffer;

    @Override // from interface IVector4
    public Vector4 mult (double v, Vector4 result) {
        return result.set(x*v, y*v, z*v, w*v);
    }

    @Override // from IVector4
    public Vector4 mult (IMatrix4 matrix) {
        return mult(matrix, new Vector4());
    }

    @Override // from IVector4
    public Vector4 mult (IMatrix4 matrix, Vector4 result) {
        double m00 = matrix.m00(), m10 = matrix.m10(), m20 = matrix.m20(), m30 = matrix.m30();
        double m01 = matrix.m01(), m11 = matrix.m11(), m21 = matrix.m21(), m31 = matrix.m31();
        double m02 = matrix.m02(), m12 = matrix.m12(), m22 = matrix.m22(), m32 = matrix.m32();
        double m03 = matrix.m03(), m13 = matrix.m13(), m23 = matrix.m23(), m33 = matrix.m33();
        double vx = x, vy = y, vz = z, vw = w;
        return result.set(m00*vx + m01*vy + m02*vz + m03*vw,
                          m10*vx + m11*vy + m12*vz + m13*vw,
                          m20*vx + m21*vy + m22*vz + m23*vw,
                          m30*vx + m31*vy + m32*vz + m33*vw);
    }

    @Override
    public String toString () {
        return "[" + x + ", " + y + ", " + z + ", " + w + "]";
    }

    @Override
    public int hashCode () {
        return Platform.hashCode(x) ^ Platform.hashCode(y) ^ Platform.hashCode(z) ^