EPiC
Efficient Privacy-Preserving Counting for MapReduce
 All Classes Namespaces Functions Variables
Public Member Functions | Static Public Member Functions
common.Polynomial Class Reference

Provides an implementation for a univariate polynomial P(x). More...

List of all members.

Public Member Functions

 Polynomial (int highestDegree)
 Constructing the univariate polynomial with a given highest degree that the polynomial can have.
 Polynomial (BigInteger[] coefficients)
 Constructing the univariate polynomial with given coefficients in Java BigInteger type.
 Polynomial (int[] coefficients)
 Constructing the univariate polynomial with given coefficients in integer type.
int degree ()
 Returns the polynomial degree.
BigInteger getCoefficient (int degree)
 Returns coefficient corresponding the given degree.
BigInteger[] getCoefficients ()
 Returns all coefficients of the polynomial.
void setCoefficient (int degree, BigInteger coeff)
 Sets coefficient at a specified degree with given value in Java BigInteger type.
void setCoefficient (int degree, int coeff)
 Sets coefficient of a specified degree with given value in integer type.
BigInteger value (BigInteger x)
 Evaluates the polynomial at a given point.
Polynomial add (Polynomial p)
 Returns a new univariate polynomial as the sum of this polynomial and another polynomial.
Polynomial subtract (Polynomial p)
 Returns a new univariate polynomial as the result of subtracting this polynomial by another polynomial.
Polynomial negate ()
 Returns a new univariate polynomial by negating this polynomial.
Polynomial multiply (BigInteger k)
 Returns a new univariate polynomial by multiplying this polynomial with a scalar value in Java BigInteger type.
Polynomial multiply (int k)
 Returns a new univariate polynomial by multiplying this polynomial with a scalar value in integer type.
Polynomial multiply (Polynomial p)
 Returns a new univariate polynomial by multiplying this polynomial with another polynomial.
Polynomial pow (int exponent)
 Returns a new univariate polynomial as an exponentiation of this polynomial.
Polynomial mod (BigInteger m)
 Returns a new univariate polynomial by mod-ing all coefficients of this polynomial by a given modulus.
String toString ()
 Returns a string representing this polynomial.

Static Public Member Functions

static Polynomial createLagrange (int[] x, int i)
 Creates a univariate polynomial in Lagrange form.
static void main (String args[])
 For testing purpose.

Detailed Description

Provides an implementation for a univariate polynomial P(x).

Author:
vohuudtr

Constructor & Destructor Documentation

common.Polynomial.Polynomial ( int  highestDegree) [inline]

Constructing the univariate polynomial with a given highest degree that the polynomial can have.

At initialization, all coefficients are set to 0, and the polynomial degree is 0.

Parameters:
highestDegreethe highest degree.
common.Polynomial.Polynomial ( BigInteger[]  coefficients) [inline]

Constructing the univariate polynomial with given coefficients in Java BigInteger type.

The polynomial degree is determined based on the values of the given coefficients.

Parameters:
coefficientsgiven coefficients.
common.Polynomial.Polynomial ( int[]  coefficients) [inline]

Constructing the univariate polynomial with given coefficients in integer type.

The polynomial degree is determined based on the values of the given coefficients.

Parameters:
coefficientsgiven coefficients.

Member Function Documentation

Returns a new univariate polynomial as the sum of this polynomial and another polynomial.

Parameters:
panother polynomial.
Returns:
sum of the polynomials.
static Polynomial common.Polynomial.createLagrange ( int[]  x,
int  i 
) [inline, static]

Creates a univariate polynomial in Lagrange form.

$l_i(x) = \prod_{m \ne i} \frac{x-x_m}{x_i-x_m}$

Parameters:
xarray of all points $x_m$.
iindex $i$ of $x_i$.
int common.Polynomial.degree ( ) [inline]

Returns the polynomial degree.

Returns:
the polynomial degree.
BigInteger common.Polynomial.getCoefficient ( int  degree) [inline]

Returns coefficient corresponding the given degree.

Parameters:
degreedegree of the queried coefficient.
Returns:
the queried coefficient. If the queried degree is greater than the polynomial degree, 0 is returned.
BigInteger [] common.Polynomial.getCoefficients ( ) [inline]

Returns all coefficients of the polynomial.

Returns:
array of all coefficients.
static void common.Polynomial.main ( String  args[]) [inline, static]

For testing purpose.

Parameters:
args
Polynomial common.Polynomial.mod ( BigInteger  m) [inline]

Returns a new univariate polynomial by mod-ing all coefficients of this polynomial by a given modulus.

Parameters:
mthe modulus.
Returns:
result of the mod operation.
Polynomial common.Polynomial.multiply ( BigInteger  k) [inline]

Returns a new univariate polynomial by multiplying this polynomial with a scalar value in Java BigInteger type.

Parameters:
kscalar value.
Returns:
result of the multiplication.

Returns a new univariate polynomial by multiplying this polynomial with a scalar value in integer type.

Parameters:
kscalar value.
Returns:
result of the multiplication.

Returns a new univariate polynomial by multiplying this polynomial with another polynomial.

The multiplication is done among coefficients of two polynomials.

Parameters:
panother polynomial.
Returns:
result of the multiplication.

Returns a new univariate polynomial by negating this polynomial.

Returns:
the negation of this polynomial.
Polynomial common.Polynomial.pow ( int  exponent) [inline]

Returns a new univariate polynomial as an exponentiation of this polynomial.

Parameters:
exponentdesired exponent.
Returns:
result of the exponentiation.
void common.Polynomial.setCoefficient ( int  degree,
BigInteger  coeff 
) [inline]

Sets coefficient at a specified degree with given value in Java BigInteger type.

Parameters:
degreespecified degree.
coeffnew value for the coefficient.
void common.Polynomial.setCoefficient ( int  degree,
int  coeff 
) [inline]

Sets coefficient of a specified degree with given value in integer type.

Parameters:
degreespecified degree.
coeffnew value for the coefficient.

Returns a new univariate polynomial as the result of subtracting this polynomial by another polynomial.

Parameters:
panother polynomial.
Returns:
subtraction of this polynomial by another polynomial.
BigInteger common.Polynomial.value ( BigInteger  x) [inline]

Evaluates the polynomial at a given point.

Parameters:
xgiven value x.
Returns:
P(x).

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables