CSJ2K.j2k.wavelet.analysis.SubbandAn.calcL2Norms C# (CSharp) 메소드

calcL2Norms() 개인적인 메소드

Calculates the L2-norm of the sythesis waveforms of every leaf in the tree. This method should only be called on the root element.
private calcL2Norms ( ) : void
리턴 void
        private void calcL2Norms()
        {
            int i;
            float[][] wfs = new float[2][];
            double acc;
            float l2n;

            // While we are not done on the root element, compute basis functions
            // and assign L2-norm
            while (l2Norm < 0f)
            {
                calcBasisWaveForms(wfs);
                // Compute line L2-norm, which is the product of the line
                // and column L2-norms
                acc = 0.0;
                for (i = wfs[0].Length - 1; i >= 0; i--)
                {
                    acc += wfs[0][i] * wfs[0][i];
                }
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                l2n = (float) System.Math.Sqrt(acc);
                // Compute column L2-norm
                acc = 0.0;
                for (i = wfs[1].Length - 1; i >= 0; i--)
                {
                    acc += wfs[1][i] * wfs[1][i];
                }
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                l2n *= (float) System.Math.Sqrt(acc);
                // Release waveforms
                wfs[0] = null;
                wfs[1] = null;
                // Assign the value
                assignL2Norm(l2n);
            }
        }