Changeset 3104


Ignore:
Timestamp:
Nov 2, 2013, 3:42:56 AM (8 years ago)
Author:
Peter
Message:

allow construction of view into zero-sized Vector.

Location:
trunk/yat/utility
Files:
2 edited

Legend:

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

    r2992 r3104  
    7878  void VectorConstView::copy(const VectorBase& other)
    7979  {
     80    if (!other.gsl_vector_p()) // nothing to do
     81      return;
    8082    const_view_ =
    8183      new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(),
  • trunk/yat/utility/VectorView.cc

    r3102 r3104  
    106106  void VectorView::copy(gsl_vector* other )
    107107  {
     108    if (!other) // nothing to do
     109      return;
    108110    view_ = new gsl_vector_view(gsl_vector_subvector(other,0,other->size));
    109111    const_vec_ = vec_ = &(view_->vector);
Note: See TracChangeset for help on using the changeset viewer.