[Dune] [#346] FieldMatrix :: mv seems to be implemented wrong.

Dune dune at dune-project.org
Tue Feb 5 17:41:14 CET 2008


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has been changed.  The changes are listed below.  For full information about what has changed, visit the URL and click the History tab.

FS#346 - FieldMatrix :: mv seems to be implemented wrong.
User who did this: Robert Klöfkorn (robertk)
Task details edited:
-------
This is the current code: 

  //! y = A x 
  template<class X, class Y>
  void mv (const X& x, Y& y) const
  {
#ifdef DUNE_FMatrix_WITH_CHECKING
    if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
    if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
#endif
          for (size_type i=0; i<n; i++)
              for (size_type j=0; j<m; j++)
                  y[i] = (*this)[i][j] * x[j];
  }

I suggest it to change to:   

//! y = A x 
  template<class X, class Y>
  void mv (const X& x, Y& y) const
  {
#ifdef DUNE_FMatrix_WITH_CHECKING
    if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
    if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
#endif
          for (size_type i=0; i<n; i++)
            y[i] = (*this)[i] * x;
  }




-------
Category: Dune Modules -> Common
Severity: Low -> High

More information can be found at the following URL:
http://conan.informatik.uni-stuttgart.de/flyspray/index.php?do=details&task_id=346

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list