Package edu.jas.structure
Class Power<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.structure.Power<C>
-
-
Constructor Summary
Constructors Constructor Description Power()
The constructor creates a Power object.Power(RingFactory<C> fac)
The constructor creates a Power object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <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, java.math.BigInteger n, C m)
power of a to the n-th, n positive, modulo m.C
modPower(C a, long n, C m)
power of a to the n-th mod m.C
modPower(C a, java.math.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, java.math.BigInteger n, C m)
power of a to the n-th modulo m.static <C extends MonoidElem<C>>
Cmultiply(MonoidFactory<C> fac, java.util.List<C> A)
Multiply elements in list.static <C extends RingElem<C>>
Cmultiply(RingFactory<C> fac, java.util.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, java.math.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.C
power(C a, long n)
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, java.util.List<C> A)
Sum elements in list.static <C extends RingElem<C>>
Csum(RingFactory<C> fac, java.util.List<C> A)
Sum elements in list.
-
-
-
Constructor Detail
-
Power
public Power()
The constructor creates a Power object.
-
Power
public Power(RingFactory<C> fac)
The constructor creates a Power object.- Parameters:
fac
- ring factory
-
-
Method Detail
-
positivePower
public static <C extends RingElem<C>> C positivePower(C a, long n)
power of a to the n-th, n positive.- Parameters:
a
- element.n
- integer exponent ≥ 0.- Returns:
- a^n.
-
positivePower
public static <C extends RingElem<C>> C positivePower(C a, java.math.BigInteger n)
power of a to the n-th, n positive.- Parameters:
a
- element.n
- java.math.BigInteger exponent ≥ 0.- Returns:
- a^n.
-
modPositivePower
public static <C extends RingElem<C>> C modPositivePower(C a, long n, C m)
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
public static <C extends RingElem<C>> C modPositivePower(C a, java.math.BigInteger n, C m)
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
public static <C extends RingElem<C>> C power(RingFactory<C> fac, C a, long n)
power of a to the n-th.- Parameters:
a
- element.n
- integer exponent.fac
- ring factory.- Returns:
- a^n, with 0^0 = 0 and a^{-n} = {1/a}^n.
-
power
public static <C extends MonoidElem<C>> C power(MonoidFactory<C> fac, C a, long n)
power of a to the n-th.- Parameters:
a
- element.n
- integer exponent.fac
- monoid factory.- Returns:
- a^n, with a^{-n} = {1/a}^n.
-
modPower
public static <C extends MonoidElem<C>> C modPower(MonoidFactory<C> fac, C a, long n, C m)
power of a to the n-th modulo m.- Parameters:
a
- element.n
- integer exponent.m
- modulus.fac
- monoid factory.- Returns:
- a^n mod m, with a^{-n} = {1/a}^n.
-
modPower
public static <C extends MonoidElem<C>> C modPower(MonoidFactory<C> fac, C a, java.math.BigInteger n, C m)
power of a to the n-th modulo m.- Parameters:
a
- element.n
- integer exponent.m
- modulus.fac
- monoid factory.- Returns:
- a^n mod m, with a^{-n} = {1/a}^n.
-
power
public C power(C a, long n)
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
public C modPower(C a, long n, C m)
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
public C modPower(C a, java.math.BigInteger n, C m)
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
public static <C extends RingElem<C>> long logarithm(C p, C a)
Logarithm.- Parameters:
p
- logarithm base.a
- element.- Returns:
- k ≥ 1 minimal with p^k ≥ a.
-
logarithm
public static <C extends RingElem<C>> long logarithm(long p, long a)
Logarithm.- Parameters:
p
- logarithm base.a
- element.- Returns:
- k ≥ 1 minimal with p^k ≥ a.
-
multiply
public static <C extends RingElem<C>> C multiply(RingFactory<C> fac, java.util.List<C> A)
Multiply elements in list.- Parameters:
A
- list of elements (a_0,...,a_k).fac
- ring factory.- Returns:
- prod(i=0,...k) a_i.
-
multiply
public static <C extends MonoidElem<C>> C multiply(MonoidFactory<C> fac, java.util.List<C> A)
Multiply elements in list.- Parameters:
A
- list of elements (a_0,...,a_k).fac
- monoid factory.- Returns:
- prod(i=0,...k) a_i.
-
sum
public static <C extends RingElem<C>> C sum(RingFactory<C> fac, java.util.List<C> A)
Sum elements in list.- Parameters:
A
- list of elements (a_0,...,a_k).fac
- ring factory.- Returns:
- sum(i=0,...k) a_i.
-
sum
public static <C extends AbelianGroupElem<C>> C sum(AbelianGroupFactory<C> fac, java.util.List<C> A)
Sum elements in list.- Parameters:
A
- list of elements (a_0,...,a_k).fac
- monoid factory.- Returns:
- sum(i=0,...k) a_i.
-
-