Révision 168 pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage
sagePolynomialOperations.sage (revision 168) | ||
---|---|---|
58 | 58 |
(columnsWidth - len(monomialAsString)), |
59 | 59 |
# Add the coefficient to the proto matrix row and delete the |
60 | 60 |
# known monomial from the current pMonomial list |
61 |
#(and the corresponding coefficient as well). |
|
61 |
# (and the corresponding coefficient as well).
|
|
62 | 62 |
protoMatrixRowCoefficients.append(pCoefficients[indexInPmonomials]) |
63 | 63 |
del pMonomials[indexInPmonomials] |
64 | 64 |
del pCoefficients[indexInPmonomials] |
... | ... | |
896 | 896 |
polynomialsList.append(q) |
897 | 897 |
tPower += 1 |
898 | 898 |
""" |
899 |
""" |
|
900 |
Start from iExp = 0 since starting from 1 does not allow for |
|
901 |
resultants != 0. |
|
902 |
""" |
|
899 | 903 |
for iExp in xrange(0, alpha+1): |
900 | 904 |
tExp = 0 |
901 | 905 |
while iExp + tExp <= alpha: |
902 | 906 |
q = pRing(iVariable * iBound)^iExp * ((p * N)^tExp) |
903 |
print "q:", iExp, tExp, q |
|
907 |
sys.stdout.write("q " + str(iExp) + "," + str(tExp) + ": ") |
|
908 |
print q |
|
904 | 909 |
polynomialsList.append(q) |
905 | 910 |
tExp += 1 |
906 | 911 |
return polynomialsList |
... | ... | |
961 | 966 |
return polynomialsList |
962 | 967 |
# End spo_polynomial_to_proto_matrix_6 |
963 | 968 |
|
969 |
def spo_polynomial_to_polynomials_list_7(p, alpha, N, iBound, tBound, |
|
970 |
columnsWidth=0): |
|
971 |
""" |
|
972 |
""" |
|
973 |
pRing = p.parent() |
|
974 |
polynomialsList = [] |
|
975 |
pVariables = p.variables() |
|
976 |
iVariable = pVariables[0] |
|
977 |
tVariable = pVariables[1] |
|
978 |
polynomialAtPower = copy(p) |
|
979 |
currentPolynomial = pRing(1) # Constant term. |
|
980 |
|
|
981 |
for iExp in xrange(0, alpha+1): |
|
982 |
pExp = 0 |
|
983 |
while (iExp + pExp) <= alpha: |
|
984 |
print "iExp:", iExp, \ |
|
985 |
"- pExp:", pExp, \ |
|
986 |
"- alpha-pExp:", alpha-pExp |
|
987 |
q = pRing(iVariable * iBound)^iExp * p^pExp * N^(alpha-pExp) |
|
988 |
print q |
|
989 |
polynomialsList.append(q) |
|
990 |
pExp += 1 |
|
991 |
return polynomialsList |
|
992 |
# End spo_polynomial_to_polynomials_list_7 |
|
993 |
|
|
964 | 994 |
def spo_proto_to_column_matrix(protoMatrixColumns): |
965 | 995 |
""" |
966 | 996 |
Create a column (each row holds the coefficients for one monomial) matrix. |
Formats disponibles : Unified diff