Ignore:
Timestamp:
Sep 20, 2007, 9:01:57 PM (16 years ago)
Author:
Markus Ringnér
Message:

This revision breaks the vector_test. I know this is against the rules but it is intented for getting help from Jari to identify linking problem. A new function sort_index is added to vector, and tested in vector_test. Everything compiles but vector_test fails to link and I cannot see why

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/vector.cc

    r865 r877  
    513513
    514514
     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
    515533  double sum(const vector& v)
    516534  {
Note: See TracChangeset for help on using the changeset viewer.