in

.NET Opensource

Community for opensource projects by Christoph Rüegg

Polynomial Copy Constructor

Last post 12-26-2007 13:45 by Christoph Rüegg. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-19-2007 19:59

    Polynomial Copy Constructor

    Should the polynomial copy constructor set the order of the newly-created polynomial? The other constructors set the order. I believe the order not being set causes problems when I try to print a copied polynomial to the screen. It also causes problems when printing the results of op_Addition() and op_Subtraction() because those functions use the copy constructor.

    //"poly" is 2x+3
    System::Console::Write(poly->ToString());  //prints "2 x + 3" as expected

    //"poly" is 2x+3 
    Polynomial* copyPoly =
    new Polynomial(poly);
    System::Console::Write(copyPoly->ToString());  //prints "3" instead of "2 x + 3" but the coefficient matrix is correct

    //"poly" is 2x+3 
    Polynomial* otherAddPoly = Polynomial::op_Addition(poly, 5);
    System::Console::Write(otherAddPoly->ToString());  //prints "8" instead of "2 x + 8" but the coefficient matrix is correct

    Thank you.
    Filed under:
  • 12-21-2007 11:31 In reply to

    Re: Polynomial Copy Constructor

    Thanks for letting me know, I'll have a look at it. 

    Filed under:
  • 12-26-2007 13:45 In reply to

    Re: Polynomial Copy Constructor

    Thanks again for reporting. The issue is tracked as IRID-92 and has been fixed today in the subversion repository revision 292. It will also be included in the next official release. 
    Filed under: , ,
Page 1 of 1 (3 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems