Commit 7a8c719a authored by Alessio Netti's avatar Alessio Netti

Fixing model input and output for CS signatures

parent d77937f1
......@@ -165,8 +165,8 @@ bool CSOperator::dumpToFile(std::string &path) {
for(size_t idx=0; idx<_permVector.size(); idx++) {
boost::property_tree::ptree group;
group.push_back(boost::property_tree::ptree::value_type("idx", boost::property_tree::ptree(std::to_string(_permVector[idx]))));
group.push_back(boost::property_tree::ptree::value_type("min", boost::property_tree::ptree(std::to_string(_min[idx]))));
group.push_back(boost::property_tree::ptree::value_type("max", boost::property_tree::ptree(std::to_string(_max[idx]))));
group.push_back(boost::property_tree::ptree::value_type("min", boost::property_tree::ptree(std::to_string(_min[_permVector[idx]]))));
group.push_back(boost::property_tree::ptree::value_type("max", boost::property_tree::ptree(std::to_string(_max[_permVector[idx]]))));
blocks.add_child(std::to_string(idx), group);
}
root.add_child(std::to_string(_permVector.size()), blocks);
......@@ -202,15 +202,22 @@ bool CSOperator::readFromFile(std::string &path) {
if(blockID>=numSensors)
return false;
size_t tempIdx = 0;
int64_t tempMin = 0, tempMax = 0;
BOOST_FOREACH(boost::property_tree::iptree::value_type &val2, blk) {
if (boost::iequals(val2.first, "idx")) {
newPermVector[blockID] = std::stoull(val2.second.data());
tempIdx = std::stoull(val2.second.data());
} else if (boost::iequals(val2.first, "min")) {
newMin[blockID] = std::stoll(val2.second.data());
tempMin = std::stoll(val2.second.data());
} else if (boost::iequals(val2.first, "max")) {
newMax[blockID] = std::stoll(val2.second.data());
tempMax = std::stoll(val2.second.data());
}
}
newPermVector[blockID] = tempIdx;
newMin[tempIdx] = tempMin;
newMax[tempIdx] = tempMax;
}
// Replacing the operator's CS data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment