Révision 107

pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage (revision 107)
114 114
    """
115 115
    Behaves more or less (no infinity defined) as the norm for the
116 116
    univariate polynomials.
117
    Quoting the Sage documentation:
118
    Definition: For integer p, the p-norm of a polynomial is the pth root of 
117
    Quoting Sage documentation:
118
    "Definition: For integer p, the p-norm of a polynomial is the pth root of 
119 119
    the sum of the pth powers of the absolute values of the coefficients of 
120
    the polynomial.
120
    the polynomial."
121 121
    
122 122
    """
123 123
    # TODO: check the arguments (for p see below)..
......
130 130
                norm = coefficientAbs
131 131
        return norm
132 132
    # TODO: check here the value of p
133
    # p must be an integer.
134
    if int(p) != p:
133
    # p must be a positive integer >= 1.
134
    if p < 1 or (not p in ZZ):
135 135
        return None
136
    # p must be >= 1.
137
    if p < 1:
138
        return None
139 136
    # For 1 norm.
140 137
    if p == 1:
141 138
        for coefficient in poly.coefficients():

Formats disponibles : Unified diff