Changeset 877 for trunk/yat/utility/vector.cc
 Timestamp:
 Sep 20, 2007, 9:01:57 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/utility/vector.cc
r865 r877 513 513 514 514 515 void sort_index(std::vector<size_t>& sort_index, const vector& invec) 516 { 517 assert(invec.gsl_vector_p()); 518 gsl_permutation* p = gsl_permutation_alloc(invec.size()); 519 int status=gsl_sort_vector_index(p,invec.gsl_vector_p()); 520 if (status) { 521 gsl_permutation_free(p); 522 throw utility::GSL_error(std::string("sort_index(vector&,const vector&)",status)); 523 } 524 for(size_t i=0;i<p>size;i++) { 525 sort_index.resize(0); 526 sort_index.push_back(gsl_permutation_get(p,i)); 527 } 528 gsl_permutation_free(p); 529 } 530 531 532 515 533 double sum(const vector& v) 516 534 {
Note: See TracChangeset
for help on using the changeset viewer.