Exemplo n.º 1
0
            /*************************************************************************
            Allocation of serializer: real matrix
            *************************************************************************/
            public static void allocrealmatrix(alglib.serializer s,
                double[,] v,
                int n0,
                int n1)
            {
                int i = 0;
                int j = 0;

                if (n0 < 0)
                {
                    n0 = alglib.ap.rows(v);
                }
                if (n1 < 0)
                {
                    n1 = alglib.ap.cols(v);
                }
                s.alloc_entry();
                s.alloc_entry();
                for (i = 0; i <= n0 - 1; i++)
                {
                    for (j = 0; j <= n1 - 1; j++)
                    {
                        s.alloc_entry();
                    }
                }
            }
Exemplo n.º 2
0
 /*************************************************************************
 Allocation of serializer: complex value
 *************************************************************************/
 public static void alloccomplex(alglib.serializer s,
     complex v)
 {
     s.alloc_entry();
     s.alloc_entry();
 }
Exemplo n.º 3
0
            /*************************************************************************
            Allocation of serializer: Integer array
            *************************************************************************/
            public static void allocintegerarray(alglib.serializer s,
                int[] v,
                int n)
            {
                int i = 0;

                if (n < 0)
                {
                    n = alglib.ap.len(v);
                }
                s.alloc_entry();
                for (i = 0; i <= n - 1; i++)
                {
                    s.alloc_entry();
                }
            }
Exemplo n.º 4
0
            /*************************************************************************
            Serializer: allocation

              -- ALGLIB --
                 Copyright 14.03.2011 by Bochkanov Sergey
            *************************************************************************/
            public static void kdtreealloc(alglib.serializer s,
                kdtree tree)
            {

                //
                // Header
                //
                s.alloc_entry();
                s.alloc_entry();

                //
                // Data
                //
                s.alloc_entry();
                s.alloc_entry();
                s.alloc_entry();
                s.alloc_entry();
                apserv.allocrealmatrix(s, tree.xy, -1, -1);
                apserv.allocintegerarray(s, tree.tags, -1);
                apserv.allocrealarray(s, tree.boxmin, -1);
                apserv.allocrealarray(s, tree.boxmax, -1);
                apserv.allocintegerarray(s, tree.nodes, -1);
                apserv.allocrealarray(s, tree.splits, -1);
            }
Exemplo n.º 5
0
            /*************************************************************************
            Serializer: allocation

              -- ALGLIB --
                 Copyright 19.10.2011 by Bochkanov Sergey
            *************************************************************************/
            public static void mlpealloc(alglib.serializer s,
                mlpensemble ensemble)
            {
                s.alloc_entry();
                s.alloc_entry();
                s.alloc_entry();
                apserv.allocrealarray(s, ensemble.weights, -1);
                apserv.allocrealarray(s, ensemble.columnmeans, -1);
                apserv.allocrealarray(s, ensemble.columnsigmas, -1);
                mlpbase.mlpalloc(s, ensemble.network);
            }
Exemplo n.º 6
0
            /*************************************************************************
            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();
                }
            }
Exemplo n.º 7
0
            /*************************************************************************
            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);
            }
Exemplo n.º 8
0
            /*************************************************************************
            Serializer: allocation

              -- ALGLIB --
                 Copyright 02.02.2012 by Bochkanov Sergey
            *************************************************************************/
            public static void rbfalloc(alglib.serializer s,
                rbfmodel model)
            {

                //
                // Header
                //
                s.alloc_entry();
                s.alloc_entry();

                //
                // Data
                //
                s.alloc_entry();
                s.alloc_entry();
                s.alloc_entry();
                s.alloc_entry();
                nearestneighbor.kdtreealloc(s, model.tree);
                apserv.allocrealmatrix(s, model.xc, -1, -1);
                apserv.allocrealmatrix(s, model.wr, -1, -1);
                s.alloc_entry();
                apserv.allocrealmatrix(s, model.v, -1, -1);
            }