public override int GetHashCode()
 {
     int hash = 7;
     CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
     a.FloatValue = x;
     hash = 31 * hash + a.IntValue;
     hash = 31 * hash + this.gridIndex;
     return hash;
 }
        public override int GetHashCode()
        {
            int hash = 7;

            CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
            a.FloatValue = x;
            hash         = 31 * hash + a.IntValue;
            hash         = 31 * hash + this.gridIndex;
            return(hash);
        }
        public static int GetArrayHash(float[] array)
        {
            if (array == null)
            {
                return(0);
            }
            int hc = array.Length;

            for (int i = 0; i < array.Length; ++i)
            {
                CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
                a.FloatValue = array[i];
                hc           = unchecked (hc * 31 + a.IntValue);
            }
            return(hc);
        }
        public void writePackedFloats(float[] data, int count, int size)
        {
            if (data.Length < count * size)
            {
                throw new Exception("The data to be written is smaller"
                                    + " as stated by other parameters. Needed: " + (count * size) + " Provided: " + data.Length);
            }

            // Allocate memory for interleaved array
            byte[] tmp = new byte[count * size * 4];

            // Convert floats to an interleaved array
            for (int x = 0; x < count; ++x)
            {
                for (int y = 0; y < size; ++y)
                {
                    CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
                    a.FloatValue = data[x * size + y];
                    interleavedInsert(a.IntValue, tmp, x + y * count, count * size);
                }
            }
            writeCompressedData(tmp);
        }
 public void writeLittleFloat(float v)
 {
     CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
     a.FloatValue = v;
     writeLittleInt(a.IntValue);
 }
        public void writePackedFloats(float[] data, int count, int size)
        {
            if(data.Length < count * size)
                throw new Exception("The data to be written is smaller"
                    + " as stated by other parameters. Needed: " + (count * size) + " Provided: " + data.Length);

            // Allocate memory for interleaved array
            byte[] tmp = new byte[count * size * 4];

            // Convert floats to an interleaved array
            for (int x = 0; x < count; ++x) {
                for (int y = 0; y < size; ++y) {
                    CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
                    a.FloatValue = data[x * size + y];
                    interleavedInsert(a.IntValue, tmp, x + y * count, count * size);
                }
            }
            writeCompressedData(tmp);
        }
 public void writeLittleFloat(float v)
 {
     CtmInputStream.IntFloat a = new CtmInputStream.IntFloat();
     a.FloatValue = v;
     writeLittleInt(a.IntValue);
 }