Changeset 784 for trunk/yat


Ignore:
Timestamp:
Mar 6, 2007, 5:02:30 PM (15 years ago)
Author:
Jari Häkkinen
Message:

References #155. Removed potential null pointer usage. Some unwanted asserts removed.

File:
1 edited

Legend:

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

    r783 r784  
    212212  void vector::div(const vector& other)
    213213  {
    214     assert(v_); assert(other.v_);
    215     int status=gsl_vector_div(v_,other.v_);
     214    assert(v_);
     215    int status=gsl_vector_div(v_,other.gsl_vector_p());
    216216    if (status)
    217217      throw utility::GSL_error(std::string("vector::div",status));
     
    239239  void vector::mul(const vector& other)
    240240  {
    241     assert(v_); assert(other.v_);
    242     int status=gsl_vector_mul(v_,other.v_);
     241    assert(v_);
     242    int status=gsl_vector_mul(v_,other.gsl_vector_p());
    243243    if (status)
    244244      throw utility::GSL_error(std::string("vector::mul",status));
     
    255255  void vector::set(const vector& vec)
    256256  {
    257     assert(v_); assert(vec.v_);
    258     if (gsl_vector_memcpy(v_,vec.v_))
     257    assert(v_);
     258    if (gsl_vector_memcpy(v_,vec.gsl_vector_p()))
    259259      throw utility::GSL_error("vector::set dimension mis-match");
    260260  }
     
    357357  {
    358358    assert(v_);
    359     int status=gsl_vector_add(v_, other.v_);
     359    int status=gsl_vector_add(v_, other.gsl_vector_p());
    360360    if (status)
    361361      throw utility::GSL_error(std::string("vector::add", status));
     
    375375  {
    376376    assert(v_);
    377     int status=gsl_vector_sub(v_, other.v_);
     377    int status=gsl_vector_sub(v_, other.gsl_vector_p());
    378378    if (status)
    379379      throw utility::GSL_error(std::string("vector::sub", status));
Note: See TracChangeset for help on using the changeset viewer.