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

Dune dune at dune-project.org
Tue Feb 5 17:40:30 CET 2008


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Robert Klöfkorn (robertk) 

Attached to Project - Dune
Summary - FieldMatrix :: mv seems to be implemented wrong.
Task Type - Bug Report
Category - Dune Modules
Status - New
Assigned To - 
Operating System - Unspecified / All
Severity - Low
Priority - Normal
Reported Version - SVN
Due in Version - Undecided
Due Date - Undecided
Details - 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++)
              for (size_type j=0; j<m; j++)
                  y[i] = (*this)[i][j] * x[j];
  }





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