Changeset 4b278c in git


Ignore:
Timestamp:
Jan 22, 2015, 1:19:41 PM (9 years ago)
Author:
dere <dkifle16@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
2a5eb8ef50edb654ddd5bbc8e061d551ea44cc74d181eea62bf528f5777c224499fbf26cccac5ff7
Parents:
29b5e9d336d980cc76f0fb6c9d67818a144f3ed3
Message:
chg: use check_leadmonom_and_size() in Algemodstd::LiftPolyCRT()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/algemodstd.lib

    r29b5e9d r4b278c  
    293293////////////////////////////////////////////////////////////////////////////////
    294294
     295static proc check_leadmonom_and_size(list L)
     296{
     297    /*
     298     * compare the size of ideals in the list and
     299     * check the corresponding leading monomials
     300     * size(L)>=2
     301     */
     302    ideal J=L[1];
     303    int i=size(L);
     304    int sc=ncols(J);
     305    int j,k;
     306    poly g=leadmonom(J[1]);
     307    for(j=1;j<=i;j++)
     308    {
     309        if(ncols(L[j])!=sc)
     310        {
     311            return(0);
     312        }
     313    }
     314    for(k=2;k<=i;k++)
     315    {
     316        for(j=1;j<=sc;j++)
     317        {
     318            if(leadmonom(J[j])!=leadmonom(L[k][j]))
     319            {
     320                return(0);
     321            }
     322        }
     323    }
     324    return(1);
     325}
     326
     327////////////////////////////////////////////////////////////////////////////////
     328
    295329static proc LiftPolyCRT(ideal I)
    296330{
     
    324358        }
    325359    }
    326     // apply CRT for polynomials
    327     II =chinrempoly(Lk,LL),f;
     360    if(check_leadmonom_and_size(Lk))
     361    {
     362        // apply CRT for polynomials
     363        II =chinrempoly(Lk,LL),f;
     364    }
     365    else
     366    {
     367        II=0;
     368    }
    328369    return(II);
    329370}
Note: See TracChangeset for help on using the changeset viewer.