Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: Version 6.0
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      55

      Description

      Hi,

      there is a problem with calculation of matrices with rational elements.
      Look at the following:

      DenseMatrix<Rational> dm;
      DenseMatrix<Rational> result;
      Rational[][] mat;
      mat = new Rational[2][2];

      mat[0][0] = Rational.valueOf(7,1);
      mat[0][1] = Rational.valueOf(0,1);
      mat[1][0] = Rational.valueOf(0,1);
      mat[1][1] = Rational.valueOf(1,1);

      dm = DenseMatrix.valueOf(mat);

      result=DenseMatrix.valueOf(dm.pow(2));

      result is
      {{49/1, 1/1},
      {1/1, 1/1}}
      and that's clearly wrong. It should be
      {{49/1, 0/1},
      {0/1, 1/1}}

      If you change the (0,0)-element from 7 to a power of 2, all things are ok.

      If you change the element class of the DenseMatrix, for instance from Rational
      to Complex (with a few change of the valueOf arguments), it gives every time the
      correct result.

      I try this with java 6, OS Windows NT5 and Windows XP.

      Best regards
      J.Lorenz

        Activity

        lorenzj created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 55 63214
        dautelle made changes -
        Fix Version/s Version 6.0 [ 14597 ]
        Fix Version/s milestone 1 [ 12327 ]

          People

          • Assignee:
            dautelle
            Reporter:
            lorenzj
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: