Packages

c

de.christofreichardt.scala.shamir

NewtonInterpolation

class NewtonInterpolation extends Tracing

Implements Newtons interpolation algorithm. All calculations will be carried out by finite field algebra.

Linear Supertypes
Tracing, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NewtonInterpolation
  2. Tracing
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new NewtonInterpolation(supportingPoints: IndexedSeq[(BigInt, BigInt)], prime: BigInt)

    Creates a new NewtonInterpolation by applying some supporting points and a prime number.

    Creates a new NewtonInterpolation by applying some supporting points and a prime number.

    supportingPoints

    some pairwise different supporting points

    prime

    a prime number

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. def computeCoefficients(): IndexedSeq[BigInt]

    Supporting points := (x(0), y(0)), ..., (x(n), y(n)).

    Supporting points := (x(0), y(0)), ..., (x(n), y(n)).

    Computes the newton coefficients c(n)...c(0) by dynamic programming.

            y(n) - c(0) - c(1)*(x(n) - x(0)) - ... - c(n-1)*((x(n) - x(0))*...*(x(n) - x(n-2))
    c(n) := ---------------------------------------------------------------------------------- (mod prime)
                                (x(n) - x(0))* ... *(x(n) - x(n-1))
    
            y(1) - c(0)
    c(1) := ----------- (mod prime)
            x(1) - x(0)
    
    c(0) := y(0) (mod prime)
    

    Following applies: (n + 1) == number of supporting points. This gives a polynom of degree n with (n + 1) Newton coefficients.

    returns

    the calculated newton coefficients

  7. val degree: Int

    n supporting points give a polynom of degree n - 1

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. def getCurrentTracer(): AbstractTracer

    Returns the present tracer for this object.

    Returns the present tracer for this object.

    returns

    the current tracer, by default the NullTracer

    Definition Classes
    NewtonInterpolationTracing
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def multiplyDifferences(i: Int, j: Int, xs: IndexedSeq[BigInt]): BigInt

    Computes below expression.

    Computes below expression.

      (x(i) - x(0))*(x(i) - x(1))* ... *(x(i) - x(j)), i > j
    

    Expressions of this form need to be evaluated during the calculation of the Newton coefficients.

    i

    references the x-ccordinate of a supporting point (always in minuend position)

    j

    denotes the upper index of the x-coordinates in subtrahend position

    returns

    the value of the term (mod prime)

  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. lazy val newtonPolynomial: NewtonPolynomial

    Creates lazily the NewtonPolynomial by computing the Newton Coefficients.

    Creates lazily the NewtonPolynomial by computing the Newton Coefficients. For the definition of a NewtonPolynomial with degree n - 1 we need only n - 1 x values projected from the supporting points whereas n of them are needed for the computation of the coefficients.

  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  19. def pairWiseDifferent(points: IndexedSeq[(BigInt, BigInt)]): Boolean
  20. val prime: BigInt
  21. val supportingPoints: IndexedSeq[(BigInt, BigInt)]
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    NewtonInterpolation → AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. def withTracer[T](resultType: String, callee: AnyRef, method: String)(block: => T): T

    Custom control structure for tracing of embraced code blocks.

    Custom control structure for tracing of embraced code blocks.

    T

    the actual type of the embraced code block

    resultType

    denotes the return type

    callee

    the call site

    method

    denotes the method signature

    block

    the embraced code block

    returns

    returns whatever block returns

    Definition Classes
    Tracing

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Tracing

Inherited from AnyRef

Inherited from Any

Ungrouped