| 382 | |
| 383 | |
| 384 | void PolymakeFile::writeIncidenceMatrixProperty(const char *p, const vector<list<int> > &m) |
| 385 | { |
| 386 | stringstream t; |
| 387 | |
| 388 | if(isXml) |
| 389 | { |
| 390 | t<<"<incidence_matrix>"; |
| 391 | for(unsigned i=0;i<m.size();i++) |
| 392 | { |
| 393 | t<<"<set>"; |
| 394 | list<int> temp=m[i]; |
| 395 | temp.sort(); |
| 396 | for(list<int>::const_iterator j=temp.begin();j!=temp.end();j++) |
| 397 | { |
| 398 | if(j!=temp.begin())t<<' '; |
| 399 | t<< *j; |
| 400 | } |
| 401 | t<<"</set>\n"<<endl; |
| 402 | } |
| 403 | t<<"</incidence_matrix>\n"; |
| 404 | } |
| 405 | else |
| 406 | { |
| 407 | for(unsigned i=0;i<m.size();i++) |
| 408 | { |
| 409 | t<<'{'; |
| 410 | list<int> temp=m[i]; |
| 411 | temp.sort(); |
| 412 | for(list<int>::const_iterator j=temp.begin();j!=temp.end();j++) |
| 413 | { |
| 414 | if(j!=temp.begin())t<<' '; |
| 415 | t<< *j; |
| 416 | } |
| 417 | t<<'}'<<endl; |
| 418 | } |
| 419 | } |
| 420 | writeProperty(p,t.str()); |
| 421 | } |
| 422 | |
| 423 | |
| 424 | ZVector PolymakeFile::readCardinalVectorProperty(const char *p) |