当前位置: 首页>>代码示例>>C#>>正文


C# AP类代码示例

本文整理汇总了C#中AP的典型用法代码示例。如果您正苦于以下问题:C# AP类的具体用法?C# AP怎么用?C# AP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AP类属于命名空间,在下文中一共展示了AP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: corr

        /*************************************************************************
        1-dimensional complex cross-correlation.

        For given Pattern/Signal returns corr(Pattern,Signal) (non-circular).

        Correlation is calculated using reduction to  convolution.  Algorithm with
        max(N,N)*log(max(N,N)) complexity is used (see  ConvC1D()  for  more  info
        about performance).

        IMPORTANT:
            for  historical reasons subroutine accepts its parameters in  reversed
            order: CorrC1D(Signal, Pattern) = Pattern x Signal (using  traditional
            definition of cross-correlation, denoting cross-correlation as "x").

        INPUT PARAMETERS
            Signal  -   array[0..N-1] - complex function to be transformed,
                        signal containing pattern
            N       -   problem size
            Pattern -   array[0..M-1] - complex function to be transformed,
                        pattern to search withing signal
            M       -   problem size

        OUTPUT PARAMETERS
            R       -   cross-correlation, array[0..N+M-2]:
                        * positive lags are stored in R[0..N-1],
                          R[i] = sum(conj(pattern[j])*signal[i+j]
                        * negative lags are stored in R[N..N+M-2],
                          R[N+M-1-i] = sum(conj(pattern[j])*signal[-i+j]

        NOTE:
            It is assumed that pattern domain is [0..M-1].  If Pattern is non-zero
        on [-K..M-1],  you can still use this subroutine, just shift result by K.

          -- ALGLIB --
             Copyright 21.07.2009 by Bochkanov Sergey
        *************************************************************************/
        public static void corrc1d(ref AP.Complex[] signal,
            int n,
            ref AP.Complex[] pattern,
            int m,
            ref AP.Complex[] r)
        {
            AP.Complex[] p = new AP.Complex[0];
            AP.Complex[] b = new AP.Complex[0];
            int i = 0;
            int i_ = 0;
            int i1_ = 0;

            System.Diagnostics.Debug.Assert(n>0 & m>0, "CorrC1D: incorrect N or M!");
            p = new AP.Complex[m];
            for(i=0; i<=m-1; i++)
            {
                p[m-1-i] = AP.Math.Conj(pattern[i]);
            }
            conv.convc1d(ref p, m, ref signal, n, ref b);
            r = new AP.Complex[m+n-1];
            i1_ = (m-1) - (0);
            for(i_=0; i_<=n-1;i_++)
            {
                r[i_] = b[i_+i1_];
            }
            if( m+n-2>=n )
            {
                i1_ = (0) - (n);
                for(i_=n; i_<=m+n-2;i_++)
                {
                    r[i_] = b[i_+i1_];
                }
            }
        }
开发者ID:palefacer,项目名称:TelescopeOrientation,代码行数:70,代码来源:corr.cs

示例2: ablascomplexblocksize

        /*************************************************************************
        Block size for complex subroutines.

          -- ALGLIB routine --
             15.12.2009
             Bochkanov Sergey
        *************************************************************************/
        public static int ablascomplexblocksize(ref AP.Complex[,] a)
        {
            int result = 0;

            result = 24;
            return result;
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:14,代码来源:ablas.cs

示例3: CompletionResult

 internal CompletionResult(string name, string completion, string doc, PythonMemberType memberType, AP.CompletionValue[] values) {
     _name = name;
     _memberType = memberType;
     _completion = completion;
     _doc = doc;
     _values = values;
 }
开发者ID:zooba,项目名称:PTVS,代码行数:7,代码来源:CompletionResult.cs

示例4: PythonParameter

 public PythonParameter(ISignature signature, AP.Parameter param, Span locus, Span ppLocus, AnalysisVariable[] variables) {
     _signature = signature;
     _param = param;
     _locus = locus;
     _ppLocus = ppLocus;
     _documentation = _param.doc.LimitLines(15, stopAtFirstBlankLine: true);
     _variables = variables;
 }
开发者ID:jsschultz,项目名称:PTVS,代码行数:8,代码来源:PythonParameter.cs

示例5: cmatrixdet

        /*************************************************************************
        Calculation of the determinant of a general matrix

        Input parameters:
            A       -   matrix, array[0..N-1, 0..N-1]
            N       -   size of matrix A.

        Result: determinant of matrix A.

          -- ALGLIB --
             Copyright 2005 by Bochkanov Sergey
        *************************************************************************/
        public static AP.Complex cmatrixdet(AP.Complex[,] a,
            int n)
        {
            AP.Complex result = 0;
            int[] pivots = new int[0];

            a = (AP.Complex[,])a.Clone();

            trfac.cmatrixlu(ref a, n, n, ref pivots);
            result = cmatrixludet(ref a, ref pivots, n);
            return result;
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:24,代码来源:matdet.cs

示例6: ablascomplexsplitlength

        /*************************************************************************
        Complex ABLASSplitLength

          -- ALGLIB routine --
             15.12.2009
             Bochkanov Sergey
        *************************************************************************/
        public static void ablascomplexsplitlength(ref AP.Complex[,] a,
            int n,
            ref int n1,
            ref int n2)
        {
            if( n>ablascomplexblocksize(ref a) )
            {
                ablasinternalsplitlength(n, ablascomplexblocksize(ref a), ref n1, ref n2);
            }
            else
            {
                ablasinternalsplitlength(n, ablasmicroblocksize(), ref n1, ref n2);
            }
        }
开发者ID:palefacer,项目名称:TelescopeOrientation,代码行数:21,代码来源:ablas.cs

示例7: cmatrixrank1f

        /*************************************************************************
        Fast kernel

          -- ALGLIB routine --
             19.01.2010
             Bochkanov Sergey
        *************************************************************************/
        public static bool cmatrixrank1f(int m,
            int n,
            ref AP.Complex[,] a,
            int ia,
            int ja,
            ref AP.Complex[] u,
            int iu,
            ref AP.Complex[] v,
            int iv)
        {
            bool result = new bool();

            result = false;
            return result;
        }
开发者ID:palefacer,项目名称:TelescopeOrientation,代码行数:22,代码来源:ablasf.cs

示例8: Tau

        /*************************************************************************
        Application of an elementary reflection to a rectangular matrix of size MxN

        The  algorithm  pre-multiplies  the  matrix  by  an  elementary reflection
        transformation  which  is  given  by  column  V  and  scalar  Tau (see the
        description of the GenerateReflection). Not the whole matrix  but  only  a
        part of it is transformed (rows from M1 to M2, columns from N1 to N2). Only
        the elements of this submatrix are changed.

        Note: the matrix is multiplied by H, not by H'.   If  it  is  required  to
        multiply the matrix by H', it is necessary to pass Conj(Tau) instead of Tau.

        Input parameters:
            C       -   matrix to be transformed.
            Tau     -   scalar defining transformation.
            V       -   column defining transformation.
                        Array whose index ranges within [1..M2-M1+1]
            M1, M2  -   range of rows to be transformed.
            N1, N2  -   range of columns to be transformed.
            WORK    -   working array whose index goes from N1 to N2.

        Output parameters:
            C       -   the result of multiplying the input matrix C by the
                        transformation matrix which is given by Tau and V.
                        If N1>N2 or M1>M2, C is not modified.

          -- LAPACK auxiliary routine (version 3.0) --
             Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
             Courant Institute, Argonne National Lab, and Rice University
             September 30, 1994
        *************************************************************************/
        public static void complexapplyreflectionfromtheleft(ref AP.Complex[,] c,
            AP.Complex tau,
            ref AP.Complex[] v,
            int m1,
            int m2,
            int n1,
            int n2,
            ref AP.Complex[] work)
        {
            AP.Complex t = 0;
            int i = 0;
            int vm = 0;
            int i_ = 0;

            if (tau == 0 | n1 > n2 | m1 > m2)
            {
                return;
            }

            //
            // w := C^T * conj(v)
            //
            vm = m2 - m1 + 1;
            for (i = n1; i <= n2; i++)
            {
                work[i] = 0;
            }
            for (i = m1; i <= m2; i++)
            {
                t = AP.Math.Conj(v[i + 1 - m1]);
                for (i_ = n1; i_ <= n2; i_++)
                {
                    work[i_] = work[i_] + t * c[i, i_];
                }
            }

            //
            // C := C - tau * v * w^T
            //
            for (i = m1; i <= m2; i++)
            {
                t = v[i - m1 + 1] * tau;
                for (i_ = n1; i_ <= n2; i_++)
                {
                    c[i, i_] = c[i, i_] - t * work[i_];
                }
            }
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:79,代码来源:creflections.cs

示例9: cmatrixmvf

        /*************************************************************************
        Fast kernel

          -- ALGLIB routine --
             19.01.2010
             Bochkanov Sergey
        *************************************************************************/
        public static bool cmatrixmvf(int m,
            int n,
            ref AP.Complex[,] a,
            int ia,
            int ja,
            int opa,
            ref AP.Complex[] x,
            int ix,
            ref AP.Complex[] y,
            int iy)
        {
            bool result = new bool();

            result = false;
            return result;
        }
开发者ID:palefacer,项目名称:TelescopeOrientation,代码行数:23,代码来源:ablasf.cs

示例10: number

        /*************************************************************************
        1-dimensional complex FFT.

        Array size N may be arbitrary number (composite or prime).  Composite  N's
        are handled with cache-oblivious variation of  a  Cooley-Tukey  algorithm.
        Small prime-factors are transformed using hard coded  codelets (similar to
        FFTW codelets, but without low-level  optimization),  large  prime-factors
        are handled with Bluestein's algorithm.

        Fastests transforms are for smooth N's (prime factors are 2, 3,  5  only),
        most fast for powers of 2. When N have prime factors  larger  than  these,
        but orders of magnitude smaller than N, computations will be about 4 times
        slower than for nearby highly composite N's. When N itself is prime, speed
        will be 6 times lower.

        Algorithm has O(N*logN) complexity for any N (composite or prime).

        INPUT PARAMETERS
            A   -   array[0..N-1] - complex function to be transformed
            N   -   problem size

        OUTPUT PARAMETERS
            A   -   DFT of a input array, array[0..N-1]
                    A_out[j] = SUM(A_in[k]*exp(-2*pi*sqrt(-1)*j*k/N), k = 0..N-1)

          -- ALGLIB --
             Copyright 29.05.2009 by Bochkanov Sergey
        *************************************************************************/
        public static void fftc1d(ref AP.Complex[] a,
            int n)
        {
            ftbase.ftplan plan = new ftbase.ftplan();
            int i = 0;
            double[] buf = new double[0];

            System.Diagnostics.Debug.Assert(n>0, "FFTC1D: incorrect N!");

            //
            // Special case: N=1, FFT is just identity transform.
            // After this block we assume that N is strictly greater than 1.
            //
            if( n==1 )
            {
                return;
            }

            //
            // convert input array to the more convinient format
            //
            buf = new double[2*n];
            for(i=0; i<=n-1; i++)
            {
                buf[2*i+0] = a[i].x;
                buf[2*i+1] = a[i].y;
            }

            //
            // Generate plan and execute it.
            //
            // Plan is a combination of a successive factorizations of N and
            // precomputed data. It is much like a FFTW plan, but is not stored
            // between subroutine calls and is much simpler.
            //
            ftbase.ftbasegeneratecomplexfftplan(n, ref plan);
            ftbase.ftbaseexecuteplan(ref buf, 0, n, ref plan);

            //
            // result
            //
            for(i=0; i<=n-1; i++)
            {
                a[i].x = buf[2*i+0];
                a[i].y = buf[2*i+1];
            }
        }
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:75,代码来源:fft.cs

示例11: cmatrixlefttrsmf

        /*************************************************************************
        Fast kernel

          -- ALGLIB routine --
             19.01.2010
             Bochkanov Sergey
        *************************************************************************/
        public static bool cmatrixlefttrsmf(int m,
            int n,
            ref AP.Complex[,] a,
            int i1,
            int j1,
            bool isupper,
            bool isunit,
            int optype,
            ref AP.Complex[,] x,
            int i2,
            int j2)
        {
            bool result = new bool();

            result = false;
            return result;
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:24,代码来源:ablasf.cs

示例12: conv

        /*************************************************************************
        1-dimensional complex convolution.

        For given A/B returns conv(A,B) (non-circular). Subroutine can automatically
        choose between three implementations: straightforward O(M*N)  formula  for
        very small N (or M), overlap-add algorithm for  cases  where  max(M,N)  is
        significantly larger than min(M,N), but O(M*N) algorithm is too slow,  and
        general FFT-based formula for cases where two previois algorithms are  too
        slow.

        Algorithm has max(M,N)*log(max(M,N)) complexity for any M/N.

        INPUT PARAMETERS
            A   -   array[0..M-1] - complex function to be transformed
            M   -   problem size
            B   -   array[0..N-1] - complex function to be transformed
            N   -   problem size

        OUTPUT PARAMETERS
            R   -   convolution: A*B. array[0..N+M-2].

        NOTE:
            It is assumed that A is zero at T<0, B is zero too.  If  one  or  both
        functions have non-zero values at negative T's, you  can  still  use  this
        subroutine - just shift its result correspondingly.

          -- ALGLIB --
             Copyright 21.07.2009 by Bochkanov Sergey
        *************************************************************************/
        public static void convc1d(ref AP.Complex[] a,
            int m,
            ref AP.Complex[] b,
            int n,
            ref AP.Complex[] r)
        {
            System.Diagnostics.Debug.Assert(n>0 & m>0, "ConvC1D: incorrect N or M!");
            
            //
            // normalize task: make M>=N,
            // so A will be longer that B.
            //
            if( m<n )
            {
                convc1d(ref b, n, ref a, m, ref r);
                return;
            }
            convc1dx(ref a, m, ref b, n, false, -1, 0, ref r);
        }
开发者ID:palefacer,项目名称:TelescopeOrientation,代码行数:48,代码来源:conv.cs

示例13: UpdateCode

        /// <summary>
        /// Updates the code applying the changes to the existing text buffer and updates the version.
        /// </summary>
        public static string UpdateCode(this IProjectEntry entry, AP.VersionChanges[] versions, int buffer, int version) {
            lock (_currentCodeKey) {
                CurrentCode curCode = GetCurrentCode(entry, buffer);
                var strBuffer = curCode.Text;

                foreach (var versionChange in versions) {
                    int delta = 0;

                    foreach (var change in versionChange.changes) {
                        strBuffer.Remove(change.start + delta, change.length);
                        strBuffer.Insert(change.start + delta, change.newText);

                        delta += change.newText.Length - change.length;
                    }
                }

                curCode.Version = version;
                return strBuffer.ToString();
            }
        }
开发者ID:RussBaz,项目名称:PTVS,代码行数:23,代码来源:ProjectEntryExtensions.cs

示例14: matrix

        /*************************************************************************
        Determinant calculation of the matrix given by its LU decomposition.

        Input parameters:
            A       -   LU decomposition of the matrix (output of
                        RMatrixLU subroutine).
            Pivots  -   table of permutations which were made during
                        the LU decomposition.
                        Output of RMatrixLU subroutine.
            N       -   size of matrix A.

        Result: matrix determinant.

          -- ALGLIB --
             Copyright 2005 by Bochkanov Sergey
        *************************************************************************/
        public static AP.Complex cmatrixludet(ref AP.Complex[,] a,
            ref int[] pivots,
            int n)
        {
            AP.Complex result = 0;
            int i = 0;
            int s = 0;

            result = 1;
            s = 1;
            for (i = 0; i <= n - 1; i++)
            {
                result = result * a[i, i];
                if (pivots[i] != i)
                {
                    s = -s;
                }
            }
            result = result * s;
            return result;
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:37,代码来源:matdet.cs

示例15: cmatrixgemmf

        /*************************************************************************
        Fast kernel

          -- ALGLIB routine --
             19.01.2010
             Bochkanov Sergey
        *************************************************************************/
        public static bool cmatrixgemmf(int m,
            int n,
            int k,
            AP.Complex alpha,
            ref AP.Complex[,] a,
            int ia,
            int ja,
            int optypea,
            ref AP.Complex[,] b,
            int ib,
            int jb,
            int optypeb,
            AP.Complex beta,
            ref AP.Complex[,] c,
            int ic,
            int jc)
        {
            bool result = new bool();

            result = false;
            return result;
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:29,代码来源:ablasf.cs


注:本文中的AP类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。