@@ -31,7 +31,6 @@ from cysignals.signals cimport sig_check
31
31
from libc.string cimport memcpy
32
32
33
33
from sage.data_structures.bitset_base cimport *
34
- from sage.misc.superseded import deprecated_function_alias
35
34
from sage.rings.finite_rings.finite_field_base import FiniteField
36
35
from sage.rings.finite_rings.finite_field_constructor import GF
37
36
from sage.rings.integer cimport Integer
@@ -351,7 +350,7 @@ cdef class BooleanFunction(SageObject):
351
350
def __dealloc__ (self ):
352
351
bitset_free(self ._truth_table)
353
352
354
- def _repr_ (self ):
353
+ def _repr_ (self ) -> str :
355
354
"""
356
355
EXAMPLES::
357
356
@@ -612,7 +611,7 @@ cdef class BooleanFunction(SageObject):
612
611
"""
613
612
return 2 ** self ._nvariables
614
613
615
- def __richcmp__ (BooleanFunction self , other , int op ):
614
+ def __richcmp__ (BooleanFunction self , other , int op ) -> bool :
616
615
"""
617
616
Boolean functions are considered to be equal if the number of
618
617
input variables is the same , and all the values are equal.
@@ -745,15 +744,16 @@ cdef class BooleanFunction(SageObject):
745
744
{8: 64}
746
745
"""
747
746
d = {}
748
- cdef long i
747
+ cdef long i, a
749
748
for i in self .walsh_hadamard_transform():
750
- if abs (i) in d:
751
- d[abs (i)] += 1
749
+ a = abs (i)
750
+ if a in d:
751
+ d[a] += 1
752
752
else :
753
- d[abs (i) ] = 1
753
+ d[a ] = 1
754
754
return d
755
755
756
- def is_balanced (self ):
756
+ def is_balanced (self ) -> bool :
757
757
"""
758
758
Return ``True`` if the function takes the value ``True`` half of the time.
759
759
@@ -769,7 +769,7 @@ cdef class BooleanFunction(SageObject):
769
769
"""
770
770
return self.walsh_hadamard_transform()[0] == 0
771
771
772
- def is_symmetric (self ):
772
+ def is_symmetric(self ) -> bool :
773
773
"""
774
774
Return ``True`` if the function is symmetric , i.e. invariant under
775
775
permutation of its input bits.
@@ -821,7 +821,7 @@ cdef class BooleanFunction(SageObject):
821
821
((1<<self._nvariables) - max(abs(w) for w in self.walsh_hadamard_transform())) >> 1
822
822
return self._nonlinearity
823
823
824
- def is_bent (self ):
824
+ def is_bent(self) -> bool :
825
825
"""
826
826
Return ``True `` if the function is bent.
827
827
@@ -928,12 +928,13 @@ cdef class BooleanFunction(SageObject):
928
928
[(0 , 33 ), (8 , 58 ), (16 , 28 ), (24 , 6 ), (32 , 2 ), (128 , 1 )]
929
929
"""
930
930
d = {}
931
- cdef long i
931
+ cdef long i, a
932
932
for i in self.autocorrelation():
933
- if abs (i) in d:
934
- d[abs (i)] += 1
933
+ a = abs(i)
934
+ if a in d:
935
+ d[a] += 1
935
936
else:
936
- d[abs (i) ] = 1
937
+ d[a ] = 1
937
938
return d
938
939
939
940
def absolute_indicator(self):
@@ -949,24 +950,13 @@ cdef class BooleanFunction(SageObject):
949
950
sage: B = BooleanFunction(" 7969817CC5893BA6AC326E47619F5AD0" )
950
951
sage: B.absolute_indicator()
951
952
32
952
-
953
- The old method's name contained a typo, it is deprecated::
954
-
955
- sage: B.absolut_indicator()
956
- doctest:warning
957
- ...
958
- DeprecationWarning: absolut_indicator is deprecated. Please use absolute_indicator instead.
959
- See https://github.com/sagemath/sage/issues/28001 for details.
960
- 32
961
953
"""
962
954
cdef long a
963
955
if self._absolute_indicator is None:
964
956
D = self.autocorrelation()
965
957
self._absolute_indicator = max([abs(a) for a in D[1:]])
966
958
return self._absolute_indicator
967
959
968
- absolut_indicator = deprecated_function_alias(28001 , absolute_indicator)
969
-
970
960
def sum_of_square_indicator(self):
971
961
"""
972
962
Return the sum of square indicator of the function.
0 commit comments