edu.jas.structure
Class Power<C extends RingElem<C>>

java.lang.Object
  extended by edu.jas.structure.Power<C>

public class Power<C extends RingElem<C>>
extends java.lang.Object

Power class to compute powers of RingElem.

Author:
Heinz Kredel

Constructor Summary
Power()
          The constructor creates a Power object.
Power(RingFactory<C> fac)
          The constructor creates a Power object.
 
Method Summary
static
<C extends RingElem<C>>
C
positivePower(C a, long n)
          power of a to the n-th, n positive.
 C power(C a, long n)
          power of a to the n-th.
static
<C extends MonoidElem<C>>
C
power(MonoidFactory<C> fac, C a, long n)
          power of a to the n-th.
static
<C extends RingElem<C>>
C
power(RingFactory<C> fac, C a, long n)
          power of a to the n-th.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

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.
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.
Returns:
a^n, 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.