Changeset 3918fd in git for libpolys/coeffs


Ignore:
Timestamp:
Feb 4, 2014, 12:49:44 AM (10 years ago)
Author:
Max Horn <max@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
b1cb63bb91782427756b8e8dbe583bc7a8418065
Parents:
e04494c84be208a695ca8ee0822f482f393a1871
Message:
Add const qualifier to some methods

Note that Q_poly::is_equal() was not made const -- it reduces the
polynomial, which of course modifies it. This seems odd, as it is
different from the behaviour of the two other polynomial classes. It
also seems odd to have a method name is_equal() with side effects.
Perhaps this is a bug?
Location:
libpolys/coeffs
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/AE.cc

    re04494c r3918fd  
    818818//Vergleiche ob 2 int_polynome gleich return 1 falls ja sont 0
    819819
    820 int int_poly::is_equal(const int_poly g)
     820int int_poly::is_equal(const int_poly g) const
    821821{
    822822    if (deg!=g.deg)
     
    834834//ÜberprÃŒft ob das int_polynom 0 ist
    835835
    836 int int_poly::is_zero()
     836int int_poly::is_zero() const
    837837{
    838838    if (deg<0)
     
    843843}
    844844
    845 int int_poly::is_one()
     845int int_poly::is_one() const
    846846{
    847847    if (deg==0)
     
    853853}
    854854
    855 int int_poly::is_monic()
     855int int_poly::is_monic() const
    856856{
    857857    if (mpz_cmpabs_ui(coef[deg],1)==0)
  • libpolys/coeffs/AE.h

    re04494c r3918fd  
    9696    void poly_subgcd_to(int_poly);
    9797    void poly_extsubgcd(int_poly&, int_poly&,int_poly &,int_poly,int_poly);
    98     int is_equal(const int_poly);                // Test auf Gleichheit
    99     int is_zero();                                // Test auf Gleichheit mit 0
    100     int is_one();                                // Test auf Gleichheit mit 1
    101     int is_monic();                                // testet, ob das int_polynom normiert ist
     98    int is_equal(const int_poly) const;                // Test auf Gleichheit
     99    int is_zero() const;                                // Test auf Gleichheit mit 0
     100    int is_one() const;                                // Test auf Gleichheit mit 1
     101    int is_monic() const;                                // testet, ob das int_polynom normiert ist
    102102
    103103
  • libpolys/coeffs/AEQ.cc

    re04494c r3918fd  
    743743
    744744//ÜberprÃŒft ob das Q_polynom 0 ist
    745 int Q_poly::is_zero()
     745int Q_poly::is_zero() const
    746746{
    747747    if (deg<0)
     
    754754
    755755//ÜberprÃŒft ob das Q_polynom 1 ist
    756 int Q_poly::is_one()
     756int Q_poly::is_one() const
    757757{
    758758    if (deg==0)
     
    764764}
    765765
    766 int Q_poly::is_monic()
     766int Q_poly::is_monic() const
    767767{
    768768    if (mpz_cmp(coef[deg],denom)==0)
  • libpolys/coeffs/AEQ.h

    re04494c r3918fd  
    9191    void Q_poly_extgcd(Q_poly &,Q_poly &,Q_poly &, Q_poly, Q_poly);        //Erweiterter Standard GGT
    9292    int is_equal(Q_poly &);                        // Test auf Gleichheit
    93     int is_zero();                                // Test auf Gleichheit mit 0
    94     int is_one();                                // Test auf Gleichheit mit 1
    95     int is_monic();                                // testet, ob das Q_polynom normiert ist
     93    int is_zero() const;                                // Test auf Gleichheit mit 0
     94    int is_one() const;                                // Test auf Gleichheit mit 1
     95    int is_monic() const;                                // testet, ob das Q_polynom normiert ist
    9696
    9797    // Ein und Ausgabe
  • libpolys/coeffs/AEp.cc

    re04494c r3918fd  
    840840//Vergleiche ob 2 p_polynome gleich return 1 falls ja sont 0
    841841
    842 int p_poly::is_equal(const p_poly g)
     842int p_poly::is_equal(const p_poly g) const
    843843{
    844844    if (deg!=g.deg)
     
    856856//ÜberprÃŒft ob das p_polynom 0 ist
    857857
    858 int p_poly::is_zero()
     858int p_poly::is_zero() const
    859859{
    860860    if (deg<0)
     
    865865}
    866866
    867 int p_poly::is_one()
     867int p_poly::is_one() const
    868868{
    869869    if (deg==0)
     
    875875}
    876876
    877 int p_poly::is_monic()
     877int p_poly::is_monic() const
    878878{
    879879    if (mpz_cmpabs_ui(coef[deg],1)==0)
  • libpolys/coeffs/AEp.h

    re04494c r3918fd  
    8888    void p_poly_gcd(p_poly,p_poly);                //Standard GGT
    8989    void p_poly_extgcd(p_poly &,p_poly &,p_poly &, p_poly, p_poly);        //Erweiterter Standard GGT
    90     int is_equal(const p_poly);                // Test auf Gleichheit
    91     int is_zero();                                // Test auf Gleichheit mit 0
    92     int is_one();                                // Test auf Gleichheit mit 1
    93     int is_monic();                                // testet, ob das p_polynom normiert ist
     90    int is_equal(const p_poly) const;                // Test auf Gleichheit
     91    int is_zero() const;                                // Test auf Gleichheit mit 0
     92    int is_one() const;                                // Test auf Gleichheit mit 1
     93    int is_monic() const;                                // testet, ob das p_polynom normiert ist
    9494
    9595    // Ein und Ausgabe
Note: See TracChangeset for help on using the changeset viewer.