本文整理汇总了C#中alglib.unserialize_int方法的典型用法代码示例。如果您正苦于以下问题:C# alglib.unserialize_int方法的具体用法?C# alglib.unserialize_int怎么用?C# alglib.unserialize_int使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类alglib
的用法示例。
在下文中一共展示了alglib.unserialize_int方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: kdtreeunserialize
/*************************************************************************
Serializer: unserialization
-- ALGLIB --
Copyright 14.03.2011 by Bochkanov Sergey
*************************************************************************/
public static void kdtreeunserialize(alglib.serializer s,
kdtree tree)
{
int i0 = 0;
int i1 = 0;
//
// check correctness of header
//
i0 = s.unserialize_int();
alglib.ap.assert(i0==scodes.getkdtreeserializationcode(), "KDTreeUnserialize: stream header corrupted");
i1 = s.unserialize_int();
alglib.ap.assert(i1==kdtreefirstversion, "KDTreeUnserialize: stream header corrupted");
//
// Unserialize data
//
tree.n = s.unserialize_int();
tree.nx = s.unserialize_int();
tree.ny = s.unserialize_int();
tree.normtype = s.unserialize_int();
apserv.unserializerealmatrix(s, ref tree.xy);
apserv.unserializeintegerarray(s, ref tree.tags);
apserv.unserializerealarray(s, ref tree.boxmin);
apserv.unserializerealarray(s, ref tree.boxmax);
apserv.unserializeintegerarray(s, ref tree.nodes);
apserv.unserializerealarray(s, ref tree.splits);
kdtreealloctemporaries(tree, tree.n, tree.nx, tree.ny);
}
示例3: 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);
//.........这里部分代码省略.........
示例4: mlpeunserialize
/*************************************************************************
Serializer: unserialization
-- ALGLIB --
Copyright 14.03.2011 by Bochkanov Sergey
*************************************************************************/
public static void mlpeunserialize(alglib.serializer s,
mlpensemble ensemble)
{
int i0 = 0;
int i1 = 0;
//
// check correctness of header
//
i0 = s.unserialize_int();
alglib.ap.assert(i0==scodes.getmlpeserializationcode(), "MLPEUnserialize: stream header corrupted");
i1 = s.unserialize_int();
alglib.ap.assert(i1==mlpefirstversion, "MLPEUnserialize: stream header corrupted");
//
// Create network
//
ensemble.ensemblesize = s.unserialize_int();
apserv.unserializerealarray(s, ref ensemble.weights);
apserv.unserializerealarray(s, ref ensemble.columnmeans);
apserv.unserializerealarray(s, ref ensemble.columnsigmas);
mlpbase.mlpunserialize(s, ensemble.network);
//
// Allocate termoraries
//
ensemble.y = new double[mlpbase.mlpgetoutputscount(ensemble.network)];
}
示例5: unserializerealmatrix
/*************************************************************************
Unserialization: complex value
*************************************************************************/
public static void unserializerealmatrix(alglib.serializer s,
ref double[,] v)
{
int i = 0;
int j = 0;
int n0 = 0;
int n1 = 0;
double t = 0;
v = new double[0,0];
n0 = s.unserialize_int();
n1 = s.unserialize_int();
if( n0==0 | n1==0 )
{
return;
}
v = new double[n0, n1];
for(i=0; i<=n0-1; i++)
{
for(j=0; j<=n1-1; j++)
{
t = s.unserialize_double();
v[i,j] = t;
}
}
}
示例6: unserializeintegerarray
/*************************************************************************
Unserialization: complex value
*************************************************************************/
public static void unserializeintegerarray(alglib.serializer s,
ref int[] v)
{
int n = 0;
int i = 0;
int t = 0;
v = new int[0];
n = s.unserialize_int();
if( n==0 )
{
return;
}
v = new int[n];
for(i=0; i<=n-1; i++)
{
t = s.unserialize_int();
v[i] = t;
}
}
示例7: unserializerealarray
/*************************************************************************
Unserialization: complex value
*************************************************************************/
public static void unserializerealarray(alglib.serializer s,
ref double[] v)
{
int n = 0;
int i = 0;
double t = 0;
v = new double[0];
n = s.unserialize_int();
if( n==0 )
{
return;
}
v = new double[n];
for(i=0; i<=n-1; i++)
{
t = s.unserialize_double();
v[i] = t;
}
}
示例8: rec4serializationunserialize
public static void rec4serializationunserialize(alglib.serializer s,
rec4serialization v)
{
int i = 0;
int k = 0;
bool bv = new bool();
int iv = 0;
double rv = 0;
//
// boolean fields
//
k = s.unserialize_int();
if( k>0 )
{
v.b = new bool[k];
for(i=0; i<=k-1; i++)
{
bv = s.unserialize_bool();
v.b[i] = bv;
}
}
//
// integer fields
//
k = s.unserialize_int();
if( k>0 )
{
v.i = new int[k];
for(i=0; i<=k-1; i++)
{
iv = s.unserialize_int();
v.i[i] = iv;
}
}
//
// real fields
//
k = s.unserialize_int();
if( k>0 )
{
v.r = new double[k];
for(i=0; i<=k-1; i++)
{
rv = s.unserialize_double();
v.r[i] = rv;
}
}
}
示例9: rbfunserialize
/*************************************************************************
Serializer: unserialization
-- ALGLIB --
Copyright 02.02.2012 by Bochkanov Sergey
*************************************************************************/
public static void rbfunserialize(alglib.serializer s,
rbfmodel model)
{
int i0 = 0;
int i1 = 0;
int nx = 0;
int ny = 0;
//
// Header
//
i0 = s.unserialize_int();
alglib.ap.assert(i0==scodes.getrbfserializationcode(), "RBFUnserialize: stream header corrupted");
i1 = s.unserialize_int();
alglib.ap.assert(i1==rbffirstversion, "RBFUnserialize: stream header corrupted");
//
// Unserialize primary model parameters, initialize model.
//
// It is necessary to call RBFCreate() because some internal fields
// which are NOT unserialized will need initialization.
//
nx = s.unserialize_int();
ny = s.unserialize_int();
rbfcreate(nx, ny, model);
model.nc = s.unserialize_int();
model.nl = s.unserialize_int();
nearestneighbor.kdtreeunserialize(s, model.tree);
apserv.unserializerealmatrix(s, ref model.xc);
apserv.unserializerealmatrix(s, ref model.wr);
model.rmax = s.unserialize_double();
apserv.unserializerealmatrix(s, ref model.v);
}