本文整理汇总了C++中FloatArray::Decode方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatArray::Decode方法的具体用法?C++ FloatArray::Decode怎么用?C++ FloatArray::Decode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatArray
的用法示例。
在下文中一共展示了FloatArray::Decode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char *argv[])
{
char *cname="";
char *fname="main()";
Start(&argc,&argv);
VRB.Result(cname,fname,"Starting next configuration.\n");
//Initialize Timing
const int dtime_size=200;
Float dtime[dtime_size];
dtime[0]=dclock();
int chkpoint_no=0;
CommandLine::is(argc,argv);
DoArg do_arg;
EvoArg evo_arg;
QPropWArg qpropw_arg;
/* get parameter from command line */
/* 17 parameters: */
/* x.x
chkpoints (1 to turn checkpoints on, 0 to turn them off)
DIRECTORY do_arg evo_arg mass_list
lat_stand_in lat_stand_out
number (which random gauge to take)
t_src
label id seqNum
logdir
plaquette_gfix_info_dir
midprop_contractions_dir
configs_done_log
gauge_rotated_lats_dir
gauge_rotated_lats_saved_log
*/
int chkpoints(CommandLine::arg_as_int() );
chdir(CommandLine::arg());
if ( !do_arg.Decode(CommandLine::arg(),"do_arg") ) { printf("Bum do_arg\n"); exit(-1);}
if ( !evo_arg.Decode(CommandLine::arg(),"evo_arg") ) { printf("Bum evo_arg\n"); exit(-1);}
if ( !mass_list.Decode(CommandLine::arg(),"mass_list") ) { printf("Bum mass_lilst\n"); exit(-1);}
num_masses = mass_list.Floats.Floats_len;
masses = mass_list.Floats.Floats_val;
do_arg.gfix_chkb=1;
do_arg.cg_reprod_freq=10;
GJP.Initialize(do_arg);
// const int num_nodes=do_arg.x_nodes*do_arg.y_nodes*do_arg.z_nodes*do_arg.t_nodes*do_arg.s_nodes;
const int num_nodes=GJP.Xnodes()*GJP.Ynodes()*GJP.Znodes()*GJP.Tnodes()*GJP.Snodes();
//Checkpoint
if (chkpoints)
chkpt(num_nodes,chkpoint_no,dtime,dtime_size);
char lat_stand_in[200], lat_stand_out[200];
char label[200], id[200];
char logdir[200], plaquette_gfix_info_dir[200], midprop_contractions_dir[200], configs_done_log[200];
char gauge_rotated_lats_dir[200], gauge_rotated_lats_saved_log[200];
sprintf(lat_stand_in, CommandLine::arg() );
sprintf(lat_stand_out, CommandLine::arg() );
int gauge_ran(CommandLine::arg_as_int() );
int t_src(CommandLine::arg_as_int() );
if ( t_src<0 || t_src>=GJP.Sites(3) ) {
printf("t_src must be in the range 0 <= t_src < %d.\n",GJP.Sites(3));
printf("Abort.\n");
return 1;
}
if ( t_src % GJP.TnodeSites() ) {
printf("t_src must be at the beginning of a node since we are shifting\n");
printf("the lattice rather than putting a source at time t_src.\n");
printf("Abort.\n");
return 2;
}
sprintf(label, CommandLine::arg() );
sprintf(id, CommandLine::arg() );
int seqNum(CommandLine::arg_as_int() );
sprintf(logdir, CommandLine::arg() );
sprintf(plaquette_gfix_info_dir, CommandLine::arg() );
sprintf(midprop_contractions_dir, CommandLine::arg() );
sprintf(configs_done_log, CommandLine::arg() );
sprintf(gauge_rotated_lats_dir, CommandLine::arg() );
sprintf(gauge_rotated_lats_saved_log, CommandLine::arg() );
VRB.Result(cname,fname,"This is configuration number %d.\n",seqNum);
//.........这里部分代码省略.........
示例2: main
int main(int argc, char *argv[]){
Start(&argc,&argv);
char plaq_file[256];
char top_file[256];
char pbp_file[256];
char hmc_file[256];
char *cname=argv[0];
char *fname="main()";
Float dtime;
CommonArg common_arg_plaq;
CommonArg common_arg_pbp;
CommonArg common_arg_hmc;
CommonArg common_arg_top;
WspectArg w_spect_arg;
CgArg w_spect_cg_arg;
WspectOutput w_spect_output;
FixGaugeArg w_spect_fg_arg;
if ( argc!=19 ) {
if(!UniqueID()){
printf("Args:\t do_arg.vml hmc_arg.vml evo_arg.vml \n");
printf("\t gauge_arg.vml bsn_arg.vml frm_arg.vml \n");
printf("\t quo_tm_arg.vml quo_arg.vml rat_quo_arg.vml \n");
printf("\t ab1_arg.vml ab2_arg.vml ab3_arg.vml ab4_arg.vml \n");
printf("\t w_spect_arg.vml w_spect_cg_arg.vml w_spect_mass_list.vml \n");
printf("\t pbp_arg.vml current_dir \n");
}
exit(-1);
}
chdir (argv[18]);
// these from Michael (?) and I added one "/"
//gauge_Unload
//gauge_unload
if ( !do_arg.Decode(argv[1],"do_arg") ) {
do_arg.Encode("bum_arg","bum_arg"); printf("Bum do_arg\n"); exit(-1); }
do_arg.Encode("do_arg.dat", "do_arg");
if ( !hmc_arg.Decode(argv[2],"hmc_arg")){printf("Bum hmc_arg\n"); exit(-1);}
hmc_arg.Encode("hmc_arg.dat","hmc_arg");
if ( !evo_arg.Decode(argv[3],"evo_arg")){printf("Bum evo_arg\n"); exit(-1);}
evo_arg.Encode("evo_arg.dat","evo_arg");
if ( !gauge_arg.Decode(argv[4],"gauge_arg")){printf("Bum gauge_arg\n"); exit(-1);}
gauge_arg.Encode("gauge_arg.dat","gauge_arg");
if ( !bsn_arg.Decode(argv[5],"bsn_arg")){printf("Bum bsn_arg\n"); exit(-1);}
bsn_arg.Encode("bsn_arg.dat","bsn_arg");
if ( !frm_arg.Decode(argv[6],"frm_arg")){printf("Bum frm_arg\n"); exit(-1);}
frm_arg.Encode("frm_arg.dat","frm_arg");
if ( !quo_tm_arg.Decode(argv[7],"quo_tm_arg")){printf("Bum quo_tm_arg\n"); exit(-1);}
quo_tm_arg.Encode("quo_tm_arg.dat","quo_tm_arg");
if ( !quo_arg.Decode(argv[8],"quo_arg")){printf("Bum quo_arg\n"); exit(-1);}
quo_arg.Encode("quo_arg.dat","quo_arg");
if ( !rat_quo_arg.Decode(argv[9],"rat_quo_arg")){printf("Bum rat_quo_arg\n"); exit(-1);}
rat_quo_arg.Encode("rat_quo_arg.dat","rat_quo_arg");
if ( !ab1_arg.Decode(argv[10],"ab1_arg")){printf("Bum ab1_arg\n"); exit(-1);}
ab1_arg.Encode("ab1_arg.dat","ab1_arg");
if ( !ab2_arg.Decode(argv[11],"ab2_arg")){printf("Bum ab2_arg\n"); exit(-1);}
ab2_arg.Encode("ab2_arg.dat","ab2_arg");
if ( !ab3_arg.Decode(argv[12],"ab3_arg")){printf("Bum ab3_arg\n"); exit(-1);}
ab3_arg.Encode("ab3_arg.dat","ab3_arg");
if ( !ab4_arg.Decode(argv[13],"ab4_arg")){printf("Bum ab4_arg\n"); exit(-1);}
ab4_arg.Encode("ab4_arg.dat","ab4_arg");
if ( !pbp_arg.Decode(argv[14],"pbp_arg")){printf("Bum pbp_arg\n"); exit(-1);}
pbp_arg.Encode("pbp_arg.dat","pbp_arg");
if ( !w_spect_arg.Decode(argv[15],"w_spect_arg") )
{ printf("Bum w_spect_arg\n"); exit(-1);}
if ( !w_spect_cg_arg.Decode(argv[16],"w_spect_cg_arg") )
{ printf("Bum w_spect_cg_arg\n"); exit(-1);}
if ( !w_spect_mass_list.Decode(argv[17],"w_spect_mass_list") )
{ printf("Bum w_spect_mass_list\n"); exit(-1);}
// ApeSmearArg ape_arg("ape_arg.vml");
ApeSmearArg ape_arg;
if ( !ape_arg.Decode("ape_arg.vml","ape_arg") )
{ printf("Bum ape_arg\n"); exit(-1);}
ape_arg.Encode("ape_arg.dat","ape_arg");
chdir(evo_arg.work_directory);
// do_arg.verbose_level=VERBOSE_RESULT_LEVEL;
GJP.Initialize(do_arg);
//VRB.Level(VERBOSE_FUNC_LEVEL);
VRB.Level(3);
LRG.Initialize();
// Outer config loop
int traj = evo_arg.traj_start;
int w_int = evo_arg.measure_w_spect_interval;
int g_int = evo_arg.gauge_unload_period;
//.........这里部分代码省略.........