View Issue Details

IDProjectCategoryView StatusLast Update
0000524CommunityOCCT:Modeling Algorithmspublic2013-06-26 07:01
ReporteremoAssigned Toifv 
PrioritynoneSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Summary0000524: math_Vector::Multiply(const Vector & v, const Matrix &m) broken
DescriptionThis bug has been added by Francois Petitjean
francois.petitjean@bureauveritas.com at
http://www.opencascade.org/forumorg/bug.php?bug_id=60&f=8 .



It seems that there are some typos in src/math/math_Vector.cxx.

Line 357 :
      Array(Index) = Array(Index) * Left.Array(K) * Right.Array(I, J);
and line 396
      Array(Index) = Array(Index) * Left.Array(K) * TRight.Array(J, I);
should have the effect of setting all Array values to 0.0 as per line 354/392
    Array(Index) = 0.0;

To address this issue, there are many possibilities:
1) modify the erroneous lines, for example:
      Array(Index) = Array(Index) + Left.Array(K) * Right.Array(I, J);
2) change the definition of
void math_Vector::Multiply(const math_Vector& Left,
   const math_Matrix& Right) {
   Multiply(Right, Left); }
to simply reuse another method already defined (and tested).
3) remove the two methods
void math_Vector::Multiply(const math_Vector& Left,
const math_Matrix& Right);
void math_Vector::TMultiply(const math_Vector& Left,
  const math_Matrix& TRight);
from the interface (.hxx) and implementation (.cxx) as they are buggy, so that
the code using it should break. This removes a bit of bloat.
  I am in favor of solution 3.

This begs the question of the quality assurance of a software package as large
as OpenCascade.The code should use the C++ namespace mechanism to fight the
proliferation of files in the include directory (impossible to cvsbrowse the inc
directory), for example
namespace occ {
namespace math {

class Vector {
....
};
inline void Vector::SomeMethod(...) { .. }
..
} // namespace math
} // namespace occ

in a occ/math/Vector.hpp file :
#include "occ/math/Vector.hpp"
and
    typedef occ::math::Vector math_Vector;
to get an almost compatible interface.

Use of the C++ standard library (STL containers, iterators..) would be nice.
TagsNo tags attached.
Test case number

Attached Files

  • occ524_dev_ifv_1.tar (15,872 bytes)

Relationships

related to 0024045 closedbugmaster Invalid test case for matrix-vector multiplication 

Activities

2002-11-27 14:07

 

occ524_dev_ifv_1.tar (15,872 bytes)

Issue History

Date Modified Username Field Change
2002-07-12 13:37 bugmaster Assigned To bugmaster => ifv
2002-07-12 13:37 bugmaster Status new => assigned
2002-07-12 13:51 ifv Assigned To ifv => skv
2002-09-12 20:43 bugmaster Assigned To skv => ifv
2002-11-27 14:02 ifv Assigned To ifv => jgv
2002-11-27 14:05 ifv Assigned To jgv => ifv
2002-11-27 18:07 ifv Status assigned => resolved
2002-11-27 20:34 bugmaster CC => apv
2002-11-28 13:54 apv CC => aki
2002-12-05 21:46 aki Status resolved => tested
2002-12-25 18:49 bugmaster Status tested => closed
2002-12-25 18:49 bugmaster Resolution @0@ => fixed
2011-08-02 11:31 bugmaster Category OCCT:MOA => OCCT:Modeling Algorithms
2011-12-15 17:54 bugmaster Project Open CASCADE => Community
2013-06-26 07:01 abv Relationship added related to 0024045