ipab-slmc / exotica

Extensible Optimization Framework
https://ipab-slmc.github.io/exotica
BSD 3-Clause "New" or "Revised" License
151 stars 70 forks source link

allow parsing empty vectors #611

Closed christian-rauch closed 5 years ago

christian-rauch commented 5 years ago

This removes the exceptions when an empty vector (Eigen or STL) is parsed.

When a vector is used as an optional parameter, it often makes sense to have an empty default argument, e.g.:

Optional std::vector<std::string> Tasks = std::vector<std::string>();

or

Optional Eigen::VectorXd Convergence = Eigen::VectorXd();

The parameter can then be ignored by testing the the vector insite the task map.

wxmerkt commented 5 years ago

I see the value in this. However, the original checks were due to different separators and people easily mixing them up, e.g., space and comma. So some failures would be due to erroneous input and lead to a silent failure. Perhaps add a warning rather than a throw?

christian-rauch commented 5 years ago

I replaced the exception by WARNING_NAMED.