Пример #1
0
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);
		}
	}
}
Пример #2
0
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;
		}
	}
}
Пример #3
0
///////////////// 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;
		}
	}
}
Пример #4
0
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);
}
Пример #5
0
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;
		}
	}
}
Пример #6
0
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);
}
Пример #7
0
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;
		}
	}
}
Пример #8
0
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);
}
Пример #9
0
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));
		}
	}
}