示例#1
0
 protected internal virtual MixtureComponent[] toArray()
 {
     PrunableMixtureComponent[] array = new PrunableMixtureComponent[0];
     for (int i = 0; i < this.numStreams; i++)
     {
         this.concatenate(array, (object[])this.components.get(i));
     }
     return(array);
 }
示例#2
0
        private bool isInTopComponents(PrunableMixtureComponent[] array, PrunableMixtureComponent prunableMixtureComponent)
        {
            int num = array.Length;

            for (int i = 0; i < num; i++)
            {
                PrunableMixtureComponent prunableMixtureComponent2 = array[i];
                if (prunableMixtureComponent2.getId() == prunableMixtureComponent.getId())
                {
                    return(true);
                }
            }
            return(false);
        }
示例#3
0
        private void updateScores(float[] array)
        {
            int num  = array.Length;
            int num2 = this.numStreams;
            int num3 = (num2 != -1) ? (num / num2) : (-num);

            float[] array2 = new float[num3];
            for (int i = 0; i < this.numStreams; i++)
            {
                ByteCodeHelper.arraycopy_primitive_4(array, i * num3, array2, 0, num3);
                PrunableMixtureComponent[] array3 = (PrunableMixtureComponent[])this.components.get(i);
                int num4 = array3.Length;
                for (int j = 0; j < num4; j++)
                {
                    PrunableMixtureComponent prunableMixtureComponent = array3[j];
                    prunableMixtureComponent.updateScore(array2);
                }
            }
        }
示例#4
0
 private void insertTopComponent(PrunableMixtureComponent[] array, PrunableMixtureComponent prunableMixtureComponent)
 {
     for (int i = 0; i < array.Length - 1; i++)
     {
         if (prunableMixtureComponent.getPartialScore() < array[i].getPartialScore())
         {
             array[i - 1] = prunableMixtureComponent;
             return;
         }
         array[i] = array[i + 1];
     }
     if (prunableMixtureComponent.getPartialScore() < array[array.Length - 1].getPartialScore())
     {
         array[array.Length - 2] = prunableMixtureComponent;
     }
     else
     {
         array[array.Length - 1] = prunableMixtureComponent;
     }
 }
示例#5
0
 public MixtureComponentSet(ArrayList components, int topGauNum)
 {
     this.componentComparator = new MixtureComponentSet_1(this);
     this.components          = components;
     this.numStreams          = components.size();
     this.topGauNum           = topGauNum;
     this.gauNum        = ((PrunableMixtureComponent[])components.get(0)).Length;
     this.topComponents = new ArrayList();
     for (int i = 0; i < this.numStreams; i++)
     {
         PrunableMixtureComponent[] array = new PrunableMixtureComponent[topGauNum];
         for (int j = 0; j < topGauNum; j++)
         {
             array[j] = ((PrunableMixtureComponent[])components.get(i))[j];
         }
         this.topComponents.add(array);
     }
     this.gauCalcSampleNumber = -1L;
     this.toStoreScore        = false;
     this.storedScores        = new LinkedList();
     this.curScores           = null;
 }
示例#6
0
        private void updateTopScores(float[] array)
        {
            int num  = array.Length;
            int num2 = this.numStreams;
            int num3 = (num2 != -1) ? (num / num2) : (-num);

            float[] array2 = new float[num3];
            for (int i = 0; i < this.numStreams; i++)
            {
                ByteCodeHelper.arraycopy_primitive_4(array, i * num3, array2, 0, num3);
                PrunableMixtureComponent[] array3 = (PrunableMixtureComponent[])this.topComponents.get(i);
                PrunableMixtureComponent[] array4 = (PrunableMixtureComponent[])this.components.get(i);
                PrunableMixtureComponent[] array5 = array3;
                int num4 = array5.Length;
                int j;
                for (j = 0; j < num4; j++)
                {
                    PrunableMixtureComponent prunableMixtureComponent = array5[j];
                    prunableMixtureComponent.updateScore(array2);
                }
                Arrays.sort(array3, this.componentComparator);
                float partialScore = array3[0].getPartialScore();
                PrunableMixtureComponent[] array6 = array4;
                j = array6.Length;
                for (int k = 0; k < j; k++)
                {
                    PrunableMixtureComponent prunableMixtureComponent2 = array6[k];
                    if (!this.isInTopComponents(array3, prunableMixtureComponent2))
                    {
                        if (prunableMixtureComponent2.isTopComponent(array2, partialScore))
                        {
                            this.insertTopComponent(array3, prunableMixtureComponent2);
                            partialScore = array3[0].getPartialScore();
                        }
                    }
                }
            }
        }
 public int compare(PrunableMixtureComponent prunableMixtureComponent, PrunableMixtureComponent prunableMixtureComponent2)
 {
     return(ByteCodeHelper.f2i(prunableMixtureComponent.getStoredScore() - prunableMixtureComponent2.getStoredScore()));
 }