Ejemplo n.º 1
0
bool TableFunction::SetVal(const Assignment &a, double val) {
    int idx = a.GetIndex();
    if (idx < 0 || idx == UNKNOWN_VAL || idx >= (int) values.size())
        return false;
    values[idx] = val;
    return true;
}
Ejemplo n.º 2
0
double TableFunction::GetValForceOldOrder(const Assignment &a, bool logOut) const {
    int idx = a.GetIndex();
    if (idx == UNKNOWN_VAL || idx >= (int) values.size()) {
        cout << idx << ", Max is: " << values.size() << std::endl;
//        throw GenericException("Invalid indexing of function: " + idx);
    }
    return !logOut ? values[idx] : log10(values[idx]);
}