|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--HFE.Poly4MultiLinear
This class provides polynomials of degree one in n independent variables.
The polynomials are over the finite field F_4 which is
provided in the class Field4
.
Field Summary | |
private int[] |
coeff
Coefficients for the variables. |
private int |
varNum
The number of variables in this polynomial. |
Constructor Summary | |
Poly4MultiLinear()
sets all the coefficients to zero assumes that the polynomial has no variables |
|
Poly4MultiLinear(int varNum)
Sets all the coefficients to zero by allocating new memory. |
|
Poly4MultiLinear(int[] inArray)
array2poly(int[]) |
|
Poly4MultiLinear(int varNum,
int[] inArray)
Creates a new object by using inArray for the coefficients. |
|
Poly4MultiLinear(Poly4MultiLinear father)
Creates a copy from the given polynomial. |
Method Summary | |
void |
add(Poly4MultiLinear whom)
calculate this += whom as polynomial addition |
void |
add(Poly4MultiLinear a,
Poly4MultiLinear b)
calculates this = a + b as polynomial addition |
int |
apply(int[] values)
Evaluate the polynomial using the given value vector The entry value[0] is _not_ uses, value[1] is the first valid entry. |
static int |
apply(int[] coeffs,
int[] values)
Evaluate the polynomial using the given value vector and the given coefficient vector. |
void |
array2poly(int[] inArray)
Sets the coefficients using the given coefficient. |
int |
coeff(int which)
Returns the coefficient for a given variable. |
int[] |
coeffs()
returns the coefficient array without copying it. |
void |
divFactor(int factor)
divides all coefficients by the given factor in F_4. |
int |
giveVarNum()
returns the number of variables for that object |
void |
initMem()
Allocates new memory for the coefficients. |
boolean |
isEqual(Poly4MultiLinear whom)
Compares this and whom coefficientwise. |
boolean |
isZero()
Checks if the polynomial is the zero polynomial. |
static void |
main(java.lang.String[] args)
Mainly invoces the testIt() method. |
void |
mulAdd(int factor,
Poly4MultiLinear whom)
this += factor*whom. |
void |
mulFactor(int factor)
multiplies all coefficients by the given factor in F_4. |
void |
setCoeffs(int[] inArray)
Sets all the coefficients by the given array. |
void |
setZero()
Sets all the coefficients to zero |
void |
sub(Poly4MultiLinear whom)
calculate this -= whom as polynomial subtraction |
void |
sub(Poly4MultiLinear a,
Poly4MultiLinear b)
calculates this = a - b as polynomial subtraction |
static void |
testIt()
Tests the functionality for the whole class. |
void |
writeString()
Writes the polynomial as a string to stdout |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int varNum
private int[] coeff
varNum
. Position 0
is for the constant term.Constructor Detail |
public Poly4MultiLinear()
public Poly4MultiLinear(int varNum)
varNum
- number of variables for that polynomialpublic Poly4MultiLinear(Poly4MultiLinear father)
public Poly4MultiLinear(int[] inArray)
array2poly(int[])
public Poly4MultiLinear(int varNum, int[] inArray)
varNum
- number of variables for this objectinArray
- coefficients for the multivaribale polynomialMethod Detail |
public int coeff(int which)
public int[] coeffs()
public int giveVarNum()
public boolean isEqual(Poly4MultiLinear whom)
public boolean isZero()
public void setZero()
public void initMem()
public void setCoeffs(int[] inArray)
public void array2poly(int[] inArray)
IllegalArgumentException:
- array has the wrong length, needs to be (varNum+1)public void mulFactor(int factor)
public void divFactor(int factor)
public void mulAdd(int factor, Poly4MultiLinear whom)
public void add(Poly4MultiLinear a, Poly4MultiLinear b)
public void add(Poly4MultiLinear whom)
public void sub(Poly4MultiLinear a, Poly4MultiLinear b)
public void sub(Poly4MultiLinear whom)
public int apply(int[] values)
values
- array with varNum+1 entriespublic static int apply(int[] coeffs, int[] values)
coeffs
- coefficients of a multivariable, linear polynomialvalues
- values for the variables of the polynomial, value[1] is the value for the first variable, ...public void writeString()
public static void testIt()
public static void main(java.lang.String[] args)
testIt()
method.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |