Releases: trizen/sidef
Releases · trizen/sidef
Version 22.05
Additions
- Added the Number
binomialmod(n,k,m)
method. (798dcd5, cb18caf, 1c1e12b, 774ec41) - Added the Number
sum_of_squares(n)
method. (b8b5e20) - Added the Number
difference_of_squares(n)
method. (5a94bf6) - Added the Number
lnsuperprimorial(n)
method. (248b18f) - Added the Number
chebyshev_factor(n,B,x)
method. (763b976) - Added the Number
mbe_factor(n,tries=10)
method. (e1bd235) - Added the
stringify
method to the Number classes. (564f87a) - Added the Mod
cyclotomic(Mod(x,m), n)
method. (9a00535) - Added the Number
quadratic_formulaQ(a,b,c)
method. (70505ff) - Added the Number
cubic_formula(a,b,c,d)
method. (ef6c16a) - Added the Number
cyclotomicmod(n,x,m)
method. (4c75c2d) - Added the Number
bellmod(n,m)
method. (502244c) - Added the Number
smooth_numbers(n, [p1, p2, ...], {|n,p| ... })
method. (d2c20fa) - Added the Number
digital_root(n,b=10)
method. (ce91e59) - Added the Number
modular_quadratic_formula(a,b,c,m)
method. (3619fbd) - Added the
Math.gcd_factors(n, array)
method. (bfc211b) - Added the Polynomial
derivative(f)
method. (ae33b89) - Added the String
.slices(n)
method. (6dfb5ff) - Added the Block
flush_cache
method. (169f7fe) - Added the Mod
chebyshevU
andchebyshevT
methods. (1365a3a) - REPL: added support for refering to previous output values. (50343bb)
Improvements
- Several optimizations in the Number class. (33984c6)
- Use Math::Prime::Util in
k.almost_prime_count(n)
andk.omega_prime_count(n)
for nativen
. (7ebdc6c) - Use
Math::Prime::Util::is_almost_prime()
for native integers in Numberis_almost_prime(n,k)
. (a4315a4) - Use
Math::Prime::Util::znorder()
inis_over_psp
for small prime factors. (0f061aa) - Use binary splitting in Number
sum
andprod
method for non-Number objects as well. (43a4856) - Significant optimization in Number
is_over_psp(n)
for numbers that are not overpseudoprimes. (cbd78be) - Optimization in Number
sumdigits(n,b)
anddigits(n,b)
for largen
and largeb
. (389d2c1) - Extended the Number
liouville_sum
method to accept an additional argument. (360f402) - Extended the Number
sum_remainders(n,v)
method to support negativev
. (55ddc2c) - Extended the Number
exp(n)
method to accept an additional argument. (30b1002) - Extended the String
.to_n
method to accept an optional argument. (7e0a93d) - Extended LazyMethod to handle the
run
method, in addition tocall
. (5914d6f) - Minor optimization in Number
all_prime(...)
when one of the terms is not prime. (f6e71b7)
Changes
sidef -t
: show at the end a list with the scripts that failed to run. (8c09720)- Check if we have a recent enough version of Math::Prime::Util. (e69bb7a)
- Support
(a/b) % m
when m is an integer andgcd(b, m) != 1
. (908ce38) - Prefer
Rmpz_bin_ui
overRmpz_bin_uiui
, as it is considerably faster, especially for largen
. (f7f3cf0) - Changed
#!/usr/bin/perl
to#!/usr/bin/env perl
in bin/sidef. (822cbb6)
Fixes
- Handle other types of Number objects in Number
mod
. (c016dea) - Handle the special case of x = -1 in
cyclotomic(n, x)
andcyclotomicmod(n,x)
. (83fe713) - Warn when no supported dbm driver was found, during
-s
. (6efa33d) - Include
array => 1
for Block slurpy array parameters. (954cf77) - Do exact division in
divmod(a,b,m)
whena
is exactly divisible byb
. (38fe855) - Allow calling
.uncache
on a function that was not cached. (dad21c5) - Fixed the conversion of Polynomial objects to Number objects (when possible). (3a69907)
All changes: 22.03...22.05
Version 22.03
Additions
- Added the Array
.solve_seq(offset=0)
method. (271f3b7) - Added the Array
random_permutation
method. (de2c93b) - Added the Array
.binsplit {|a,b| ... }
method. (146052b) - Added the Number
dop_factor(n)
method. (9b78ab8) - Added the Number
cop_factor(n)
method. (d20a5e2) - Added the Number
g.is_ntf(n)
method. (ce4fd9c) - Added the Number
sqrtQ(n)
method. (f9ffa4a) - Added the Number
gcud(...)
method. (2e1635e) - Added the Number
biudivisors(n)
method. (9c7ad77) - Added the Number
idivisors(n)
method. (a59e5e3) - Added the Number
edivisors(n)
method. (0376e6b) - Added the Number
k.power_usigma(n, j=1)
andk.power_usigma0(n)
methods. (c988c29) - Added the Number
k.powerfree_sigma(n,j=1)
andk.powerfree_sigma0(n)
methods. (fed2160) - Added the Number
k.power_sigma(n, j=1)
andk.power_sigma0(n)
methods. (dc80627) - Added the Number
k.powerfree_udivisors(n)
method. (ab740cf) - Added the Number
k.powerfree_usigma(n, j=1)
andk.powerfree_usigma0(n)
method. (b13a1b9) - Added the Number
perfect_power_divisors(n)
andperfect_power_udivisors(n)
methods. (cb6466f) - Added the Number
nbsigma(n, k=1)
andnbsigma0(n)
methods. (93d410a) - Added the Number
nesigma(n,k=1)
andnesigma0(n)
methods. (6a97cdd) - Added the Number
esigma(n,k=1)
andesigma0(n)
methods. (e8b32e3) - Added the Number
nisigma(n,k=1)
andnisigma0(n)
. (d467360) - Added the Number
isigma(n,k=1)
andisigma0(n)
methods. (38687ca) - Added the Number
bsigma(n,k=1)
andbisigma0(n)
methods. (5d62d88) - Added the Number
nusigma(n,k=1)
andnusigma0(n)
methods. (3bb7616) - Added the Number
next_squarefree(n)
method. (6dcb456) - Added the Number
n.prev_pow(b)
method. (c8e238f) - Added the Number
squarefree_part
alias forcore
. (e2a85c7) - Added the Number
k.powerfree_divisors(n)
method. (baed58f) - Added the Number
solve_lcg(n, r, m)
method. (efcdfad) - Added the Number
is_abs_euler_psp(n)
method. (2b7c01a) - Added the Polynomial
binomial(n,k)
method. (f78fd29) - Added the Polynomial
invmod(f, m)
method. (6d7c444) - Added the Polynomial
degree
method. (0707f43) - Added the Range
.while { ... }
method. (e486124) - Added the RangeNumber
mertens(a..b)
method. (eecf76f) - Added several RangeNumber
*_count
and*_sum
methods. (1201804) - Added the String
ascii2bin
andbin2ascii
methods. (00cb654) - Added the String
hexlify
andunhexlify
methods. (4613a60) - Added the
Math.batch_invmod(array, n)
method. (6730bcb) - Added the
Math.batch_gcd(list...)
method. (6730bcb) - Added the
Math.remainders(n, array)
method. (6730bcb) - Added the
Math.product_tree(list...)
method. (6730bcb)
Improvements
- Faster factorization of large integers with many small prime factors. (4b9567b)
- Optimization in Array
.differences(n)
. (2c014bc) - Optimization: use Math::Prime::Util for native integers in Number
is_semiprime
. (bb6ab26) - Extended the
lucas_factor(n,j)
method to try bothj=1
andj=-1
whenj
is not specified. (1c975fa) - Added more documentation. (1a2bd45, bf98fea, a7d3193, 906281f)
- Added support for calling a polynomial object with a value, just like a function. (2fb21f6)
- Several simplifications in the Number
chebyshev*
methods. (46946d0) - Improved the evaluation of polynomials. (6d7c444)
Changes
- Changed the order of arguments of
power_divisors
andpower_udivisors
. (cb6466f) - Make FileHandle
binmode
andautoflush
methods to return the self filehandle object. (53a286f) - Use
_adaptive_trial_factor()
in Numbertrial_factor(n)
when no additional argument is given. (25ca896)
Fixes
- Fixed the implementation of FileHandle
syswrite()
. (fa038c1) - Fixed the Number
legendre_phi(n,a)
function. (4156a52) - Fixed two corner-cases in Number
iquadratic_formula()
(8f34c93) - Fixed Quadratic binary operations on objects with different
w
values. (4b08705) - Create the Sidef config directory when it doesn't exist. (062fbdb)
- Prevent an infinite loop in Array
div(a,n)
method. (6448fd6) - Added several missing methods in the Fraction, Mod and Polynomial classes. (3513247)
All changes: 3.99...22.03
Version 3.99
Additions
- Added the Polynomial built-in class. (e8fdf45, 7f71257, 5db0b7d)
- Added the
Fraction(a,b)
built-in class. (a7a9bd7) - Added the Number
sqrtmod_all(a, n)
method. (28f024a) - Added the Number
hclassno(n)
method. (a0a89e8) - Added the Number
k.powerfree_part_sum(a,b)
method. (fc79ca7) - Added the Number
k.powerfree_part(n)
method. (46a3ee7) - Added the Number
k.powerfree_sum(a,b)
method. (74f03ed) - Added the Number
n.is_powerfree(k=2)
method. (c17985c) - Added the Number
k.powerfree_count(a,b)
method. (833629f) - Added the Number
power_divisors(n, k=nil)
method. (47628b3) - Added the Number
power_udivisors(n, k=nil)
method. (39d27de) - Added the Number
cube(x)
method. (cc3792c) - Added the Number
squares_r(n,k=2)
method. (70db758, 335b29f, 6e88d02) - Added the Number
fusc(n)
method. (edd22c6, d09a899) - Added the Number
rotate(n,k,b=10)
method. (362483b) - Added the Number
chebyshevTmod(n,x,m)
andchebyshevUmod(n,x,m)
methods. (5da6959) - Added the Number
each_composite(a,b, {...})
andcomposites(a,b)
methods. (c95a14c, ab16883) - Added the Number
n.prime_lower
andn.prime_upper
methods. (9df78d7) - Added the Number
sqrt_cfrac_period_each { ... }
method. (ea9f942) - Added the Number
faulhaber_range(a, b, k)
method. (99e7ca4) - Added the Enumerator
.count { ... }
method. (3f568c1) - Added the Enumerator
.while { ... }
method. (1ed3dd9) - Added the RangeNumber
composites(a..b)
method. (d043243) - Added the RangeNumber
each_composite(a..b, {...})
method. (c95a14c) - Added the Lazy
.while { ... }
method. (67c4921)
Improvements
- Extended some Number methods to return a Polynomial object when
x
is omitted. (1e624c0, ff0ac89) - Extended the Number
sigma(n, k)
method to support negativek
. (00f083f) - Extended the Number
squarefree_sum
method to accept two arguments. (74f03ed) - Extended the Array
.contains
method to accept an arbitary long list of objects. (453ed55) - Extended the Enumerator
.first
method, to support an optional Block. (b5a12c8) - Minor performance improvements and simplifications in the Number class. (54bc482, 087e1f2)
- Use
#
as class-method separator in error messages (when a method is not found). (129f479) - Optimizations in Number
chebyshevU(n,x)
andchebyshevT(n,x)
whenx
is an integer. (29c48f0, 0c7b7fe) - Optimization: use
Math::Prime::Util::carmichael_lambda
for native integers in Numbercarmichael_lambda
. (2a552de) - Optimization: use
Math::Prime::Util::forsetproduct
in Arraycartesian
when no block is given. (6667622) - Added a lookup table for
prime(2**k)
for k up to 78. (10cad12) - Optimized Number
is_euler_pseudoprime(n, bases...)
for native integers. (f5bff56) - Extended Number
harmonic
andharmreal
method to accept an optional argument. (3ee4ba4) - Extended Block.exec() to accept optional arguments. (b3f38b2)
- Use
Math::Prime::Util
in Numberfactorialmod(n,m)
for native inputs (if available). (a1a8cb6)
Changes
- Changed the order of parameters in Number
smooth_count
andrough_count
methods. (0f7b113)
Fixes
- Allow unknown objects in Number
sum
andprod
methods. (d6a7a92) - Sidef module now uses
dbmopen()
instead oftie()
. (1a2019a) - subfactorial(n,k): return 0 when k > n and n >= 0. (18cac8b)
- Use less memory in Number
n.sumdigits(b)
for very large n. (83d1122) - Fixed
Hash ~~ Hash
: check for equality. (015692d) - No longer cache the value of
1/3
in cbrt for complex numbers. (1b511be) - Handle negative
n
inis_palindrome(n)
andnext_palindrome(n)
. (1bab26c) - Workaround in Number
sqrtmod(a, n)
whena
andn
are not coprime. (24a6fbd)
All changes: 3.98...3.99
Version 3.98
Commits to master since this release
Additions
- Added the Quaternion built-in class. (2997caf)
- Added the Number
n.omega_prime_divisors(k)
method. (6737ed3) - Added the Number
n.almost_prime_divisors(k)
method. (a8cc27e) - Added the Number
k.squarefree_almost_prime_count(a,b)
. (a236a25) - Added the Number
k.omega_prime_count(a, b)
method. (fa39c4f) - Added the Number
n.is_omega_prime(k)
method. (b8a2dbd) - Added the Number
k.omega_primes_each(a, b, { ... })
method. (ef78c06) - Added the Number
k.omega_primes(a,b)
method. (d496230) - Added the Number
k.powerful_each(lo, hi, {...})
method. (756bab0) - Added the Number
k.squarefree_almost_primes_each(a, b, { ... })
method. (0a48608) - Added the Number
k.squarefree_almost_primes(a, b)
method. (3ff722f) - Added the Number
k.almost_primes(lo, hi)
method. (7cd0365) - Added the Number
k.almost_primes_each(lo, hi, { ... })
method. (7cd0365) - Added the Number
n_composites(n, start=4)
method. (c3033ad) - Added the Number
sum_remainders(n, v)
method. (ad38eef) - Added the Number
legendre_phi(n,k)
method. (a6132f4) - Added the Number
expnorm(n, base=10)
method. (5a95197) - Added the Number
semiprimes(from, to)
method. (b0fafa6) - Added the Number
each_semiprime(from, to, { ... })
method. (b0fafa6) - Added the Number
inverse_{phi,psi,sigma}_{min,max}
methods. (8797a95) - Added the Number
squarefree_sum(n)
method. (775e7cb) - Added the Number
is_fibonacci(n)
method. (6b7d75f) - Added the Number
is_lucas(n)
method. (f301a82) - Added the Number
idiv_round(a,b)
method. (f4f6303) - Added the Number
idiv_ceil(a,b)
andidiv_trunc(a,b)
methods. (c0b36a0) - Added the RangeNumber
.each_squarefree_almost_prime(k, {...})
method. (14cd46e) - Added the RangeNumber
.each_omega_prime(k, {...})
method. (f336387) - Added the RangeNumber
semiprimes(a..b)
method. (5dc1ad9) - Added the RangeNumber
squarefree(a..b)
method. (d495066) - Added the RangeNumber
.each_semiprime {|k| say k })
method. (c183762) - Added the RangeNumber
.each_almost_prime(k, {...})
method. (89a23e4) - Added the RangeNumber
.each_powerful(k, { ... })
method. (f72c947) - Added the RangeNumber
.each_squarefree { ... }
method. (24ec1a6) - Added the RangeNumber
.each_prime { ... }
method. (eb39d4b)
Improvements
- Allow subset declarations to be used as types. (b2348d4)
- Documented all the Number methods. (189c4a3, 6e00037, 100560b)
- Extended Number
semiprime_count
to accept an additional argument. (cd06495) - Extended Number
composite_count
to accept two arguments. (2e6dabc) - Allow negative arguments in Number
znorder(a,m)
. (bd3e5eb) - Allow negative values of
P
inis_lucas{U,V}_psp(n, P, Q)
. (74b08bf) - Optimizations in
lucasUmod(P, Q, n, m)
andlucasVmod(P, Q, n, m)
whenP
andQ
are small. (fcb63fe) - Performance improvement in Number
squarefree_count(n)
for n > 2^40. (197215d, 775e7cb) - Performance improvements, by using
Math::Prime::Util
in more Number methods with native integers. (d8c0ad4)
Changes
- Changed the order of parameters in Number
powerful_count
. (eced3be) - Changed the order of parameters in Number
almost_prime_count
. (451db07) - Changed the order of parameters for the Number
powerful
method. (756bab0) - Changed the output for
RATIONAL % INT
. (180ac07) - Changes the output of
a // b
fromint(a/b)
tofloor(a/b)
. (8eaa5bf)
Fixes
- Changed all the
goto &Math::*
calls to regular function calls. (d12ab96) - Refactored the Number
sqrtmod
method and fixed some issues. (a6d101a) - Fixed the Number
inverse_{psi,phi,sigma}_len
methods when the result is not a native integer. (9519e84)
All changes: 3.97...3.98
Version 3.97.1
Version 3.97
Additions
- Added the
Quadratic(a, b, w)
built-in class. (aab0cef) - New octal syntax
0oddddd
, in addition to0ddddd
. (9d0d882) - Added the Number
flt_factor(n, tries=1e4)
method. (d52bb1f, d71de37) - Added the Number
sopf(n)
method. (b72282a) - Added the Number
n_primes(n, start=2)
method. (24ec447) - Added the Number
is_practical(n)
method. (aec0125) - Added the Number
inverse_psi_len(n)
method. (91b851f) - Added the Number
inverse_sigma_len(n,k=1)
method. (91b851f) - Added the Number
inverse_uphi(n)
method. (72979b7) - Added the Number
inverse_psi(n)
method. (2caa727) - Added the Number
inverse_usigma(n)
method. (8ede5f3, 0b6a52d) - Added the Number
ratmod(r,m)
method. (46b7315) - Added the Number
addmod(a,b,m)
,submod(a,b,m)
,mulmod(a,b,m)
anddivmod(a,b,m)
methods. (0ce927b) - Added the Number
miller_factor(n, tries=100)
method. (cd9d3ce) - Added the Number
lucas_factor(n, j=1, tries=100)
. method. (2d91cf5, 0207a89) - Added the Number
is_imprimitive_carmichael(n)
method. (d435c38) - Added the Number
is_lucasU_psp(n, P, Q)
andis_lucasV_psp(n, P, Q)
. (a32f812) - Added the Number
n.is_odd_composite
method. (a32f812) - Added the Number
is_overpseudoprime(n, b=2)
method. (2468b01) - Added the Number
quadratic_nonresidue(n)
method. (725721c) - Added the Number
rough_part(n,k)
method. (d14d1a8) - Added the Number
smooth_part(n,k)
method. (91444b8) - Added the Number
superprimorial(n)
method. (f31109e) - Added the Number
core(n)
method. (c6223a2) - Added the
Math.binsplit(block, arr...)
method. (f542064) - Added the String
parse_quotewords(str, delim, keep)
method. (eb1b5f6) - Added several String methods provided by
Text::Balanced
. (176bac8) - Added the Matrix
A.invmod(m)
method. (00a2187) - Added the
Math.smooth_numbers(primes...)
method. (b686cc8) - Added support for parsing complex numbers in Cartesian form. (ac5cddc)
- Added the Gauss
ratmod(n,m)
method. (b71808b)
Improvements
- Minor optimization in Number
is_safe_prime(n)
method. (08008d6) - Allow built-in classes to be redefined with extra parameters. (bee6726, 56bc50b)
- Performance improvement, by using
Math::Prime::Util::divisors()
for native integers. (dbc503c) - Extended the Number
inverse_sigma
method to support an optional argumentk
. (81afaa3) - Improved
Sys.read(TYPE, MESSAGE)
andSys.readln(MESSAGE)
to useTerm::ReadLine
. (716c634) - Optimization for comparison and equality checking of integers. (5357f88, d9b2d4e)
- Optimization in Number
digits(n,b)
forb
in the range[63, 2^32-1]
. (693309f) - Use
Math::Prime::Util::is_carmichael()
in Numberis_carmichael(n)
whenn
is a native integer. (eb77f21) - Use
Math::Prime::Util
in Numbersmooth_count()
andrough_count()
if available. (44c8500) - Optimizations in Number
moebius(n)
,powerful(n,k)
andpowerful_count(n,k)
. (3d5a2db) - Re-implemented
powmod(b, n, m)
andcomplex_powmod(a, b, n, m)
for better performance. (e025a0a) - Better performance in Number
is_carmichael(n)
. (e41428c) - Performance improvements in Number
is_lucas_carmichael(n)
. (8684653, 8c516be) - Better performance in Number
is_super_psp(n)
andis_over_psp(n)
. (9f6cd94, bb22a31) - Factorization optimizations in the Number class. (d58e0f6)
- Added some shorter aliases for several pseudoprime-testing methods. (8ae25b7)
- Extended
is_smooth(n,k)
andis_rough(n,k)
to accept arbitary largek
. (efb041f) - Extended the
Gauss
class with a few more methods. (c457924, 004e99a)
Changes
- Removed the
¦
alias for the pair ":" operator. (1e250bc) - Allow warnings in a
try
branch from atry/catch
construct. (fa0d91d) - Use
Math::GMPz::get_refcnt()
instead ofDevel::Peek::SvREFCNT()
. (8983478) znorder(Mod(a,b))
now returns a Number. (previously returned a Mod object) (e428c14)
Bug-fixes
- Return
0
forrad(0)
andcore(0)
. (50cfdfd)
All changes: 3.96...3.97
Version 3.96
Additions
- Added the built-in
Mod(a,m)
class. (af1b3f8, 83b884e) - Added the built-in
Gauss(re,im)
class. (694413d 0895026, be5317f) - Added the Number
power_count(n) method
. (36501ec) - Added the Number
next_twin_prime(n)
. (946c5e9) - Added the Number
next_palindrome(n, b=10)
method. (2ffe027) - Added the Number
random_safe_prime(bits)
method. (a0b952e) - Added the Number
is_gaussian_prime(a,b)
method. (1b974b7) - Added the Number
is_rough(n,k)
method. (a89eb79) - Added the Number
rough_count(n,k)
method. (5a543a2) - Added the Number
is_safe_prime(n)
method. (577bb5a) - Added the Number
smooth_count(n,k)
method. (fafc653, 4b6154c) - Added the Number
is_almost_prime(n,k)
method. (cbaaf31) - Added the Number
almost_prime_count(n,k)
method. (c46ec44) - Added the Number
dirichlet_hyperbola(n, f, g, F, G)
method. (8dd95d4) - Added the Number
bsearch_min(a,b, { ... })
method. (2f21cbf) - Added the Number
uphi(n)
method. (5da361e) - Added the Array
.differences(n=1)
method. (1f12152) - Added the Date
.valid_date(string, format)
method. (355be4b) - Added Unicode aliases for some number methods. (d28d575)
Improvements
- Optimizations in
faulhaber_sum(n,k)
. (e38aeba, c69551a) - Optimizations in Number
is_powerful(n,k)
for largen
. (13686f9) - Optimizations in Number
digits2num(base, digits)
. (6705e35) - Prefer
Math::Prime::Util::mertens(n)
if available. (71a7c49) - Minor simplifications inside the Optimizer. (c836155)
- Extended Number
powmod(b, n, m)
to support rational basesb
. (7623a5d) - Reduced overhead in some Number methods. (4375637)
Changes
- Removed the Number
modinv
alias forinvmod
. (a8b1397)
Bug-fixes
- Support conversion of Bool values to Number. (b26bda8)
All changes: 3.95...3.96
Version 3.95
Additions
- Added the
Date
built-in type, to work with dates. (9399bbc) - Added support for scalar context, provided by the unary
+
operator. (09dc805) - Added the Number
is_cyclic(n)
method. (37b82a7) - Added the Number
n.primitive_part(f)
method. (634a98a, 5f4ff4e) - Added the Number
powerful(n,k=2)
method. (88c7fc9) - Added the Number
powerful_count(n, k=2)
method. (b4385e6) - Added the Number
each_prime(from, to, { ... })
method. (8bd9252) - Added the Number
bits(n)
method, which returns the binary digits ofn
. (9b74dc9) - Added the Number
squarefree(from, to)
method. (9146ec4) - Added the Number
each_squarefree(from, to, {...})
method. (9146ec4) - Added the Range
each_slice
,each_cons
,map_slice
andmap_cons
methods. (08a79a7) - Added the behavior of
-w
and-W
in the generated code. (826c769)
Improvements
- Optimizations in
each_slice
,each_cons
,map_slice
andmap_cons
. (08a79a7, dca04b0) - Faster algorithm in Number
make_coprime(a,b)
. (59ba2a9) - Minor simplifications in the Number class. (be22ed5)
- Minor performance improvements in Number
is_lucas_carmichael(n)
. (b2d02a2) - Minor internal optimization in the creation of Hash objects. (08f1d49)
- Slightly better performance in Number
trial_factor(n,k)
. (9e51c91, 9a7c252) - Extended the Number
.is_powerful
to accept an optional argument. (a9ee071) - Extended the modular Lucas sequences
U_n(P, Q)
andV_n(P, Q)
to support arbitrarily largeP
andQ
. (7495f39)
Changes
- Changed the Array
^
,|
,&
and-
operators. (805f2c3)
Bug-fixes
- Fixed a minor issue in String
num
. (7c56b11) - Minor fix in the parsing of the ternary operator. (3dadcab)
- Allow prefix method-calls in class
has
variables. (98fdc39) - UTF-8 encoding/decoding in
File
andDir
classes. (e967c94)
All changes: 3.90...3.95
Version 3.90
I'm happy to announce today a new release of Sidef, which includes many new methods and several big performance improvements.
Happy Newton Day!
Additions
- Added the Array
.run_length
method. (b5a7558) - Added the Array
.segment_by { ... }
method. (968c96f) - Added the Array
.all_prime
and.all_composite
methods. (efdddd2) - Added the Array
.split(obj)
method. (baf967d) - Added the Array
.join_insert(obj)
method. (131b84b) - Added the Array
.next_permutation
method. (8df2909) - Added the Array
.unique_permutations
method. (8df2909, 5f5b9e6) - Added the Block
sum
andprod
methods. (17ef14b) - Added the Block
compose(f,g)
method (also aliased as*
and∘
) (f9298eb, 972ef55) - Added the Number
nth_semiprime(n)
method. (680509c) - Added the Number
semiprime_count(n)
method. (887fd3e) - Added the Number
is_pell_lucas_pseudoprime(n)
method. (b856992) - Added the Number
is_pell_pseudoprime(n)
method. (8d8dd7a) - Added the Number
is_bruckman_lucas_pseudoprime(n)
method. (e8f21d0) - Added the Number
is_strong_fibonacci_pseudoprime(n)
method. (cf7cd20) - Added the Number
is_lucas_carmichael(n)
method. (f0926c2) - Added the Number
is_chebyshev_pseudoprime(n)
method. (c50c51f) - Added the Number
is_palindrome(n, b=10)
method. (5219b68) - Added the Number
is_super_pseudoprime(n, *bases)
method. (ce55a1a) - Added the Number
motzkin(n)
method. (a512c2f, c1b53bc) - Added the Number
n.first { ... }
method. (e2a1e94) - Added the Number
next_composite(n)
method. (bd5ddc7) - Added the Number
reverse(n, b=10)
method. (0bba2b2, 37bf7e4) - Added the Number
all_prime(...)
andall_composite(...)
methods. (efdddd2) - Added the Number
bsearch_inverse(min, max, {|x| f(x) <=> value })
method. (8573002) - Added the Number
inverse_sigma(n)
method. (17682d7, ec6590f) - Added the Number
liouville_sum(n)
function. (31d1e6d) - Added the Number
is_abundant(n)
method. (2135860) - Added the Number
nth_composite(n)
andcomposite_count(n)
methods. (5029ecb) - Added the RangeNum
lcm
,lcm_by{...}
,gcd
andgcd_by{...}
methods. (845e61c) - Added the
Sys.kill()
method, to kill a list of precesses. (ff99285) - Added the
<~>
approximate comparison operator (alias forapprox_cmp
). (7f9680f)
Improvements
- Redirected
phi(n)
toeuler_phi(n)
. (afdb173) - Adjustments in Number
lpf(n)
for smalln
(<= ULONG_MAX). (b20108f) - Improvements in Number
lpf(n)
for numbers with less than 45 digits. (61b71cf) - Optimizations in the
RangeNum
class (+cache for small values). (0527937) - Try to reuse mpz objects that are about to be destoryed. (807d371)
- Minor performance improvement in Number
is_squarefree(n)
. (04dc41b) - Also consider the ternary operator for constant folding at -O1. (a3b8904)
- Added a pre-test in Number
is_squarefree(n)
for relatively largen
. (176860b) - Also apply -O1 optimzation to included files. (3de1b0b)
- Optimization in Number
cyclotomic_polynomial(n,x)
. (4c0f4d2, 20a17fa) - Optimization in Number
sum(a,b,c,...)
for integer arguments. (82d6bad)
Changes
- Renamed the Array
.split
method to.segment
. (baf967d)
Bug-fixes
- Minor fix inside the parser. (d73ec32)
- No longer modify Lazy objects in-place. (806e466)
- Parse numerical values exactly when converting them from Perl to Sidef. (80d3ea6)
- When
n
is not given to Block.first
, return the first element. (60ae5b8) - Backtrack whitespace after a
try {...}
statement without acatch {...}
block. (b8eed34)
All changes: 3.85...3.90
Version 3.85
Additions
- Added several String testing methods. (814089e)
- Added the Array
.map_slice(k, {...})
method. (a285367) - Added the Array
.cfrac2num
method. (abcbcbe) - Added the Array
.sum_2d{}
and.prod_2d{}
methods. (420b0cf) - Added the RangeNum
primes
method. (a4a6c6a, 5eff247) - Added the DirHandle
.files
and.dirs
methods. (2485904) - Added the Bag
.map_kv {...}
and.grep_kv {...}
methods. (98614cd) - Added the Set
.sum
,.sum_by{}
and.sum_2d{}
methods. (420b0cf) - Added the Set
.prod
,.prod_by{}
and.prod_2d{}
methods. (420b0cf) - Added the Number
pn_primes(n)
method. (a4815ce) - Added the Number
.is_power_of(b)
, whereb
is a given base. (18155b3) - Added the Number
primality_pretest(n)
method. (23b911f) - Added the Number
primorial_inflation(n)
andprimorial_deflation(n)
methods. (6529f3e)
Improvements
- Faster (subquadratic-time) algorithm in Number
.digits(base)
. (4d7b666) - Faster (subquadratic-time) algorithm in Number
.sumdigits(base)
. (2f98913) - Faster (subquadratic-time) algorithm in Array
.digits2num(base)
. (70f6e47) - Better performance in Number
n.trial_factor(k)
for many largen
and fixedk
. (defdbc8) - Performance improvements in Number
lpf(n)
. (66200dc) - Slightly faster conversion of integer strings into numbers. (9e805cf)
- Allow numbers to be separated by commas in
%n(...)
and%i(...)
. (5068296) - Extended the Number
.length
method to accept an optional base. (19c8576) - Extended the Number
.divisors
method accept an optional argument. (668a205) - Extended the Number
.is_prob_squarefree
method to work with only one argument. (a0e6d24) - Added a fast primality pretest for large values of
n
passed tois_prime
. (9ad6ed3, 384cf3e)
Bug-fixes
- Fixed the Array
.flat
method to support cyclic references. (c1e7471) - Backtrack whitespace after parsing of an
import
statement. (#104) (2a9e784) - Fixed the position of the pointer in some parser-error messages. (890ed44, 0d1dc25)
All changes: 3.80...3.85