Пример #1
0
int main(int argc, char **argv)
{
	InitRand(123);

	auto options = CMDOptions::Create();

	int returnCode = 0;
	try
	{
		PrepareCMDOptions(argc, argv, *options);
		string action = options->getOption("-action");
		if (action == "clustering")
		{
			ClusteringAction(*options);
		}
		else if (action == "metrics")
		{
			MetricsAction(*options);
		}
	}
	catch (int code)
	{
		returnCode = code;
	}

	return returnCode;
}
Пример #2
0
main()
{
	int probleme;

	DataDecrypt();

	if ( DataCheck() != 0 )
		DataClear();

	linea_init();
	hide_mouse();

	probleme = InitTank();

	if ( !probleme ) {
		InitSys();
		_InitSys();
		InitRand((int)*_Hz200 & 0x7FFF);
		ShowLogo();
		MnRoot();
		_TermSys();
		TermSys();
		}

	TermTank(probleme);

	show_mouse(0);

	return (0);
}
Пример #3
0
    EnvironmentDriver::EnvironmentDriver(int argc, char **argv, bool init_options)
    {
      mListenSocket = new Socket();
      mOptions.AddOptions(options);
      if(init_options)
	{
	  mOptions.Initialize(argc, argv);
	  InitRand();
	}
    }
Пример #4
0
MatrSolver::MatrSolver(int size)
{
    InitVars(size);
    InitRand();
    InitMatr();
    SetMtx(matr, b_matr, n);
    PrintMtx(matr, n);
    std::cout << "Матрица В: " << std::endl;
    PrintVector(b_matr, n);
    //Solve();
}
Пример #5
0
void SetupJob ()
{
  AllocArrays ();
  InitRand (randSeed);
  stepCount = 0;
  InitCoords ();
  InitVels ();
  InitAccels ();
  InitAngCoords ();
  InitAngVels ();
  InitAngAccels ();
  AccumProps (0);
  countRdf = 0;
}
Пример #6
0
void Net::InitParams(const mxArray *mx_params) {
  //mexPrintMsg("Start params initialization...");
  params_.Init(mx_params);
  InitRand(params_.seed_);  
  //mexPrintMsg("Params initialization finished");
}
Пример #7
0
/**  InitMoves: initializes the following moves.c-specific stuff: 
 *              - static annealing parameter struct (ap)                   
 *              - static tweak struct (tweak) in translate.c               
 *              - initializes random number generator in lsa.c             
 *              - receives parameter list from Translate, stores nparams   
 *              - initializes acc_tab for acceptance statistics            
 *              - set mixing interval in lsa.c (parallel code only)        
 *                                                                         
 *              it then returns the initial temperature to the caller      
 */
double
InitMoves( FILE * fp, Input * inp ) {
    int i;                      /* local loop counter */

    /* following is used to initialize random number generator() */

    long seedval;               /* contains random number generator seed */

    /*
    int left;
    unsigned short left16;
    unsigned short middle16;
    unsigned short *xsubj;

    xsubj = ( unsigned short * ) calloc( 3, sizeof( unsigned short ) );
*/
    /* read annealing paramters and parameters-to-be-tweaked */

    ap = ReadAParameters( fp ); /* ap: static annealing params */
    ap.max_count = 0;

    if( equil == 1 ) {          /* read equilibration params and put them into lsa.c */
        SetEquilibrate( InitEquilibrate( fp ) );
    }

    /* initialze the random number generator, now dSFMT() */
#ifdef MPI
    seedval = ap.seed + myid;   /* each processor gets a different seed */
#else
    seedval = ap.seed;
#endif

   /* xsubj[0] = LOWBITS;

    middle16 = ( unsigned short ) seedval;
    xsubj[1] = middle16;

    left = seedval >> ( BYTESIZE * sizeof( unsigned short ) );
    left16 = ( unsigned short ) left;
    xsubj[2] = left16;*/

    InitRand( seedval );         /* makes the xsubj array static to lsa.c */

    /* Set up data structure for tweaking */
    nparams = inp->tra.size;    /* nparams is static to moves.c */
    ptab = inp->tra.array;      /* make parameter array static to moves.c */

    /* acc_tab is for statistics like acceptance ratio etc. */

    acc_tab = ( AccStats * ) calloc( nparams, sizeof( AccStats ) );

    for( i = 0; i < nparams; i++ ) {
        acc_tab[i].acc_ratio = 0;
        acc_tab[i].theta_bar = THETA_INIT;
        acc_tab[i].hits = 0;
        acc_tab[i].success = 0;
    }

#ifdef MPI

    /* allocate static arrays for parallel code */

    hits = ( long * ) calloc( nparams, sizeof( long ) );
    success = ( long * ) calloc( nparams, sizeof( long ) );
    tmp = ( long * ) calloc( nparams, sizeof( long ) );

#endif

    /* Finally, return the start temperature. */
    return ap.start_tempr;
}