Menu

#1404 2D display of long denominator of nested fractional

closed
nobody
Lisp Core (457)
5
2011-07-18
2008-04-30
No

Dear Developers of Maxima,

I think that I met a bug of Maxima to display nested fractionals
in the 2D style. If the denominator of a nested fractional is long,
it is not displayed correctly. The display width controll
based on the variable LINEL seems to be not effective in the denominator.
Compared to this, the numerator of a nested fractional causes no such
problem to be displayed even when the numerator is long.

Here, I have prepared a program for demonstration:
------------------------------------------------------------------------------
/*
* denominator_of_nested_fractional_is_not_displayed_correctly.maxima:
*
* The line length, which is usually controlled by the variable LINEL,
* is not recognized in the denominator of a nested fractional, if the
* nested fractional has a long denominator.
*
* S.Adachi 2008/04/29
*/

/* Do not use ``display2d:false;'', since this is a problem in displaying
a mathematical expression in the 2D style. */

X:product(f(i+1/2),i,0,20);

Y:product(g(i+1/2),i,0,20);

Z:X/Y; /* A nested fractional; its denominator is not displayed correctly. */

/* END */
------------------------------------------------------------------------------

This is a problem in displaying mathematical expressions in the 2D style.
Accordingly, I cannot attach here the log list that is obtained by running
the above program. (If I include in a bug report the mathematical expressions
that are displayed in the 2D style by Maxima, the posted bug report becomes
a disordered gabage in appearance.)

So, please execute the above program by the command

maxima -b denominator_of_nested_fractional_is_not_displayed_correctly.maxima

to see the phenomenon that I am reporting in this letter.
I am using a console terminal with line width 80 to run the above program.

It is essential for Maxima to display any mathematical expression
in a correct mannar. If it is not, we cannot read the output from Maxima.
So, please fix this bug.

Sincerely yours,
Satoshi Adachi

Discussion

  • Robert Dodier

    Robert Dodier - 2008-05-04

    Logged In: YES
    user_id=501686
    Originator: NO

    Observed in Maxima 5.15.0cvs. NOT observed in 5.9.0 -- so I guess the display code was modified incorrectly at some point. I can try some different versions, but it will be a while.

    The line width doesn't appear to be important -- I get incorrect output when linel:65, or linel:70, or linel:80.

     
  • Robert Dodier

    Robert Dodier - 2008-06-22

    Logged In: YES
    user_id=501686
    Originator: NO

    Assign category = lisp core.

     
  • Robert Dodier

    Robert Dodier - 2008-06-22
    • labels: --> Lisp Core
     
  • Dieter Kaiser

    Dieter Kaiser - 2010-02-02

    I think this bug report is related to the following bug report: ID 635708 - Bad 2d-display of a long denominator.

    A 2d-display with a small value of linel shows that the long denominator is not broken up correctly. This seems to be a general problem.

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-02-03

    I had again a look at this problem. The example I have given in the bug report ID:635708 is a more simple example for the reported problem in this bug report. But there are two problems and this bug report is not related to the first one.

    The problem of this bug report is present until Maxima 5.15. In Maxima 5.14 the display of this example is correct. The example I have given in the report ID:635708 is correct in Maxima 5.14 too, but not since Maxima 5.15.

    This is again the more simple example:

    We take a long numerator and a long denominator.

    (%i1) num:a1+a2+a3+a4+a5+a6+a7+a8+a9;
    (%o1) a9 + a8 + a7 + a6 + a5 + a4 + a3 + a2 + a1
    (%i2) denom:b1+b2+b3+b4+b5+b6+b7+b8+b9;
    (%o2) b9 + b8 + b7 + b6 + b5 + b4 + b3 + b2 + b1

    We set linel to a small value 10.

    (%i4) linel:10;
    (%o4) 10

    We display num/denom. This is a correct display.

    (%i5) num/denom;
    (%o5) (a9
    + a8 + a7
    + a6 + a5
    + a4 + a3
    + a2
    + a1)
    /(b9 + b8
    + b7 + b6
    + b5 + b4
    + b3 + b2
    + b1)

    We get the error when we multiply the denominator with a further constant.
    The last line is no longer broken up correctly:

    (%i6) num/(x*denom);
    (%o6) (a9
    + a8 + a7
    + a6 + a5
    + a4 + a3
    + a2
    + a1)
    /((b9 + b8 + b7 + b6 + b5 + b4 + b3 + b2 + b1) x)

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-08-02

    Again I had a look at the problem. I have found the reason in a change of the function dimnary in revision 1.37. When I revert the changes of this function I get the expected breakup of long lines. This is the routine

    (defun dimnary (form result lop op rop w)
    ; (declare (ignore op))
    (if (and (consp form)
    ; (member (safe-get (caar form) 'dimension) '(dimension-infix dimension-nary))
    (eq (caar form) op)
    )
    (dimension-paren form result)
    (dimension form result lop rop w right)))

    We get the following for the example of the last posting:

    (%i1) num:a1+a2+a3+a4+a5+a6+a7+a8+a9$
    (%i2) denom:b1+b2+b3+b4+b5+b6+b7+b8+b9$
    (%i3) linel:10$

    (%i4) num/(x*denom);
    (%o4) (a9
    + a8 + a7
    + a6 + a5
    + a4 + a3
    + a2
    + a1)
    /((b9 + b8
    + b7 + b6
    + b5 + b4
    + b3 + b2
    + b1) x)

    The change has been introduced to get a more correct display for expressions like

    a * b . c --> a (b . c)

    I have not analyzed the problem further and I have no solution to get a correct breakup of long lines.
    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2011-07-18
    • status: open --> closed
     
  • Dieter Kaiser

    Dieter Kaiser - 2011-07-18

    Fixed in the function dimnary in the file displa.lisp with revision 18 Jul 2011.
    Closing this bug report as fixed.
    Dieter Kaiser

     

Log in to post a comment.