9 throw Error(
"cannot squash zero resources together");
13 for (
int i = 1; i < ps.size(); ++i) {
23 throw Error(
"cannot squash zero resources together");
27 for (
int i = 1; i < ms.size(); ++i) {
36 throw Error(
"cannot squash zero resources together");
40 if (mats[0] != NULL) {
44 if (prods[0] != NULL) {
48 throw Error(
"cannot squash resource type " + rs[0]->type());
51std::vector<Resource::Ptr>
ResCast(std::vector<Material::Ptr> rs) {
52 std::vector<Resource::Ptr> casted;
53 for (
int i = 0; i < rs.size(); ++i) {
54 casted.push_back(boost::dynamic_pointer_cast<Resource>(rs[i]));
59std::vector<Resource::Ptr>
ResCast(std::vector<Product::Ptr> rs) {
60 std::vector<Resource::Ptr> casted;
61 for (
int i = 0; i < rs.size(); ++i) {
62 casted.push_back(boost::dynamic_pointer_cast<Resource>(rs[i]));
67std::vector<Resource::Ptr>
ResCast(std::vector<Resource::Ptr> rs) {
A generic mechanism to manually manage exceptions.
boost::shared_ptr< Material > Ptr
boost::shared_ptr< Product > Ptr
boost::shared_ptr< Resource > Ptr
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
std::vector< typename T::Ptr > ResCast(std::vector< Resource::Ptr > rs)
Casts a vector of Resources into a vector of a specific resource type T.