Ignore:
Timestamp:
Mar 9, 2007, 10:40:34 AM (15 years ago)
Author:
Peter
Message:

removed v_const in vector since it never used for anything but only assigned here and there

File:
1 edited

Legend:

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

    r784 r787  
    55  Copyright (C) 2004 Jari Häkkinen, Peter Johansson
    66  Copyright (C) 2005 Jari Häkkinen, Peter Johansson, Markus Ringnér
    7   Copyright (C) 2006 Jari Häkkinen, Peter Johansson
    8   Copyright (C) 2007 Jari Häkkinen
     7  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
    98
    109  This file is part of the yat library, http://lev.thep.lu.se/trac/yat
     
    4241
    4342  vector::vector(void)
    44     : v_(NULL), v_const_(NULL), view_(NULL), view_const_(NULL), proxy_v_(NULL)
     43    : v_(NULL), view_(NULL), view_const_(NULL), proxy_v_(NULL)
    4544  {
    4645  }
     
    4847
    4948  vector::vector(size_t n, double init_value)
    50     : v_(gsl_vector_alloc(n)), v_const_(NULL), view_(NULL), view_const_(NULL),
     49    : v_(gsl_vector_alloc(n)), view_(NULL), view_const_(NULL),
    5150      proxy_v_(v_)
    5251  {
     
    5958
    6059  vector::vector(const vector& other)
    61     : v_(other.create_gsl_vector_copy()), v_const_(NULL), view_(NULL),
     60    : v_(other.create_gsl_vector_copy()), view_(NULL),
    6261      view_const_(NULL), proxy_v_(v_)
    6362  {
     
    6665
    6766  vector::vector(vector& v, size_t offset, size_t n, size_t stride)
    68     : v_const_(NULL), view_const_(NULL)
     67    : view_const_(NULL)
    6968  {
    7069    view_ = new gsl_vector_view(gsl_vector_subvector_with_stride(v.v_,offset,
     
    8382    if (!view_const_)
    8483      throw utility::GSL_error("vector::vector failed to setup view");
    85     proxy_v_ = v_const_ = &(view_const_->vector);
     84    proxy_v_ = &(view_const_->vector);
     85    const_cast<const gsl_vector*>(proxy_v_);
    8686  }
    8787
    8888
    8989  vector::vector(matrix& m, size_t i, bool row)
    90     : v_const_(NULL), view_const_(NULL)
     90    : view_const_(NULL)
    9191  {
    9292    view_=new gsl_vector_view(row ?
     
    107107    if (!view_const_)
    108108      throw utility::GSL_error("vector::vector failed to setup view");
    109     proxy_v_ = v_const_ = &(view_const_->vector);
     109    proxy_v_ = &(view_const_->vector);
    110110  }
    111111
     
    113113  vector::vector(std::istream& is, char sep)
    114114    throw (utility::IO_error, std::exception)
    115     : v_const_(NULL), view_(NULL), view_const_(NULL)
     115    : view_(NULL), view_const_(NULL)
    116116  {
    117117    // read the data file and store in stl vectors (dynamically
     
    347347      else if ( v_ )
    348348        gsl_vector_free( v_ );
    349       v_const_=NULL;
    350349      proxy_v_ = v_ = other.create_gsl_vector_copy();
    351350    }
Note: See TracChangeset for help on using the changeset viewer.