Ignore:
Timestamp:
Mar 15, 2007, 9:07:01 PM (15 years ago)
Author:
Peter
Message:

previous argument was invalid, but here is an implementation. Fixes #205

File:
1 edited

Legend:

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

    r791 r808  
    291291
    292292
     293  void vector::resize(size_t n, double init_value)
     294  {
     295    if (view_)
     296      delete view_;
     297    else if (view_const_)
     298      delete view_const_;
     299    else if (v_)
     300      gsl_vector_free(v_);
     301    proxy_v_ = v_ = gsl_vector_alloc(n);
     302
     303    if (!v_)
     304      throw utility::GSL_error("vector::vector failed to allocate memory");
     305    set_all(init_value);
     306  }
     307
     308
    293309  void vector::reverse(void)
    294310  {
Note: See TracChangeset for help on using the changeset viewer.