Beispiel #1
0
        private int loadTrans(BufferedReader bufferedReader, string text, string text2)
        {
            int    num = 0;
            string text3;

            if (text2 != null)
            {
                text3 = text2;
            }
            else
            {
                text3 = String.instancehelper_trim(bufferedReader.readLine());
            }
            if (String.instancehelper_startsWith(text3, "<TRANSP>"))
            {
                num = Integer.parseInt(String.instancehelper_substring(text3, String.instancehelper_indexOf(text3, 32) + 1));
                num--;
            }
            else
            {
                java.lang.System.err.println("ERROR no TRANSP !");
                java.lang.System.exit(1);
            }
            int num2 = num;
            int num3 = num;

            int[] array = new int[2];
            int   num4  = num3;

            array[1]   = num4;
            num4       = num2;
            array[0]   = num4;
            this.trans = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array);
            bufferedReader.readLine();
            for (int i = 0; i < num; i++)
            {
                text3 = String.instancehelper_trim(bufferedReader.readLine());
                string[] array2 = String.instancehelper_split(text3, " ");
                for (int j = 0; j < num; j++)
                {
                    this.trans[i][j] = Float.parseFloat(array2[j + 1]);
                }
            }
            if (text != null)
            {
                int i = this.__transitions.size();
                this.__transNames.put(text, Integer.valueOf(i));
                this.__transitions.add(this.trans);
                return(i);
            }
            return(-1);
        }
Beispiel #2
0
        static Grammar()
        {
            int num  = 0;
            int num2 = 0;

            int[] array = new int[2];
            int   num3  = num2;

            array[1] = num3;
            num3     = num;
            array[0] = num3;
            Grammar.EMPTY_ALTERNATIVE = (Word[][])ByteCodeHelper.multianewarray(typeof(Word[][]).TypeHandle, array);
        }
    public AssignmentProblem(double[][] darr)
    {
        this.N = darr.Length;
        int arg_29_0 = this.N;
        int arg_24_0 = this.N;

        int[] array = new int[2];
        int   num   = arg_24_0;

        array[1]    = num;
        num         = arg_29_0;
        array[0]    = num;
        this.weight = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array);
        for (int i = 0; i < this.N; i++)
        {
            for (int j = 0; j < this.N; j++)
            {
                this.weight[i][j] = darr[i][j];
            }
        }
        this.px = new double[this.N];
        this.py = new double[this.N];
        this.xy = new int[this.N];
        this.yx = new int[this.N];
        for (int i = 0; i < this.N; i++)
        {
            this.xy[i] = -1;
        }
        for (int i = 0; i < this.N; i++)
        {
            this.yx[i] = -1;
        }
        for (int i = 0; i < this.N; i++)
        {
            if (!AssignmentProblem.s_assertionsDisabled && !this.isDualFeasible())
            {
                throw new AssertionError();
            }
            if (!AssignmentProblem.s_assertionsDisabled && !this.isComplementarySlack())
            {
                throw new AssertionError();
            }
            this.augment();
        }
        if (!AssignmentProblem.s_assertionsDisabled && !this.check())
        {
            throw new AssertionError();
        }
    }
Beispiel #4
0
        public GaussianWeights(string name, int numStates, int gauPerState, int numStreams)
        {
            this.numStates   = numStates;
            this.gauPerState = gauPerState;
            this.numStreams  = numStreams;
            this.name        = name;
            int num = numStates * numStreams;

            int[] array = new int[2];
            int   num2  = num;

            array[1]     = num2;
            array[0]     = gauPerState;
            this.weights = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array);
        }
Beispiel #5
0
        protected internal GrammarNode(int id, bool isFinal)
        {
            this.arcList  = new ArrayList();
            this.identity = id;
            this.isFinal  = isFinal;
            int num  = 0;
            int num2 = 0;

            int[] array = new int[2];
            int   num3  = num2;

            array[1]          = num3;
            num3              = num;
            array[0]          = num3;
            this.alternatives = (Word[][])ByteCodeHelper.multianewarray(typeof(Word[][]).TypeHandle, array);
        }
    public AdjMatrixEdgeWeightedDigraph(int i)
    {
        if (i < 0)
        {
            string arg_16_0 = "Number of vertices must be nonnegative";

            throw new RuntimeException(arg_16_0);
        }
        this.V = i;
        this.E = 0;
        int[] array = new int[]
        {
            0,
            i
        };
        array[0] = i;
        this.adj = (DirectedEdge[][])ByteCodeHelper.multianewarray(typeof(DirectedEdge[][]).TypeHandle, array);
    }
        public static float[][] double2float(double[][] array)
        {
            int num  = array.Length;
            int num2 = array[0].Length;

            int[] array2 = new int[2];
            int   num3   = num2;

            array2[1] = num3;
            num3      = num;
            array2[0] = num3;
            float[][] array3 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array2);
            for (int i = 0; i < array.Length; i++)
            {
                array3[i] = MatrixUtils.double2float(array[i]);
            }
            return(array3);
        }
Beispiel #8
0
 public MixtureComponentSetScores(int numStreams, int gauNum, long frameStartSample)
 {
     int[] array = new int[]
     {
         0,
         gauNum
     };
     array[0]    = numStreams;
     this.scores = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array);
     array       = new int[]
     {
         0,
         gauNum
     };
     array[0] = numStreams;
     this.ids = (int[][])ByteCodeHelper.multianewarray(typeof(int[][]).TypeHandle, array);
     this.frameStartSample = frameStartSample;
 }
    /**/ public static void main(string[] strarr)
    {
        In  @in      = new In(strarr[0]);
        int num      = @in.readInt();
        int arg_23_0 = num;
        int arg_1E_0 = num;

        int[] array = new int[2];
        int   num2  = arg_1E_0;

        array[1] = num2;
        num2     = arg_23_0;
        array[0] = num2;
        double[][] array2 = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array);
        for (int i = 0; i < num; i++)
        {
            for (int j = 0; j < num; j++)
            {
                array2[i][j] = @in.readDouble();
            }
        }
        AssignmentProblem assignmentProblem = new AssignmentProblem(array2);

        StdOut.println(new StringBuilder().append("weight = ").append(assignmentProblem.weight()).toString());
        for (int j = 0; j < num; j++)
        {
            StdOut.println(new StringBuilder().append(j).append("-").append(assignmentProblem.sol(j)).append("' ").append(array2[j][assignmentProblem.sol(j)]).toString());
        }
        for (int j = 0; j < num; j++)
        {
            StdOut.println(new StringBuilder().append("px[").append(j).append("] = ").append(assignmentProblem.dualRow(j)).toString());
        }
        for (int j = 0; j < num; j++)
        {
            StdOut.println(new StringBuilder().append("py[").append(j).append("] = ").append(assignmentProblem.dualCol(j)).toString());
        }
        for (int j = 0; j < num; j++)
        {
            for (int k = 0; k < num; k++)
            {
                StdOut.println(new StringBuilder().append("reduced[").append(j).append("-").append(k).append("] = ").append(assignmentProblem.reduced(j, k)).toString());
            }
        }
    }
        private int applyRaisedCosineWindow(double[] array, int num)
        {
            int num2;

            if (num < this.cosineWindow.Length)
            {
                double[] array2 = new double[this.cosineWindow.Length];
                ByteCodeHelper.arraycopy_primitive_8(array, 0, array2, 0, num);
                array = array2;
                num2  = 1;
            }
            else
            {
                num2 = RaisedCosineWindower.getWindowCount(num, this.cosineWindow.Length, this.windowShift);
            }
            int num3 = num2;
            int num4 = this.cosineWindow.Length;

            int[] array3 = new int[2];
            int   num5   = num4;

            array3[1] = num5;
            num5      = num3;
            array3[0] = num5;
            double[][] array4 = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array3);
            int        num6   = 0;

            for (int i = 0; i < num2; i++)
            {
                double[] array5 = array4[i];
                int      j      = 0;
                int      num7   = num6;
                while (j < array5.Length)
                {
                    array5[j] = array[num7] * this.cosineWindow[j];
                    num7++;
                    j++;
                }
                this.outputQueue.add(new DoubleData(array5, this.sampleRate, this.currentFirstSampleNumber));
                this.currentFirstSampleNumber += (long)this.windowShift;
                num6 += this.windowShift;
            }
            return(num6);
        }
Beispiel #11
0
        private void addModelToTransitionMatrixPool(Pool pool, int id, int num, float num2, bool flag)
        {
            if (!ModelInitializerLoader.assertionsDisabled && pool == null)
            {
                throw new AssertionError();
            }
            int num3 = num + 1;
            int num4 = num3;
            int num5 = num3;

            int[] array = new int[2];
            int   num6  = num5;

            array[1] = num6;
            num6     = num4;
            array[0] = num6;
            float[][] array2 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array);
            for (int i = 0; i < num3; i++)
            {
                for (int j = 0; j < num3; j++)
                {
                    array2[i][j] = 0f;
                    if (i < num3 - 1)
                    {
                        if (j == i || j == i + 1)
                        {
                            array2[i][j] = num2;
                        }
                        if (flag && j == i + 2)
                        {
                            array2[i][j] = num2;
                        }
                    }
                }
                this.normalize(array2[i]);
                this.logMath.linearToLog(array2[i]);
            }
            pool.put(id, array2);
        }
Beispiel #12
0
        private void init()
        {
            int num = this.loader.getVectorLength()[0];

            this.regLs = new double[this.nClusters][][][][];
            this.regRs = new double[this.nClusters][][][];
            for (int i = 0; i < this.nClusters; i++)
            {
                this.regLs[i] = new double[this.loader.getNumStreams()][][][];
                this.regRs[i] = new double[this.loader.getNumStreams()][][];
                for (int j = 0; j < this.loader.getNumStreams(); j++)
                {
                    int            num2   = this.loader.getVectorLength()[j];
                    double[][][][] array  = this.regLs[i];
                    int            num3   = j;
                    int            num4   = num2;
                    int            num5   = num2 + 1;
                    int            num6   = num2 + 1;
                    int[]          array2 = new int[3];
                    int            num7   = num6;
                    array2[2]   = num7;
                    num7        = num5;
                    array2[1]   = num7;
                    num7        = num4;
                    array2[0]   = num7;
                    array[num3] = (double[][][])ByteCodeHelper.multianewarray(typeof(double[][][]).TypeHandle, array2);
                    double[][][] array3 = this.regRs[i];
                    int          num8   = j;
                    int          num9   = num2;
                    int          num10  = num2 + 1;
                    array2       = new int[2];
                    num7         = num10;
                    array2[1]    = num7;
                    num7         = num9;
                    array2[0]    = num7;
                    array3[num8] = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array2);
                }
            }
        }
Beispiel #13
0
        protected internal virtual void computeMelCosine()
        {
            int num  = this.cepstrumSize;
            int num2 = this.numberMelFilters;

            int[] array = new int[2];
            int   num3  = num2;

            array[1]       = num3;
            num3           = num;
            array[0]       = num3;
            this.melcosine = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array);
            double num4 = 2.0 * (double)this.numberMelFilters;

            for (int i = 0; i < this.cepstrumSize; i++)
            {
                double num5 = 6.2831853071795862 * (double)i / num4;
                for (int j = 0; j < this.numberMelFilters; j++)
                {
                    this.melcosine[i][j] = Math.cos(num5 * ((double)j + 0.5));
                }
            }
        }
        public PolynomialRegression(double[] darr1, double[] darr2, int i)
        {
            this.degree = i;
            this.N      = darr1.Length;
            int arg_2C_0 = this.N;
            int arg_27_0 = i + 1;

            int[] array = new int[2];
            int   num   = arg_27_0;

            array[1] = num;
            num      = arg_2C_0;
            array[0] = num;
            double[][] array2 = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array);
            for (int j = 0; j < this.N; j++)
            {
                for (int k = 0; k <= i; k++)
                {
                    array2[j][k] = java.lang.Math.pow(darr1[j], (double)k);
                }
            }
            throw new NoClassDefFoundError("Jama.Matrix");
        }
        private void computeCosine()
        {
            int num  = this.LPCOrder + 1;
            int num2 = this.numberPLPFilters;

            int[] array = new int[2];
            int   num3  = num2;

            array[1]    = num3;
            num3        = num;
            array[0]    = num3;
            this.cosine = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array);
            double num4 = 2.0 * (double)this.numberPLPFilters;

            for (int i = 0; i <= this.LPCOrder; i++)
            {
                double num5 = 6.2831853071795862 * (double)i / num4;
                for (int j = 0; j < this.numberPLPFilters; j++)
                {
                    this.cosine[i][j] = Math.cos(num5 * ((double)j + 0.5));
                }
            }
        }
        public virtual float[][] getTransitionMatrix(int phone, int[] pdfs)
        {
            int num  = 4;
            int num2 = 4;

            int[] array = new int[2];
            int   num3  = num2;

            array[1] = num3;
            num3     = num;
            array[0] = num3;
            float[][] array2 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array);
            Arrays.fill(array2[3], float.MinValue);
            Iterator iterator = ((List)this.phoneStates.get(Integer.valueOf(phone))).iterator();

            while (iterator.hasNext())
            {
                HmmState hmmState = (HmmState)iterator.next();
                int      id       = hmmState.getId();
                Arrays.fill(array2[id], float.MinValue);
                Triple   triple    = new Triple(phone, id, pdfs[id]);
                int      num4      = ((Integer)this.transitionStates.get(triple)).intValue();
                Iterator iterator2 = hmmState.getTransitions().iterator();
                while (iterator2.hasNext())
                {
                    Integer integer = (Integer)iterator2.next();
                    float[] array3  = array2[id];
                    int     num5    = integer.intValue();
                    float[] array4  = this.logProbabilities;
                    int     num6    = num4;
                    num4++;
                    array3[num5] = array4[num6];
                }
            }
            return(array2);
        }
        protected internal override void computeMelCosine()
        {
            int cepstrumSize     = this.cepstrumSize;
            int numberMelFilters = this.numberMelFilters;

            int[] array = new int[2];
            int   num   = numberMelFilters;

            array[1]       = num;
            num            = cepstrumSize;
            array[0]       = num;
            this.melcosine = (double[][])ByteCodeHelper.multianewarray(typeof(double[][]).TypeHandle, array);
            Arrays.fill(this.melcosine[0], java.lang.Math.sqrt((double)1f / (double)this.numberMelFilters));
            double num2 = java.lang.Math.sqrt(2.0 / (double)this.numberMelFilters);

            for (int i = 1; i < this.cepstrumSize; i++)
            {
                double num3 = 3.1415926535897931 * (double)i / (double)this.numberMelFilters;
                for (int j = 0; j < this.numberMelFilters; j++)
                {
                    this.melcosine[i][j] = num2 * java.lang.Math.cos(num3 * ((double)j + 0.5));
                }
            }
        }
Beispiel #18
0
        public virtual void load(string filePath)
        {
            Scanner scanner = new Scanner(new File(filePath));
            int     num     = scanner.nextInt();

            if (!Transform.assertionsDisabled && num != 1)
            {
                throw new AssertionError();
            }
            int num2 = scanner.nextInt();
            int num3 = num;
            int num4 = num2;

            int[] array = new int[2];
            int   num5  = num4;

            array[1] = num5;
            num5     = num3;
            array[0] = num5;
            this.As  = (float[][][][])ByteCodeHelper.multianewarray(typeof(float[][][][]).TypeHandle, array);
            int num6 = num;
            int num7 = num2;

            array    = new int[2];
            num5     = num7;
            array[1] = num5;
            num5     = num6;
            array[0] = num5;
            this.Bs  = (float[][][])ByteCodeHelper.multianewarray(typeof(float[][][]).TypeHandle, array);
            for (int i = 0; i < num2; i++)
            {
                int         num8   = scanner.nextInt();
                float[][][] array2 = this.As[0];
                int         num9   = i;
                int         num10  = num8;
                int         num11  = num8;
                array         = new int[2];
                num5          = num11;
                array[1]      = num5;
                num5          = num10;
                array[0]      = num5;
                array2[num9]  = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array);
                this.Bs[0][i] = new float[num8];
                for (int j = 0; j < num8; j++)
                {
                    for (int k = 0; k < num8; k++)
                    {
                        this.As[0][i][j][k] = scanner.nextFloat();
                    }
                }
                for (int j = 0; j < num8; j++)
                {
                    this.Bs[0][i][j] = scanner.nextFloat();
                }
                for (int j = 0; j < num8; j++)
                {
                    scanner.nextFloat();
                }
            }
            scanner.close();
        }
        internal static int[] alignTextSimple(List list, List list2, int num)
        {
            int num2 = list.size() + 1;
            int i    = list2.size() + 1;
            int num3 = num2;
            int num4 = i;

            int[] array = new int[2];
            int   num5  = num4;

            array[1] = num5;
            num5     = num3;
            array[0] = num5;
            int[][] array2 = (int[][])ByteCodeHelper.multianewarray(typeof(int[][]).TypeHandle, array);
            array2[0][0] = 0;
            for (int j = 1; j < num2; j++)
            {
                array2[j][0] = j;
            }
            for (int j = 1; j < i; j++)
            {
                array2[0][j] = j;
            }
            for (int j = 1; j < num2; j++)
            {
                for (int k = 1; k < i; k++)
                {
                    int    num6  = array2[j - 1][k - 1];
                    string text  = (string)list.get(j - 1);
                    string text2 = (string)list2.get(k - 1);
                    if (!String.instancehelper_equals(text, text2))
                    {
                        num6++;
                    }
                    int num7 = array2[j][k - 1] + 1;
                    int num8 = array2[j - 1][k] + 1;
                    array2[j][k] = Math.min(num6, Math.min(num7, num8));
                }
            }
            num2--;
            i--;
            int[] array3 = new int[i];
            Arrays.fill(array3, -1);
            while (i > 0)
            {
                if (num2 == 0)
                {
                    i--;
                }
                else
                {
                    string text3 = (string)list.get(num2 - 1);
                    string text4 = (string)list2.get(i - 1);
                    if (array2[num2 - 1][i - 1] <= array2[num2 - 1][i - 1] && array2[num2 - 1][i - 1] <= array2[num2][i - 1] && String.instancehelper_equals(text3, text4))
                    {
                        int[] array4 = array3;
                        i--;
                        int num9 = i;
                        num2--;
                        array4[num9] = num2 + num;
                    }
                    else if (array2[num2 - 1][i] < array2[num2][i - 1])
                    {
                        num2--;
                    }
                    else
                    {
                        i--;
                    }
                }
            }
            return(array3);
        }
Beispiel #20
0
            public Pool htkTrans(string name)
            {
                Pool pool    = new Pool(name);
                int  numHMMs = this.getNumHMMs();
                int  i       = 0;

                if (this.hmmsHTK.__transitions != null)
                {
                    while (i < this.hmmsHTK.__transitions.size())
                    {
                        float[][] array  = (float[][])this.hmmsHTK.__transitions.get(i);
                        int       num    = array.Length;
                        int       num2   = array[0].Length;
                        int[]     array2 = new int[2];
                        int       num3   = num2;
                        array2[1] = num3;
                        num3      = num;
                        array2[0] = num3;
                        float[][] array3 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array2);
                        for (int j = 0; j < array3.Length; j++)
                        {
                            for (int k = 0; k < array3[j].Length; k++)
                            {
                                array3[j][k] = HTKLoader.access_200(this.this_0).linearToLog((double)array[j][k]);
                            }
                        }
                        pool.put(i, array3);
                        i++;
                    }
                }
                for (int l = 0; l < numHMMs; l++)
                {
                    SingleHMM hmm = this.hmmsHTK.getHMM(l);
                    if (hmm.trans != null)
                    {
                        float[][] trans  = hmm.trans;
                        int       num4   = trans.Length;
                        int       num5   = trans[0].Length;
                        int[]     array2 = new int[2];
                        int       num3   = num5;
                        array2[1] = num3;
                        num3      = num4;
                        array2[0] = num3;
                        float[][] array4 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array2);
                        for (int m = 0; m < array4.Length; m++)
                        {
                            for (int n = 0; n < array4[m].Length; n++)
                            {
                                array4[m][n] = HTKLoader.access_200(this.this_0).linearToLog((double)trans[m][n]);
                            }
                        }
                        hmm.trIdx = i;
                        Pool pool2 = pool;
                        int  id    = i;
                        i++;
                        pool2.put(id, array4);
                    }
                    else
                    {
                        hmm.trIdx = hmm.getTransIdx();
                    }
                }
                return(pool);
            }
Beispiel #21
0
        private int[][] generateWorkingKey(byte[] buffer1, bool flag1)
        {
            int num7;
            int expressionStack_DD_0;
            int expressionStack_FA_1;

            int[] expressionStack_FA_2;
            int   expressionStack_FA_3;
            int   expressionStack_FF_0;

            int[] expressionStack_FF_1;
            int   expressionStack_FF_2;
            int   expressionStack_118_0;
            int   num  = (int)flag1;
            int   num2 = buffer1.Length / 4;

            if ((((num2 != 4) && (num2 != 6)) && (num2 != 8)) || ((num2 * 4) != buffer1.Length))
            {
                Throwable.__ <suppressFillInStackTrace>();
                throw new IllegalArgumentException("Key length not 128/192/256 bits.");
            }
            this.ROUNDS = num2 + 6;
            int[] numArray = new int[2];
            int   num3     = 4;

            numArray[1] = num3;
            num3        = this.ROUNDS + 1;
            numArray[0] = num3;
            int[][] numArray2 = (int[][])ByteCodeHelper.multianewarray(typeof(int[][]).TypeHandle, numArray);
            int     num4      = 0;
            int     index     = 0;

            while (true)
            {
                if (index >= buffer1.Length)
                {
                    break;
                }
                numArray2[num4 >> 2][num4 & 3] = ((buffer1[index] | (buffer1[index + 1] << 8)) | (buffer1[index + 2] << 0x10)) | (buffer1[index + 3] << 0x18);
                index += 4;
                num4++;
            }
            int num6 = (this.ROUNDS + 1) << 2;

            index = num2;
Label_00B5:
            if (index >= num6)
            {
                if (num != 0)
                {
                    return(numArray2);
                }
                num7 = 1;
                goto Label_0155;
            }
            num7 = numArray2[(index - 1) >> 2][(index - 1) & 3];
            if (num2 != -1)
            {
                int expressionStack_DC_1 = index;
                int expressionStack_DC_0 = num2;
                expressionStack_DD_0 = expressionStack_DC_1 % expressionStack_DC_0;
                goto Label_00DD;
            }
            else
            {
                int expressionStack_D7_1 = index;
                int expressionStack_D7_0 = num2;
            }
            expressionStack_DD_0 = 0;
Label_00DD:
            if (expressionStack_DD_0 != 0)
            {
                if (num2 <= 6)
                {
                    goto Label_0125;
                }
                if (num2 != -1)
                {
                    int expressionStack_117_1 = index;
                    int expressionStack_117_0 = num2;
                    expressionStack_118_0 = expressionStack_117_1 % expressionStack_117_0;
                    goto Label_0118;
                }
                else
                {
                    int expressionStack_112_1 = index;
                    int expressionStack_112_0 = num2;
                }
                expressionStack_118_0 = 0;
                goto Label_0118;
            }
            if (num2 != -1)
            {
                int   expressionStack_FE_3 = this.subWord(this.shift(num7, 8));
                int[] rcon = AESFastEngine.rcon;
                int   expressionStack_FE_1 = index;
                int   expressionStack_FE_0 = num2;
                expressionStack_FF_2 = expressionStack_FE_3;
                expressionStack_FF_1 = rcon;
                expressionStack_FF_0 = expressionStack_FE_1 / expressionStack_FE_0;
                goto Label_00FF;
            }
            else
            {
                expressionStack_FA_3 = this.subWord(this.shift(num7, 8));
                expressionStack_FA_2 = AESFastEngine.rcon;
                expressionStack_FA_1 = index;
                int expressionStack_FA_0 = num2;
            }
            expressionStack_FF_2 = expressionStack_FA_3;
            expressionStack_FF_1 = expressionStack_FA_2;
            expressionStack_FF_0 = -expressionStack_FA_1;
Label_00FF:
            num7 = expressionStack_FF_2 ^ expressionStack_FF_1[expressionStack_FF_0 - 1];
            goto Label_0125;
Label_0118:
            if (expressionStack_118_0 == 4)
            {
                num7 = this.subWord(num7);
            }
Label_0125:
            numArray2[index >> 2][index & 3] = numArray2[(index - num2) >> 2][(index - num2) & 3] ^ num7;
            index++;
            goto Label_00B5;
Label_0155:
            if (num7 >= this.ROUNDS)
            {
                return(numArray2);
            }
            index = 0;
            while (true)
            {
                if (index >= 4)
                {
                    break;
                }
                numArray2[num7][index] = this.inv_mcol(numArray2[num7][index]);
                index++;
            }
            num7++;
            goto Label_0155;
        }
Beispiel #22
0
        internal virtual int[][] createBacktraceTable(LinkedList linkedList, LinkedList linkedList2, NISTAlign.Comparator comparator)
        {
            int num  = linkedList.size() + 1;
            int num2 = linkedList2.size() + 1;

            int[] array = new int[2];
            int   num3  = num2;

            array[1] = num3;
            num3     = num;
            array[0] = num3;
            int[][] array2 = (int[][])ByteCodeHelper.multianewarray(typeof(int[][]).TypeHandle, array);
            int     num4   = linkedList.size() + 1;
            int     num5   = linkedList2.size() + 1;

            array    = new int[2];
            num3     = num5;
            array[1] = num3;
            num3     = num4;
            array[0] = num3;
            int[][] array3 = (int[][])ByteCodeHelper.multianewarray(typeof(int[][]).TypeHandle, array);
            array2[0][0] = 0;
            array3[0][0] = 0;
            for (int i = 1; i <= linkedList.size(); i++)
            {
                array2[i][0] = 75 * i;
                array3[i][0] = 3;
            }
            for (int i = 1; i <= linkedList2.size(); i++)
            {
                array2[0][i] = 75 * i;
                array3[0][i] = 2;
            }
            for (int i = 1; i <= linkedList.size(); i++)
            {
                for (int j = 1; j <= linkedList2.size(); j++)
                {
                    int num6 = 1000000;
                    int num7 = array2[i - 1][j] + 75;
                    if (num7 < num6)
                    {
                        num6         = num7;
                        array2[i][j] = num7;
                        array3[i][j] = 3;
                    }
                    if (comparator.isSimilar(linkedList.get(i - 1), linkedList2.get(j - 1)))
                    {
                        num7 = array2[i - 1][j - 1];
                        if (num7 < num6)
                        {
                            num6         = num7;
                            array2[i][j] = num7;
                            array3[i][j] = 0;
                        }
                    }
                    else
                    {
                        num7 = array2[i - 1][j - 1] + 100;
                        if (num7 < num6)
                        {
                            num6         = num7;
                            array2[i][j] = num7;
                            array3[i][j] = 1;
                        }
                    }
                    num7 = array2[i][j - 1] + 75;
                    if (num7 < num6)
                    {
                        array2[i][j] = num7;
                        array3[i][j] = 2;
                    }
                }
            }
            return(array3);
        }
        private void kMeansClustering(Loader loader, int num)
        {
            Pool      meansPool  = loader.getMeansPool();
            ArrayList arrayList  = new ArrayList(this.numberOfClusters);
            ArrayList arrayList2 = new ArrayList(this.numberOfClusters);
            int       num2       = meansPool.size();
            int       num3       = num;

            int[] array = new int[this.numberOfClusters];
            int   num4  = this.numberOfClusters;
            int   num5  = num2;

            int[] array2 = new int[2];
            int   num6   = num5;

            array2[1] = num6;
            num6      = num4;
            array2[0] = num6;
            float[][][] array3 = (float[][][])ByteCodeHelper.multianewarray(typeof(float[][][]).TypeHandle, array2);
            int         num7   = 0;

            java.util.Random random = new java.util.Random();
            for (int i = 0; i < this.numberOfClusters; i++)
            {
                int num8 = random.nextInt(num2);
                arrayList2.add(meansPool.get(num8));
                arrayList.add(meansPool.get(num8));
                array[i] = 0;
            }
            while (num7 == 0 && num3 > 0)
            {
                this.corespondingClass = new int[meansPool.size()];
                int num9  = this.numberOfClusters;
                int num10 = num2;
                array2    = new int[2];
                num6      = num10;
                array2[1] = num6;
                num6      = num9;
                array2[0] = num6;
                float[][][] array4 = (float[][][])ByteCodeHelper.multianewarray(typeof(float[][][]).TypeHandle, array2);
                for (int i = 0; i < this.numberOfClusters; i++)
                {
                    arrayList.set(i, arrayList2.get(i));
                    array[i] = 0;
                }
                for (int i = 0; i < meansPool.size(); i++)
                {
                    float[] array5 = (float[])meansPool.get(i);
                    double  num11  = (double)this.euclidianDistance((float[])arrayList.get(0), array5);
                    int     num8   = 0;
                    for (int j = 1; j < this.numberOfClusters; j++)
                    {
                        double num12 = (double)this.euclidianDistance((float[])arrayList.get(j), array5);
                        if (num12 < num11)
                        {
                            num11 = num12;
                            num8  = j;
                        }
                    }
                    array4[num8][array[num8]] = array5;
                    this.corespondingClass[i] = num8;
                    int[] array6 = array;
                    num6   = num8;
                    array2 = array6;
                    array2[num6]++;
                }
                for (int i = 0; i < this.numberOfClusters; i++)
                {
                    float[] array7 = new float[((float[])meansPool.get(0)).Length];
                    if (array[i] > 0)
                    {
                        for (int j = 0; j < array[i]; j++)
                        {
                            for (int k = 0; k < ((float[])meansPool.get(0)).Length; k++)
                            {
                                float[] array8 = array7;
                                num6 = k;
                                float[] array9 = array8;
                                array9[num6] += array4[i][j][k];
                            }
                        }
                        for (int j = 0; j < ((float[])meansPool.get(0)).Length; j++)
                        {
                            float[] array10 = array7;
                            num6 = j;
                            float[] array9 = array10;
                            array9[num6] /= (float)array[i];
                        }
                        arrayList2.set(i, array7);
                    }
                }
                num7 = 1;
                for (int i = 0; i < this.numberOfClusters; i++)
                {
                    num7 = ((num7 == 0 || !this.isEqual((float[])arrayList2.get(i), (float[])arrayList.get(i))) ? 0 : 1);
                }
                num3--;
            }
        }