@@ -463,9 +463,9 @@ ratio(x::Integer,y::Integer) = iszero(rem(x,y)) ? div(x,y) : x//y
463
463
ratio (x:: Rat ,y:: Rat ) = x// y
464
464
function maybe_intcoeff (x)
465
465
if ismul (x)
466
- coeff = coeff (x)
467
- if coeff isa Rational && isone (denominator (coeff ))
468
- _Mul (symtype (x), coeff . num, dict (x); metadata = x. metadata)
466
+ coefficient = coeff (x)
467
+ if coefficient isa Rational && isone (denominator (coefficient ))
468
+ _Mul (symtype (x), coefficient . num, dict (x); metadata = x. metadata)
469
469
else
470
470
x
471
471
end
@@ -566,16 +566,16 @@ $(SIGNATURES)
566
566
Any Muls inside an Add should always have a coeff of 1
567
567
and the key (in Add) should instead be used to store the actual coefficient
568
568
"""
569
- function makeadd (sign, coeff , xs... )
569
+ function makeadd (sign, coefficient , xs... )
570
570
d = Dict {BasicSymbolic, Any} ()
571
571
for x in xs
572
572
if isadd (x)
573
- coeff += coeff (x)
573
+ coefficient += coeff (x)
574
574
_merge! (+ , d, dict (x), filter = _iszero)
575
575
continue
576
576
end
577
577
if x isa Number
578
- coeff += x
578
+ coefficient += x
579
579
continue
580
580
end
581
581
if ismul (x)
@@ -591,17 +591,17 @@ function makeadd(sign, coeff, xs...)
591
591
d[k] = v
592
592
end
593
593
end
594
- coeff , d
594
+ coefficient , d
595
595
end
596
596
597
- function makemul (coeff , xs... ; d = Dict {BasicSymbolic, Any} ())
597
+ function makemul (coefficient , xs... ; d = Dict {BasicSymbolic, Any} ())
598
598
for x in xs
599
599
if ispow (x) && x. impl. exp isa Number
600
600
d[x. impl. base] = x. impl. exp + get (d, x. impl. base, 0 )
601
601
elseif x isa Number
602
- coeff *= x
602
+ coefficient *= x
603
603
elseif ismul (x)
604
- coeff *= coeff (x)
604
+ coefficient *= coeff (x)
605
605
_merge! (+ , d, dict (x), filter = _iszero)
606
606
else
607
607
v = 1 + get (d, x, 0 )
@@ -612,7 +612,7 @@ function makemul(coeff, xs...; d = Dict{BasicSymbolic, Any}())
612
612
end
613
613
end
614
614
end
615
- coeff , d
615
+ coefficient , d
616
616
end
617
617
618
618
unstable_pow (a, b) = a isa Integer && b isa Integer ? (a // 1 )^ b : a^ b
@@ -1229,13 +1229,13 @@ function +(a::SN, b::SN)
1229
1229
return _Add (
1230
1230
add_t (a, b), coeff (a) + coeff (b), _merge (+ , dict (a), dict (b), filter = _iszero))
1231
1231
elseif isadd (a)
1232
- coeff, dict = makeadd (1 , 0 , b)
1233
- return _Add (add_t (a, b), coeff (a) + coeff , _merge (+ , dict (a), dict , filter = _iszero))
1232
+ coefficient, dictionary = makeadd (1 , 0 , b)
1233
+ return _Add (add_t (a, b), coeff (a) + coefficient , _merge (+ , dict (a), dictionary , filter = _iszero))
1234
1234
elseif isadd (b)
1235
1235
return b + a
1236
1236
end
1237
- coeff, dict = makeadd (1 , 0 , a, b)
1238
- _Add (add_t (a, b), coeff, dict )
1237
+ coefficient, dictionary = makeadd (1 , 0 , a, b)
1238
+ _Add (add_t (a, b), coefficient, dictionary )
1239
1239
end
1240
1240
function + (a:: Number , b:: SN )
1241
1241
if isconst (b)
@@ -1354,9 +1354,9 @@ function ^(a::SN, b)
1354
1354
elseif b isa Number && b < 0
1355
1355
_Div (1 , a^ (- b))
1356
1356
elseif ismul (a) && b isa Number
1357
- coeff = unstable_pow (coeff (a), b)
1357
+ coefficient = unstable_pow (coeff (a), b)
1358
1358
_Mul (promote_symtype (^ , symtype (a), symtype (b)),
1359
- coeff , mapvalues ((k, v) -> b * v, dict (a)))
1359
+ coefficient , mapvalues ((k, v) -> b * v, dict (a)))
1360
1360
else
1361
1361
_Pow (a, b)
1362
1362
end
0 commit comments