void TranLog10::reverse(Transformable &data) { Transformable::iterator data_iter, data_end = data.end(); for (set<string>::const_iterator b=items.begin(), e=items.end(); b!=e; ++b) { data_iter = data.find(*b); if (data_iter != data_end) { (*data_iter).second = pow(10.0, (*data_iter).second); } } }
void TranScale::reverse(Transformable &data) { Transformable::iterator data_iter, data_end = data.end(); for (map<string,double>::const_iterator b=items.begin(), e=items.end(); b!=e; ++b) { data_iter = data.find(b->first); if (data_iter != data_end) { (*data_iter).second /= b->second; } } }
///////////////// TranOffset Methods ///////////////// void TranOffset::forward(Transformable &data) { Transformable::iterator data_iter, data_end = data.end(); for (map<string,double>::const_iterator b=items.begin(), e=items.end(); b!=e; ++b) { data_iter = data.find(b->first); if (data_iter != data_end) { (*data_iter).second += (*b).second; } } }
void TranNormalize::d2_to_d1(Transformable &del_data, Transformable &data) { Transformable::iterator del_data_iter, del_data_end = del_data.end(); for (map<string, NormData>::const_iterator b = items.begin(), e = items.end(); b != e; ++b) { del_data_iter = del_data.find(b->first); if (del_data_iter != del_data_end) { (*del_data_iter).second *= b->second.scale; } } reverse(data); }
void TranNormalize::reverse(Transformable &data) { Transformable::iterator data_iter, data_end = data.end(); for (map<string,NormData>::const_iterator b=items.begin(), e=items.end(); b!=e; ++b) { data_iter = data.find(b->first); if (data_iter != data_end) { (*data_iter).second /= b->second.scale; (*data_iter).second -= b->second.offset; } } }
void TranScale::d1_to_d2(Transformable &del_data, Transformable &data) { Transformable::iterator del_data_iter, del_data_end = del_data.end(); for (map<string, double>::const_iterator b = items.begin(), e = items.end(); b != e; ++b) { del_data_iter = del_data.find(b->first); if (del_data_iter != del_data_end) { (*del_data_iter).second /= b->second; } } forward(data); }
void TranLog10::d1_to_d2(Transformable &del_data, Transformable &data) { forward(data); Transformable::iterator del_data_iter, del_data_end = del_data.end(); for (set<string>::const_iterator b = items.begin(), e = items.end(); b != e; ++b) { del_data_iter = del_data.find(*b); if (del_data_iter != del_data_end) { double d1 = data.get_rec(*b); double factor = pow(10.0, d1) * log(10.0); (*del_data_iter).second *= factor; } } }
void TranLog10::d2_to_d1(Transformable &del_data, Transformable &data) { reverse(data); Transformable::iterator del_data_iter, del_data_end = del_data.end(); for (set<string>::const_iterator b = items.begin(), e = items.end(); b != e; ++b) { del_data_iter = del_data.find(*b); if (del_data_iter != del_data_end) { double d2 = data.get_rec(*b); double factor = 1.0 / (d2 * log(10.0)); (*del_data_iter).second *= factor; } } reverse(data); }
void TranTied::reverse(Transformable &data) { string const *base_name; double *factor; Transformable::iterator base_iter; for (map<string, pair_string_double>::iterator b=items.begin(), e=items.end(); b!=e; ++b) { base_name = &(b->second.first); factor = &(b->second.second); base_iter = data.find(*base_name); if (base_iter != data.end()) { data.insert(b->first, (*base_iter).second * (*factor)); } } }