示例#1
0
///////////////////////////////////////////////////////////////////////////////
//
// JCCoordinator
//
///////////////////////////////////////////////////////////////////////////////
JCCoordinator::JCCoordinator(boost::uuids::uuid weights_id, Project* project, const std::vector<GdaVarTools::VarInfo>& var_info_s, const std::vector<int>& col_ids)
: w_man_state(project->GetWManState()),
w_man_int(project->GetWManInt()),
w_id(weights_id),
num_obs(project->GetNumRecords()),
permutations(999),
var_info(var_info_s),
data(var_info_s.size()),
undef_data(var_info_s.size()),
last_seed_used(123456789), reuse_last_seed(true)
{
    reuse_last_seed = GdaConst::use_gda_user_seed;
    if ( GdaConst::use_gda_user_seed) {
        last_seed_used = GdaConst::gda_user_seed;
    }
	TableInterface* table_int = project->GetTableInt();
	for (int i=0; i<var_info.size(); i++) {
		table_int->GetColData(col_ids[i], data[i]);
        table_int->GetColUndefined(col_ids[i], undef_data[i]);
	}
    num_vars = var_info.size();
	weight_name = w_man_int->GetLongDispName(w_id);
    weights = w_man_int->GetGal(w_id);
	SetSignificanceFilter(1);
    
	InitFromVarInfo();
	
	w_man_state->registerObserver(this);
}
示例#2
0
LisaCoordinator::LisaCoordinator(boost::uuids::uuid weights_id,
                         Project* project,
                         const std::vector<GdaVarTools::VarInfo>& var_info_s,
                         const std::vector<int>& col_ids,
                         LisaType lisa_type_s,
                         bool calc_significances_s,
                         bool row_standardize_s)
: w_man_state(project->GetWManState()),
w_man_int(project->GetWManInt()),
w_id(weights_id),
num_obs(project->GetNumRecords()),
permutations(999),
lisa_type(lisa_type_s),
calc_significances(calc_significances_s),
isBivariate(lisa_type_s == bivariate),
var_info(var_info_s),
data(var_info_s.size()),
last_seed_used(0), reuse_last_seed(false),
row_standardize(row_standardize_s)
{
    
    LOG_MSG("Entering LisaCoordinator::LisaCoordinator(..)");
	GalWeight* gw = w_man_int->GetGal(w_id);
	W = (gw ? gw->gal : 0);
	weight_name = w_man_int->GetLongDispName(w_id);
	SetSignificanceFilter(1);
    
	TableInterface* table_int = project->GetTableInt();
	for (int i=0; i<var_info.size(); i++) {
		table_int->GetColData(col_ids[i], data[i]);
	}
    
	InitFromVarInfo();
	w_man_state->registerObserver(this);
    LOG_MSG("Exiting LisaCoordinator::LisaCoordinator(..)");
}