Changeset 796


Ignore:
Timestamp:
Mar 12, 2007, 11:18:55 PM (15 years ago)
Author:
Jari Häkkinen
Message:

Fixes #201.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/matrix_test.cc

    r793 r796  
    376376    *error << "error operator*=(matrix) 2" << std::endl;
    377377  }
     378  m6*= utility::matrix(3,4,1.0);
     379  m6*= utility::matrix(4,3,1.0);
     380  m6*= utility::matrix(3,5,2.0);
     381  m6*= utility::matrix(5,5,2.0);
     382  m6*= utility::matrix(5,3,2.0);
     383  m6*= unit3x3;
    378384
    379385  if (error!=&std::cerr)
  • trunk/yat/utility/matrix.cc

    r794 r796  
    174174      else if (m_)
    175175        gsl_matrix_free(m_);
    176       if (blas_result_) {
    177         gsl_matrix_free(blas_result_);
    178         blas_result_=NULL;
    179       }
    180176      proxy_m_=m_=NULL;
    181177
     
    191187        proxy_m_ = m_ = other.create_gsl_matrix_copy();
    192188
     189      // no need to delete blas_result_ if the number of rows fit, it
     190      // may be useful later.
     191      if (blas_result_ && (blas_result_->size1!=rows())) {
     192        gsl_matrix_free(blas_result_);
     193        blas_result_=NULL;
     194      }
    193195    }
    194196    return *this;
     
    433435  {
    434436    assert(m_);
     437    if ( blas_result_ && ((blas_result_->size1!=rows()) ||
     438                          (blas_result_->size2!=other.columns())) ) {
     439      gsl_matrix_free(blas_result_);
     440      blas_result_=NULL;
     441    }
    435442    if (!blas_result_) {
    436443      blas_result_ = gsl_matrix_alloc(rows(),other.columns());
Note: See TracChangeset for help on using the changeset viewer.