• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# alglib类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MultinomialLogitModel

 public MultinomialLogitModel(alglib.logitmodel logitModel, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues)
   : base(targetVariable) {
   this.name = ItemName;
   this.description = ItemDescription;
   this.logitModel = logitModel;
   this.allowedInputVariables = allowedInputVariables.ToArray();
   this.classValues = (double[])classValues.Clone();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:8,代码来源:MultinomialLogitModel.cs


示例2: Decode

        public static List<double> Decode(alglib.complex[] freqSamples, bool needWindow = false)
        {
            
            double[] outSamples;
            alglib.fftr1dinv(freqSamples, out outSamples);

            return outSamples.ToList();
        }
开发者ID:KinTT,项目名称:BeatCare,代码行数:8,代码来源:HammingFFT.cs


示例3: NeuralNetworkModel

 public NeuralNetworkModel(alglib.multilayerperceptron multiLayerPerceptron, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues = null)
   : base(targetVariable) {
   this.name = ItemName;
   this.description = ItemDescription;
   this.multiLayerPerceptron = multiLayerPerceptron;
   this.allowedInputVariables = allowedInputVariables.ToArray();
   if (classValues != null)
     this.classValues = (double[])classValues.Clone();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:9,代码来源:NeuralNetworkModel.cs


示例4: create_RF_signal

 public static void create_RF_signal(alglib.complex[] baseband_signal, double Fd, double duration_of_signal, double Fc, double A, out alglib.complex[] RF_signal, out double[] t)
 {
     int samples = (int)(duration_of_signal * Fd);
     t = new double[samples];
     for (int i = 0; i < t.Length; i++)
     {
         t[i] = i / Fd;
     }
     RF_signal = new alglib.complex[t.Length];
     for (int i = 0; i < t.Length; i++)
     {
         RF_signal[i] = A * baseband_signal[i] * new alglib.complex(Math.Cos(Fc * 2 * Math.PI * t[i]), Math.Sin(Fc * 2 * Math.PI * t[i]));
     }
 }//создание радиосигнала, перенос на несущую
开发者ID:Alekzzz90,项目名称:psk_chirp_wavelet_based_detection,代码行数:14,代码来源:PSK.cs


示例5: NeuralNetworkEnsembleModel

 public NeuralNetworkEnsembleModel(alglib.mlpensemble mlpEnsemble, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues = null)
   : base() {
   this.name = ItemName;
   this.description = ItemDescription;
   this.mlpEnsemble = mlpEnsemble;
   this.targetVariable = targetVariable;
   this.allowedInputVariables = allowedInputVariables.ToArray();
   if (classValues != null)
     this.classValues = (double[])classValues.Clone();
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:10,代码来源:NeuralNetworkEnsembleModel.cs


示例6: convert

 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 /// <returns></returns>
 public static IList<Complex> convert(alglib.complex[] source)
 {
     int count = source.Length;
     IList<Complex> result = new Complex[count];
     for (int i = 0; i < count; i++)
     {
         result[i] = new Complex(source[i].x, source[i].y);
     }
     return result;
 }
开发者ID:wouldyougo,项目名称:EMD,代码行数:15,代码来源:TransformHelper.cs


示例7: splineSmoothFit

    public static void splineSmoothFit(double[] x, double[] y, out alglib.spline1dinterpolant result, double rho = 0.3, int num_bases_functions = 50)
    {
      alglib.spline1dinterpolant s;
      alglib.spline1dfitreport rep;
      int info;

      alglib.spline1dfitpenalized(x, y, num_bases_functions, rho, out info, out s, out rep);

      result = s;
    }
开发者ID:heimanhon,项目名称:researchwork,代码行数:10,代码来源:splineSmoothWrapper.cs


示例8: generate_mixed_chirp_signal

        }//добавление АБГШ
        public static void generate_mixed_chirp_signal(int chirp_num, double duration_of_signal, double Fd, double[] Fmin, double[] Fmax, double[] init_phase, double[] A, out double[] t, out alglib.complex[] mixed_signal)//Амплитуды в децибелах
        {
            t = new double[(int)(duration_of_signal * Fd)];
            mixed_signal = new alglib.complex[(int)(duration_of_signal * Fd)];
            alglib.complex[] noise = create_AWGN(mixed_signal.Length);
            for (int i = 0; i < chirp_num; i++)
            {
                alglib.complex[] signal = chirp(Fmin[i], Fmax[i], Fd, duration_of_signal);
                double coeff = get_null_dB_mag(signal, noise, Fmin[i], Fmax[i], Fd);
                double new_coeff = Math.Sqrt(coeff * coeff * Math.Pow(10, A[i] / 10.0));
                for (int j = 0; j < signal.Length; j++)
                {
                    mixed_signal[j] += new_coeff * signal[j];
                }

               
                /* double noiseE = 0;
                 foreach (alglib.complex n in noise)
                 {
                     noiseE += Math.Pow(alglib.math.abscomplex(n), 2);
                 }
                 noiseE = noiseE * (Fmax[i] - Fmin[i]) / Fd;

                 double signalE = 0;
                 for (int j = 0; j < signal.Length; j++)
                 {
                     signalE += Math.Pow(alglib.math.abscomplex(new_coeff * signal[j]), 2);
                 }
                 double SNR =10* Math.Log10(signalE / noiseE) ;*/
            }

       /*   double E_sig = 0;
            foreach (alglib.complex val in mixed_signal)
            {
                E_sig += Math.Pow(alglib.math.abscomplex(val),2);

            }
            double E_noise = 0;
            foreach (alglib.complex val in noise)
            {
                E_noise += Math.Pow(alglib.math.abscomplex(val),2);

            }
            double SNR = 10 * Math.Log10(E_sig / E_noise);*/
            for (int j = 0; j < mixed_signal.Length; j++)
            {
                mixed_signal[j] += noise[j];
                t[j] = j / Fd;
            }

        }
开发者ID:Alekzzz90,项目名称:psk_chirp_wavelet_based_detection,代码行数:52,代码来源:chirp.cs


示例9: get_null_dB_mag

 public static double get_null_dB_mag(alglib.complex[] signal, alglib.complex[] noise, double Fmin, double Fmax, double Fd)//получения амплитуды сигнала соотвествующей SNR=0, 
 {
     double signal_mag = 0;
     //int i_start = (int)(Fmin * (signal.Length - 1) / Fd);
     //int i_end = (int)Math.Ceiling(Fmax * (signal.Length - 1) / Fd);
      for (int i = 0; i < signal.Length; i++)
      {
          signal_mag += Math.Pow(alglib.math.abscomplex(signal[i]), 2);
      }
     /*for (int i = i_start; i <= i_end; i++)
     {
         signal_mag += Math.Pow(alglib.math.abscomplex(signal[i]), 2);
     }*/
     double noise_mag = 0;
     for (int i = 0; i < noise.Length; i++)
     {
         noise_mag += Math.Pow(alglib.math.abscomplex(noise[i]), 2);
     }
     noise_mag = noise_mag * (Fmax - Fmin) / Fd;
     double coeff = noise_mag / signal_mag;
     return Math.Sqrt(coeff);
 }//добавление АБГШ
开发者ID:Alekzzz90,项目名称:psk_chirp_wavelet_based_detection,代码行数:22,代码来源:chirp.cs


示例10: kdtreeserialize

        /*************************************************************************
        Serializer: serialization

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void kdtreeserialize(alglib.serializer s,
            kdtree tree)
        {
            
            //
            // Header
            //
            s.serialize_int(scodes.getkdtreeserializationcode());
            s.serialize_int(kdtreefirstversion);
            
            //
            // Data
            //
            s.serialize_int(tree.n);
            s.serialize_int(tree.nx);
            s.serialize_int(tree.ny);
            s.serialize_int(tree.normtype);
            apserv.serializerealmatrix(s, tree.xy, -1, -1);
            apserv.serializeintegerarray(s, tree.tags, -1);
            apserv.serializerealarray(s, tree.boxmin, -1);
            apserv.serializerealarray(s, tree.boxmax, -1);
            apserv.serializeintegerarray(s, tree.nodes, -1);
            apserv.serializerealarray(s, tree.splits, -1);
        }
开发者ID:Junaid-Akram,项目名称:5271-Keystroke-Dynamics,代码行数:30,代码来源:alglibmisc.cs


示例11: dfunserialize

        /*************************************************************************
        Serializer: unserialization

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void dfunserialize(alglib.serializer s,
            decisionforest forest)
        {
            int i0 = 0;
            int i1 = 0;

            
            //
            // check correctness of header
            //
            i0 = s.unserialize_int();
            alglib.ap.assert(i0==scodes.getrdfserializationcode(), "DFUnserialize: stream header corrupted");
            i1 = s.unserialize_int();
            alglib.ap.assert(i1==dffirstversion, "DFUnserialize: stream header corrupted");
            
            //
            // Unserialize data
            //
            forest.nvars = s.unserialize_int();
            forest.nclasses = s.unserialize_int();
            forest.ntrees = s.unserialize_int();
            forest.bufsize = s.unserialize_int();
            apserv.unserializerealarray(s, ref forest.trees);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:30,代码来源:dataanalysis.cs


示例12: dfalloc

        /*************************************************************************
        Serializer: allocation

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void dfalloc(alglib.serializer s,
            decisionforest forest)
        {
            s.alloc_entry();
            s.alloc_entry();
            s.alloc_entry();
            s.alloc_entry();
            s.alloc_entry();
            s.alloc_entry();
            apserv.allocrealarray(s, forest.trees, forest.bufsize);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:17,代码来源:dataanalysis.cs


示例13: mlpeserialize

        /*************************************************************************
        Serializer: serialization

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void mlpeserialize(alglib.serializer s,
            mlpensemble ensemble)
        {
            s.serialize_int(scodes.getmlpeserializationcode());
            s.serialize_int(mlpefirstversion);
            s.serialize_int(ensemble.ensemblesize);
            apserv.serializerealarray(s, ensemble.weights, -1);
            apserv.serializerealarray(s, ensemble.columnmeans, -1);
            apserv.serializerealarray(s, ensemble.columnsigmas, -1);
            mlpbase.mlpserialize(s, ensemble.network);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:17,代码来源:dataanalysis.cs


示例14: mlpunserialize

        /*************************************************************************
        Serializer: unserialization

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void mlpunserialize(alglib.serializer s,
            multilayerperceptron network)
        {
            int i0 = 0;
            int i1 = 0;
            int i = 0;
            int j = 0;
            int k = 0;
            int fkind = 0;
            double threshold = 0;
            double v0 = 0;
            double v1 = 0;
            int nin = 0;
            int nout = 0;
            bool issoftmax = new bool();
            int[] layersizes = new int[0];

            
            //
            // check correctness of header
            //
            i0 = s.unserialize_int();
            alglib.ap.assert(i0==scodes.getmlpserializationcode(), "MLPUnserialize: stream header corrupted");
            i1 = s.unserialize_int();
            alglib.ap.assert(i1==mlpfirstversion, "MLPUnserialize: stream header corrupted");
            
            //
            // Create network
            //
            issoftmax = s.unserialize_bool();
            apserv.unserializeintegerarray(s, ref layersizes);
            alglib.ap.assert((alglib.ap.len(layersizes)==2 || alglib.ap.len(layersizes)==3) || alglib.ap.len(layersizes)==4, "MLPUnserialize: too many hidden layers!");
            nin = layersizes[0];
            nout = layersizes[alglib.ap.len(layersizes)-1];
            if( alglib.ap.len(layersizes)==2 )
            {
                if( issoftmax )
                {
                    mlpcreatec0(layersizes[0], layersizes[1], network);
                }
                else
                {
                    mlpcreate0(layersizes[0], layersizes[1], network);
                }
            }
            if( alglib.ap.len(layersizes)==3 )
            {
                if( issoftmax )
                {
                    mlpcreatec1(layersizes[0], layersizes[1], layersizes[2], network);
                }
                else
                {
                    mlpcreate1(layersizes[0], layersizes[1], layersizes[2], network);
                }
            }
            if( alglib.ap.len(layersizes)==4 )
            {
                if( issoftmax )
                {
                    mlpcreatec2(layersizes[0], layersizes[1], layersizes[2], layersizes[3], network);
                }
                else
                {
                    mlpcreate2(layersizes[0], layersizes[1], layersizes[2], layersizes[3], network);
                }
            }
            
            //
            // Load neurons and weights
            //
            for(i=1; i<=alglib.ap.len(layersizes)-1; i++)
            {
                for(j=0; j<=layersizes[i]-1; j++)
                {
                    fkind = s.unserialize_int();
                    threshold = s.unserialize_double();
                    mlpsetneuroninfo(network, i, j, fkind, threshold);
                    for(k=0; k<=layersizes[i-1]-1; k++)
                    {
                        v0 = s.unserialize_double();
                        mlpsetweight(network, i-1, k, i, j, v0);
                    }
                }
            }
            
            //
            // Load standartizator
            //
            for(j=0; j<=nin-1; j++)
            {
                v0 = s.unserialize_double();
                v1 = s.unserialize_double();
                mlpsetinputscaling(network, j, v0, v1);
//.........这里部分代码省略.........
开发者ID:lgatto,项目名称:proteowizard,代码行数:101,代码来源:dataanalysis.cs


示例15: mlpalloc

        /*************************************************************************
        Serializer: allocation

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void mlpalloc(alglib.serializer s,
            multilayerperceptron network)
        {
            int i = 0;
            int j = 0;
            int k = 0;
            int fkind = 0;
            double threshold = 0;
            double v0 = 0;
            double v1 = 0;
            int nin = 0;
            int nout = 0;

            nin = network.hllayersizes[0];
            nout = network.hllayersizes[alglib.ap.len(network.hllayersizes)-1];
            s.alloc_entry();
            s.alloc_entry();
            s.alloc_entry();
            apserv.allocintegerarray(s, network.hllayersizes, -1);
            for(i=1; i<=alglib.ap.len(network.hllayersizes)-1; i++)
            {
                for(j=0; j<=network.hllayersizes[i]-1; j++)
                {
                    mlpgetneuroninfo(network, i, j, ref fkind, ref threshold);
                    s.alloc_entry();
                    s.alloc_entry();
                    for(k=0; k<=network.hllayersizes[i-1]-1; k++)
                    {
                        s.alloc_entry();
                    }
                }
            }
            for(j=0; j<=nin-1; j++)
            {
                mlpgetinputscaling(network, j, ref v0, ref v1);
                s.alloc_entry();
                s.alloc_entry();
            }
            for(j=0; j<=nout-1; j++)
            {
                mlpgetoutputscaling(network, j, ref v0, ref v1);
                s.alloc_entry();
                s.alloc_entry();
            }
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:51,代码来源:dataanalysis.cs


示例16: serializecomplex

 /*************************************************************************
 Serialization: complex value
 *************************************************************************/
 public static void serializecomplex(alglib.serializer s,
     complex v)
 {
     s.serialize_double(v.x);
     s.serialize_double(v.y);
 }
开发者ID:Ring-r,项目名称:opt,代码行数:9,代码来源:alglibinternal.cs


示例17: unserializecomplex

        /*************************************************************************
        Unserialization: complex value
        *************************************************************************/
        public static complex unserializecomplex(alglib.serializer s)
        {
            complex result = 0;

            result.x = s.unserialize_double();
            result.y = s.unserialize_double();
            return result;
        }
开发者ID:Ring-r,项目名称:opt,代码行数:11,代码来源:alglibinternal.cs


示例18: allocintegerarray

        /*************************************************************************
        Allocation of serializer: Integer array
        *************************************************************************/
        public static void allocintegerarray(alglib.serializer s,
            int[] v,
            int n)
        {
            int i = 0;

            if( n<0 )
            {
                n = ap.len(v);
            }
            s.alloc_entry();
            for(i=0; i<=n-1; i++)
            {
                s.alloc_entry();
            }
        }
开发者ID:Ring-r,项目名称:opt,代码行数:19,代码来源:alglibinternal.cs


示例19: mlpserialize

        /*************************************************************************
        Serializer: serialization

          -- ALGLIB --
             Copyright 14.03.2011 by Bochkanov Sergey
        *************************************************************************/
        public static void mlpserialize(alglib.serializer s,
            multilayerperceptron network)
        {
            int i = 0;
            int j = 0;
            int k = 0;
            int fkind = 0;
            double threshold = 0;
            double v0 = 0;
            double v1 = 0;
            int nin = 0;
            int nout = 0;

            nin = network.hllayersizes[0];
            nout = network.hllayersizes[alglib.ap.len(network.hllayersizes)-1];
            s.serialize_int(scodes.getmlpserializationcode());
            s.serialize_int(mlpfirstversion);
            s.serialize_bool(mlpissoftmax(network));
            apserv.serializeintegerarray(s, network.hllayersizes, -1);
            for(i=1; i<=alglib.ap.len(network.hllayersizes)-1; i++)
            {
                for(j=0; j<=network.hllayersizes[i]-1; j++)
                {
                    mlpgetneuroninfo(network, i, j, ref fkind, ref threshold);
                    s.serialize_int(fkind);
                    s.serialize_double(threshold);
                    for(k=0; k<=network.hllayersizes[i-1]-1; k++)
                    {
                        s.serialize_double(mlpgetweight(network, i-1, k, i, j));
                    }
                }
            }
            for(j=0; j<=nin-1; j++)
            {
                mlpgetinputscaling(network, j, ref v0, ref v1);
                s.serialize_double(v0);
                s.serialize_double(v1);
            }
            for(j=0; j<=nout-1; j++)
            {
                mlpgetoutputscaling(network, j, ref v0, ref v1);
                s.serialize_double(v0);
                s.serialize_double(v1);
            }
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:51,代码来源:dataanalysis.cs


示例20: serializeintegerarray

        /*************************************************************************
        Serialization: Integer array
        *************************************************************************/
        public static void serializeintegerarray(alglib.serializer s,
            int[] v,
            int n)
        {
            int i = 0;

            if( n<0 )
            {
                n = ap.len(v);
            }
            s.serialize_int(n);
            for(i=0; i<=n-1; i++)
            {
                s.serialize_int(v[i]);
            }
        }
开发者ID:Ring-r,项目名称:opt,代码行数:19,代码来源:alglibinternal.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# android类代码示例发布时间:2022-05-24
下一篇:
C# agsXMPP类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap