Commit d7779bf1 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Update operator slots to have seperate ones for comparision

Remove all possible overlaps
parent 9f347d18
......@@ -234,36 +234,30 @@ void FeatureSpace::generate_feature_space(std::vector<double>& prop)
std::vector<int> del_inds;
_mpi_comm->barrier();
#pragma omp parallel
node_value_arrs::clear_temp_reg();
for(int sc = 0; sc < _scores.size() - 1; ++sc)
{
std::vector<int> del_inds_private;
#pragma omp for schedule(dynamic)
for(int sc = 0; sc < _scores.size() - 1; ++sc)
if(_scores[inds[sc]] > -1e-10)
{
if(_scores[inds[sc]] > -1e-10)
double base_val = std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(), _phi[_start_gen.back() + inds[sc]]->value_ptr(), _n_samp));
for(int sc2 = sc + 1; sc2 < _scores.size(); ++sc2)
{
for(int sc2 = sc + 1; sc2 < _scores.size(); ++sc2)
if(std::abs(base_val - std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(), _phi[_start_gen.back() + inds[sc2]]->value_ptr(0, true), _n_samp))) < 1e-13)
{
if(std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(0), _phi[_start_gen.back() + inds[sc]]->value_ptr(1), _n_samp) - std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(0), _phi[_start_gen.back() + inds[sc2]]->value_ptr(1), _n_samp))) < 1e-13)
{
del_inds_private.push_back(-1 * (inds[sc] + _start_gen.back()));
break;
}
del_inds.push_back(-1 * (inds[sc] + _start_gen.back()));
break;
}
}
else if(_scores[inds[sc + 1]] - _scores[inds[sc]] < 1e-10)
{
if(std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(0), _phi[_start_gen.back() + inds[sc]]->value_ptr(1), _n_samp) - std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(0), _phi[_start_gen.back() + inds[sc + 1]]->value_ptr(1), _n_samp))) < 1e-13)
del_inds_private.push_back(-1 * (inds[sc] + _start_gen.back()));
}
}
#pragma omp critical
del_inds.insert(del_inds.end(), del_inds_private.begin(), del_inds_private.end());
else if(_scores[inds[sc + 1]] - _scores[inds[sc]] < 1e-10)
{
double base_val = std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(), _phi[_start_gen.back() + inds[sc]]->value_ptr(), _n_samp));
if(std::abs(base_val - std::abs(util_funcs::r(_phi[_start_gen.back() + inds[sc]]->value_ptr(), _phi[_start_gen.back() + inds[sc + 1]]->value_ptr(0, true), _n_samp))) < 1e-13)
del_inds.push_back(-1 * (inds[sc] + _start_gen.back()));
}
}
inds = util_funcs::argsort(del_inds);
for(int ii = 0; ii < inds.size(); ++ii)
_phi.erase(_phi.begin() - del_inds[inds[ii]]);
......@@ -271,6 +265,8 @@ void FeatureSpace::generate_feature_space(std::vector<double>& prop)
for(int ff = _start_gen.back(); ff < _phi.size(); ++ff)
_phi[ff]->reindex(ff);
}
node_value_arrs::clear_temp_reg();
if(nn <= _n_rung_store)
{
node_value_arrs::resize_values_arr(nn, _phi.size(), (nn != _max_phi));
......@@ -472,14 +468,14 @@ void FeatureSpace::project_generated(double* prop, int size, std::vector<node_pt
if(scores_sel_private.size() == _n_sis_select)
{
generated_phi[inds[ii]]->reindex(node_value_arrs::N_STORE_FEATURES + worst_score_ind + _n_sis_select * (omp_get_thread_num() + _mpi_comm->size()));
// generated_phi[inds[ii]]->set_value();
generated_phi[inds[ii]]->set_value();
phi_sel_private[worst_score_ind] = generated_phi[inds[ii]];
scores_sel_private[worst_score_ind] = cur_score;
}
else
{
generated_phi[inds[ii]]->reindex(node_value_arrs::N_STORE_FEATURES + scores_sel_private.size() + _n_sis_select * (omp_get_thread_num() + _mpi_comm->size()));
// generated_phi[inds[ii]]->set_value();
generated_phi[inds[ii]]->set_value();
phi_sel_private.push_back(generated_phi[inds[ii]]);
scores_sel_private.push_back(cur_score);
}
......@@ -494,7 +490,7 @@ void FeatureSpace::project_generated(double* prop, int size, std::vector<node_pt
worst_score_ind = std::max_element(scores_sel.begin(), scores_sel.end()) - scores_sel.begin();
for(int sc = 0; sc < scores_sel_private.size(); ++sc)
{
if(((phi_sel.size() < _n_sis_select) || (scores_sel_private[sc] < scores_sel[worst_score_ind])) && _is_valid_feat_list(phi_sel_private[sc]->value_ptr(0), _n_samp, _cross_cor_max, phi_sel, scores_sel, scores_sel_private[sc]))
if(((phi_sel.size() < _n_sis_select) || (scores_sel_private[sc] < scores_sel[worst_score_ind])) && _is_valid_feat_list(phi_sel_private[sc]->value_ptr(), _n_samp, _cross_cor_max, phi_sel, scores_sel, scores_sel_private[sc]))
{
if(phi_sel.size() == _n_sis_select)
......@@ -592,7 +588,6 @@ void FeatureSpace::sis(std::vector<double>& prop)
{
phi_sel.resize(cur_feat_local);
scores_sel.resize(cur_feat_local);
node_ptr test_feat = phi_sel[0];
project_generated(prop.data(), prop.size(), phi_sel, scores_sel);
......@@ -640,7 +635,9 @@ void FeatureSpace::sis(std::vector<double>& prop)
{
sent_phi[inds[ii]]->set_value();
out_file_stream << std::setw(14) <<std::left << cur_feat + cur_feat_local << sent_phi[inds[ii]]->postfix_expr() << std::endl;
sum_file_stream << std::setw(14) <<std::left << cur_feat + cur_feat_local << std::setw(24) << std::setprecision(18) << std::left << -1 * sent_scores[inds[ii]] << sent_phi[inds[ii]]->expr() << std::endl;
// sum_file_stream << std::setw(14) <<std::left << cur_feat + cur_feat_local << std::setw(24) << std::setprecision(18) << std::left << -1 * sent_scores[inds[ii]] << '\t' << sent_phi[inds[ii]]->value_ptr()[0] << '\t' << sent_phi[inds[ii]]->feat(0)->value_ptr()[0] << '\t' << sent_phi[inds[ii]]->feat(0)->selected() << '\t' << sent_phi[inds[ii]]->feat(0)->arr_ind() << '\t' << node_value_arrs::N_STORE_FEATURES << sent_phi[inds[ii]]->feat(0)->expr() << '\t' << sent_phi[inds[ii]]->expr() << std::endl;
sum_file_stream << std::setw(14) <<std::left << cur_feat + cur_feat_local << std::setw(18) << std::setprecision(12) << std::left << -1 * sent_scores[inds[ii]] << sent_phi[inds[ii]]->expr() << std::endl;
_phi_selected.push_back(sent_phi[inds[ii]]);
......
......@@ -167,7 +167,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline void set_value(int offset=0){std::copy_n(_value.data(), _n_samp, value_ptr());}
inline void set_value(int offset=0, bool for_comp=false){std::copy_n(_value.data(), _n_samp, value_ptr());}
// DocString: feat_node_set_test_value
/**
......@@ -175,7 +175,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline void set_test_value(int offset=0){if(!_selected) std::copy_n(_test_value.data(), _n_test_samp, test_value_ptr());}
inline void set_test_value(int offset=0, bool for_comp=false){if(!_selected) std::copy_n(_test_value.data(), _n_test_samp, test_value_ptr());}
// DocString: feat_node_is_nan
/**
......@@ -199,14 +199,14 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline double* value_ptr(int offset=0){return _selected ? node_value_arrs::get_d_matrix_ptr(_d_mat_ind) : node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, 0, offset);}
inline double* value_ptr(int offset=0, bool for_comp=false){return _selected ? node_value_arrs::get_d_matrix_ptr(_d_mat_ind) : node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, 0, offset, for_comp);}
/**
* @brief The pointer to where the feature's test data is stored
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline double* test_value_ptr(int offset=0){return node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, 0, offset);}
inline double* test_value_ptr(int offset=0, bool for_comp=false){return node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, 0, offset, for_comp);}
// DocString: feat_node_rung
......
......@@ -116,7 +116,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline void set_value(int offset=0){return;}
inline void set_value(int offset=0, bool for_comp=false){return;}
// DocString: model_node_set_test_value
/**
......@@ -124,7 +124,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline void set_test_value(int offset=0){return;}
inline void set_test_value(int offset=0, bool for_comp=false){return;}
// DocString: model_node_is_nan
/**
......@@ -148,14 +148,14 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline double* value_ptr(int offset=0){return _value.data();}
inline double* value_ptr(int offset=0, bool for_comp=false){return _value.data();}
/**
* @brief The pointer to where the feature's test data is stored
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
inline double* test_value_ptr(int offset=0){return _test_value.data();}
inline double* test_value_ptr(int offset=0, bool for_comp=false){return _test_value.data();}
// DocString: model_node_rung
/**
......
......@@ -225,14 +225,14 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
virtual void set_value(int offset=0) = 0;
virtual void set_value(int offset=0, bool for_comp=false) = 0;
/**
* @brief The pointer to where the feature's training data is stored
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
virtual double* value_ptr(int offset=0) = 0;
virtual double* value_ptr(int offset=0, bool for_comp=false) = 0;
// DocString: node_set_test_value
/**
......@@ -240,14 +240,14 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
virtual void set_test_value(int offset=0) = 0;
virtual void set_test_value(int offset=0, bool for_comp=false) = 0;
/**
* @brief The pointer to where the feature's test data is stored
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
virtual double* test_value_ptr(int offset=0) = 0;
virtual double* test_value_ptr(int offset=0, bool for_comp=false) = 0;
// DocString: node_is_nan
/**
......
......@@ -143,7 +143,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
virtual void set_value(int offset=0) = 0;
virtual void set_value(int offset=0, bool for_comp=false) = 0;
// DocString: op_node_set_test_value
/**
......@@ -151,7 +151,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
virtual void set_test_value(int offset=0) = 0;
virtual void set_test_value(int offset=0, bool for_comp=false) = 0;
/**
* @brief Get the pointer to the feature's training data
......@@ -161,17 +161,17 @@ public:
*
* @return pointer to the feature's training value
*/
double* value_ptr(int offset=0)
double* value_ptr(int offset=0, bool for_comp=false)
{
if(_selected)
return node_value_arrs::get_d_matrix_ptr(_d_mat_ind);
if((rung() > node_value_arrs::N_RUNGS_STORED) && (node_value_arrs::temp_storage_reg(_arr_ind, rung(), offset) != _feat_ind))
if((rung() > node_value_arrs::N_RUNGS_STORED) && (node_value_arrs::temp_storage_reg(_arr_ind, rung(), offset, for_comp) != _feat_ind))
{
set_value(offset);
set_value(offset, for_comp);
}
return node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset);
return node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp);
}
/**
......@@ -182,14 +182,14 @@ public:
*
* @return pointer to the feature's test values
*/
double* test_value_ptr(int offset=0)
double* test_value_ptr(int offset=0, bool for_comp=false)
{
if((rung() > node_value_arrs::N_RUNGS_STORED) && (node_value_arrs::temp_storage_test_reg(_arr_ind, rung(), offset) != _feat_ind))
if((rung() > node_value_arrs::N_RUNGS_STORED) && (node_value_arrs::temp_storage_test_reg(_arr_ind, rung(), offset, for_comp) != _feat_ind))
{
set_test_value(offset);
set_test_value(offset, for_comp);
}
return node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset);
return node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp);
}
// DocString: op_node_is_nan
......
......@@ -63,15 +63,15 @@ void AbsNode::update_div_mult_leaves(std::map<std::string, double>& div_mult_lea
expected_abs_tot += std::abs(fact);
}
void AbsNode::set_value(int offset)
void AbsNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::abs(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::abs(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::abs(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::abs(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void AbsNode::set_test_value(int offset)
void AbsNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::abs(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::abs(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -86,7 +86,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: abs_node_set_test_value
/**
......@@ -94,7 +94,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);
void set_test_value(int offset=0, bool for_comp=false);
// DocString: abs_node_rung
/**
......
......@@ -84,15 +84,15 @@ void AbsDiffNode::update_div_mult_leaves(std::map<std::string, double>& div_mult
expected_abs_tot += std::abs(fact);
}
void AbsDiffNode::set_value(int offset)
void AbsDiffNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::abs_diff(_n_samp, _feats[0]->value_ptr(2 * offset), _feats[1]->value_ptr(2 * offset + 1), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::abs_diff(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), _feats[1]->value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::abs_diff(_n_samp, _feats[0]->value_ptr(2 * offset), _feats[1]->value_ptr(2 * offset + 1), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::abs_diff(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), _feats[1]->value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void AbsDiffNode::set_test_value(int offset)
void AbsDiffNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::abs_diff(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), _feats[1]->test_value_ptr(2 * offset + 1), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::abs_diff(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), _feats[1]->test_value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -89,7 +89,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: abs_diff_node_set_test_value
/**
......@@ -97,7 +97,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);
void set_test_value(int offset=0, bool for_comp=false);
// DocString: abs_diff_node_rung
/**
......
......@@ -77,15 +77,15 @@ void AddNode::update_div_mult_leaves(std::map<std::string, double>& div_mult_lea
expected_abs_tot += std::abs(fact);
}
void AddNode::set_value(int offset)
void AddNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::add(_n_samp, _feats[0]->value_ptr(2 * offset), _feats[1]->value_ptr(2 * offset + 1), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::add(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), _feats[1]->value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::add(_n_samp, _feats[0]->value_ptr(2 * offset), _feats[1]->value_ptr(2 * offset + 1), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::add(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), _feats[1]->value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void AddNode::set_test_value(int offset)
void AddNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::add(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), _feats[1]->test_value_ptr(2 * offset + 1), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::add(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), _feats[1]->test_value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -86,7 +86,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: add_node_set_test_value
/**
......@@ -94,7 +94,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);
void set_test_value(int offset=0, bool for_comp=false);
// DocString: add_node_rung
/**
......
......@@ -53,14 +53,14 @@ void CbNode::update_div_mult_leaves(std::map<std::string, double>& div_mult_leav
_feats[0]->update_div_mult_leaves(div_mult_leaves, fact * 3.0, expected_abs_tot);
}
void CbNode::set_value(int offset)
void CbNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::cb(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::cb(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::cb(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::cb(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void CbNode::set_test_value(int offset)
void CbNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::cb(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::cb(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -84,7 +84,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: cb_node_set_test_value
/**
......@@ -92,7 +92,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);
void set_test_value(int offset=0, bool for_comp=false);
// DocString: cb_node_rung
/**
......
......@@ -52,15 +52,15 @@ void CbrtNode::update_div_mult_leaves(std::map<std::string, double>& div_mult_le
_feats[0]->update_div_mult_leaves(div_mult_leaves, fact / 3.0, expected_abs_tot);
}
void CbrtNode::set_value(int offset)
void CbrtNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::cbrt(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::cbrt(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::cbrt(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::cbrt(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void CbrtNode::set_test_value(int offset)
void CbrtNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::cbrt(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::cbrt(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -84,7 +84,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: cbrt_node_set_test_value
/**
......@@ -92,7 +92,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);
void set_test_value(int offset=0, bool for_comp=false);
// DocString: cbrt_node_rung
/**
......
......@@ -58,15 +58,15 @@ void CosNode::update_div_mult_leaves(std::map<std::string, double>& div_mult_lea
expected_abs_tot += std::abs(fact);
}
void CosNode::set_value(int offset)
void CosNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::cos(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::cos(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::cos(_n_samp, _feats[0]->value_ptr(2 * offset), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::cos(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void CosNode::set_test_value(int offset)
void CosNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::cos(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::cos(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -84,7 +84,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: cos_node_set_test_value
/**
......@@ -92,7 +92,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);
void set_test_value(int offset=0, bool for_comp=false);
// DocString: cos_node_rung
/**
......
......@@ -78,15 +78,15 @@ void DivNode::update_div_mult_leaves(std::map<std::string, double>& div_mult_lea
_feats[1]->update_div_mult_leaves(div_mult_leaves, -1.0*fact, expected_abs_tot);
}
void DivNode::set_value(int offset)
void DivNode::set_value(int offset, bool for_comp)
{
if(_selected)
allowed_op_funcs::div(_n_samp, _feats[0]->value_ptr(2 * offset), _feats[1]->value_ptr(2 * offset + 1), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::div(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), _feats[1]->value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_d_matrix_ptr(_d_mat_ind));
allowed_op_funcs::div(_n_samp, _feats[0]->value_ptr(2 * offset), _feats[1]->value_ptr(2 * offset + 1), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::div(_n_samp, _feats[0]->value_ptr(2 * offset, for_comp), _feats[1]->value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
void DivNode::set_test_value(int offset)
void DivNode::set_test_value(int offset, bool for_comp)
{
allowed_op_funcs::div(_n_test_samp, _feats[0]->test_value_ptr(2 * offset), _feats[1]->test_value_ptr(2 * offset + 1), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset));
allowed_op_funcs::div(_n_test_samp, _feats[0]->test_value_ptr(2 * offset, for_comp), _feats[1]->test_value_ptr(2 * offset + 1, for_comp), node_value_arrs::get_test_value_ptr(_arr_ind, _feat_ind, rung(), offset, for_comp));
}
......@@ -86,7 +86,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_value(int offset=0);
void set_value(int offset=0, bool for_comp=false);
// DocString: div_node_set_test_value
/**
......@@ -94,7 +94,7 @@ public:
*
* @param offset(int) Key to determine which part of the temporary storage array to look into
*/
void set_test_value(int offset=0);