Esempio n. 1
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);
            }
Esempio n. 2
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);
            }
Esempio n. 3
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[ap.len(network.hllayersizes) - 1];
                s.alloc_entry();
                s.alloc_entry();
                s.alloc_entry();
                apserv.allocintegerarray(s, network.hllayersizes, -1);
                for(i = 1; i <= 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();
                }
            }
Esempio n. 4
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 = ap.rows(v);
                }
                if(n1 < 0) {
                    n1 = 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();
                    }
                }
            }
Esempio n. 5
0
            /*************************************************************************
            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();
                }
            }
Esempio n. 6
0
 /*************************************************************************
 Allocation of serializer: complex value
 *************************************************************************/
 public static void alloccomplex(alglib.serializer s,
     complex v) {
     s.alloc_entry();
     s.alloc_entry();
 }