Package edu.jas.structure
Class Power<C extends RingElem<C>>
java.lang.Object
edu.jas.structure.Power<C>
Power class to compute powers of RingElem.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
private final RingFactory
<C> private static final org.apache.logging.log4j.Logger
-
Constructor Summary
ConstructorsConstructorDescriptionPower()
The constructor creates a Power object.Power
(RingFactory<C> fac) The constructor creates a Power object. -
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends RingElem<C>>
longlogarithm
(long p, long a) Logarithm.static <C extends RingElem<C>>
longlogarithm
(C p, C a) Logarithm.static <C extends RingElem<C>>
CmodPositivePower
(C a, long n, C m) power of a to the n-th, n positive, modulo m.static <C extends RingElem<C>>
CmodPositivePower
(C a, BigInteger n, C m) power of a to the n-th, n positive, modulo m.power of a to the n-th mod m.modPower
(C a, BigInteger n, C m) power of a to the n-th mod m.static <C extends MonoidElem<C>>
CmodPower
(MonoidFactory<C> fac, C a, long n, C m) power of a to the n-th modulo m.static <C extends MonoidElem<C>>
CmodPower
(MonoidFactory<C> fac, C a, BigInteger n, C m) power of a to the n-th modulo m.static <C extends MonoidElem<C>>
Cmultiply
(MonoidFactory<C> fac, List<C> A) Multiply elements in list.static <C extends RingElem<C>>
Cmultiply
(RingFactory<C> fac, List<C> A) Multiply elements in list.static <C extends RingElem<C>>
CpositivePower
(C a, long n) power of a to the n-th, n positive.static <C extends RingElem<C>>
CpositivePower
(C a, BigInteger n) power of a to the n-th, n positive.static long
power
(long a, long n) power of a to the n-th.power of a to the n-th.static <C extends MonoidElem<C>>
Cpower
(MonoidFactory<C> fac, C a, long n) power of a to the n-th.static <C extends RingElem<C>>
Cpower
(RingFactory<C> fac, C a, long n) power of a to the n-th.static <C extends AbelianGroupElem<C>>
Csum
(AbelianGroupFactory<C> fac, List<C> A) Sum elements in list.static <C extends RingElem<C>>
Csum
(RingFactory<C> fac, List<C> A) Sum elements in list.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug -
fac
-
-
Constructor Details
-
Power
public Power()The constructor creates a Power object. -
Power
The constructor creates a Power object.- Parameters:
fac
- ring factory
-
-
Method Details
-
positivePower
power of a to the n-th, n positive.- Parameters:
a
- element.n
- integer exponent ≥ 0.- Returns:
- a^n.
-
positivePower
power of a to the n-th, n positive.- Parameters:
a
- element.n
- java.math.BigInteger exponent ≥ 0.- Returns:
- a^n.
-
modPositivePower
power of a to the n-th, n positive, modulo m.- Parameters:
a
- element.n
- integer exponent ≥ 0.m
- modulus.- Returns:
- a^n mod m.
-
modPositivePower
power of a to the n-th, n positive, modulo m.- Parameters:
a
- element.n
- big integer exponent ≥ 0.m
- modulus.- Returns:
- a^n mod m.
-
power
power of a to the n-th.- Parameters:
fac
- ring factory.a
- element.n
- integer exponent.- Returns:
- a^n, with 0^0 = 0 and a^{-n} = {1/a}^n.
-
power
power of a to the n-th.- Parameters:
fac
- monoid factory.a
- element.n
- integer exponent.- Returns:
- a^n, with a^{-n} = {1/a}^n.
-
modPower
power of a to the n-th modulo m.- Parameters:
fac
- monoid factory.a
- element.n
- integer exponent.m
- modulus.- Returns:
- a^n mod m, with a^{-n} = {1/a}^n.
-
modPower
power of a to the n-th modulo m.- Parameters:
fac
- monoid factory.a
- element.n
- integer exponent.m
- modulus.- Returns:
- a^n mod m, with a^{-n} = {1/a}^n.
-
power
power of a to the n-th.- Parameters:
a
- element.n
- integer exponent.- Returns:
- a^n, with 0^0 = 0.
-
power
public static long power(long a, long n) power of a to the n-th.- Parameters:
a
- long.n
- integer exponent.- Returns:
- a^n, with a^0 = 1.
-
modPower
power of a to the n-th mod m.- Parameters:
a
- element.n
- integer exponent.m
- modulus.- Returns:
- a^n mod m, with 0^0 = 0.
-
modPower
power of a to the n-th mod m.- Parameters:
a
- element.n
- integer exponent.m
- modulus.- Returns:
- a^n mod m, with 0^0 = 0.
-
logarithm
Logarithm.- Parameters:
p
- logarithm base.a
- element.- Returns:
- k ≥ 1 minimal with p^k ≥ a.
-
logarithm
Logarithm.- Parameters:
p
- logarithm base.a
- element.- Returns:
- k ≥ 1 minimal with p^k ≥ a.
-
multiply
Multiply elements in list.- Parameters:
fac
- ring factory.A
- list of elements (a_0,...,a_k).- Returns:
- prod(i=0,...k) a_i.
-
multiply
Multiply elements in list.- Parameters:
fac
- monoid factory.A
- list of elements (a_0,...,a_k).- Returns:
- prod(i=0,...k) a_i.
-
sum
Sum elements in list.- Parameters:
fac
- ring factory.A
- list of elements (a_0,...,a_k).- Returns:
- sum(i=0,...k) a_i.
-
sum
Sum elements in list.- Parameters:
fac
- monoid factory.A
- list of elements (a_0,...,a_k).- Returns:
- sum(i=0,...k) a_i.
-