object Dense

Contains implementation for Dense and typeconstructor aliases that make usage more pleasant

The operations can be shown to satisfy:

1. Additive commutativity: +[A, B] =:= +[B, A]

2. Additive associativity: +[A, +[B, C]] =:= +[+[A, B], C]

3. Additive identity: +[A, _0] =:= A =:= +[_0, A]

4. Multiplicative commutativity: *[A, B] =:= *[B, A]

5. Multiplicative associativity: *[A, *[B, C]] =:= *[*[A, B], C]

6. Multiplicative identity: *[A, _1] =:= A =:= *[_1, A]

7. Distributivity: *[A, +[B, C]] =:= +[*[A, B], *[A, C]]

8. Zero exponent: ^[A, _0] =:= _1

9. One exponent: ^[_1, A] =:= _1

10. Exponent Identity: ^[A, _1] =:= A

11. Exponent combination 1: *[^[A, B], ^[A, C]] =:= ^[A, *[B, C]]

12. Exponent combination 2: ^[^[A, B], C] =:= ^[A, *[B, C]]

13. Exponent combination 3: ^[*[A, B], C] =:= *[^[A, C], ^[B, C]]

14. Total Order

Author:

Harshad Deo

Since

0.1

Linear Supertypes
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Dense
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type *[A <: Dense, B <: Dense] = Dense.*.B.Match[Dense._1.type.Karatsuba[B, DNil], DNil, Dense] forSome {val _1: A}

    Alias for multiplying two dense numbers

    Alias for multiplying two dense numbers

    Author:

    Harshad Deo

    Since

    0.1

  2. type +[A <: Dense, B <: Dense] = Dense.+.A.Add[B]

    Alias for adding two dense number

    Alias for adding two dense number

    Author:

    Harshad Deo

    Since

    0.1

  3. type ::[H <: Digit, T <: Dense] = DCons[H, T]

    Builds a new dense number by consing a bit to an existing dense number.

    Builds a new dense number by consing a bit to an existing dense number. The consed bit is the lowest priority bit in the resulting number

    Author:

    Harshad Deo

    Since

    0.1

  4. type <[A <: Dense, B <: Dense] = Dense.CompareC.Match[True, False, False, Bool]

    Alias for checking if the first dense number is less than the second

    Alias for checking if the first dense number is less than the second

    Author:

    Harshad Deo

    Since

    0.1

  5. type <=[A <: Dense, B <: Dense] = Dense.CompareC.Match[True, True, False, Bool]

    Alias for checking whether the first dense number is less than or equal to the second

    Alias for checking whether the first dense number is less than or equal to the second

    Author:

    Harshad Deo

    Since

    0.1

  6. type ===[A <: Dense, B <: Dense] = Dense.CompareC.Match[False, True, False, Bool]

    Alias for checking if two dense numbers are equal

    Alias for checking if two dense numbers are equal

    Author:

    Harshad Deo

    Since

    0.1

  7. type >[A <: Dense, B <: Dense] = Dense.CompareC.Match[False, False, True, Bool]

    Alias for checking whether the first dense number is greater than the second

    Alias for checking whether the first dense number is greater than the second

    Author:

    Harshad Deo

    Since

    0.1

  8. type >=[A <: Dense, B <: Dense] = Dense.CompareC.Match[False, True, True, Bool]

    Alias for checking whether the first dense number is greater than or equal to the second

    Alias for checking whether the first dense number is greater than or equal to the second

    Author:

    Harshad Deo

    Since

    0.1

  9. type Compare[A <: Dense, B <: Dense] = Dense.Compare.A.CompareC[B, EQ]

    Alias for comparing to dense numbers

    Alias for comparing to dense numbers

    Author:

    Harshad Deo

    Since

    0.1

  10. final class D0 extends Digit

    Represents a 0 in the dense encoding of a natural number

    Represents a 0 in the dense encoding of a natural number

    Author:

    Harshad Deo

    Since

    0.1

  11. final class D1 extends Digit

    Represents a 1 in the dense encoding of a natural number

    Represents a 1 in the dense encoding of a natural number

    Author:

    Harshad Deo

    Since

    0.1

  12. final class DCons[d <: Digit, T <: Dense] extends Dense

    Non-zero dense number.

    Non-zero dense number. The digit is the least significant bit

    Author:

    Harshad Deo

    d

    Lowest priority bit

    T

    Rest of the bits, in decreasing order of priority

    Since

    0.1

  13. final class DNil extends Dense

    Dense Zero

    Dense Zero

    Author:

    Harshad Deo

    Since

    0.1

  14. final class DenseIntRep[D] extends AnyVal

    Builds a value level scala.Int representation of a dense type

    Builds a value level scala.Int representation of a dense type

    Author:

    Harshad Deo

    D

    Type to be converted to a value

    Since

    0.3.1

  15. final class DenseRep[D <: Dense] extends AnyVal

    Builds a value level scala.Long representation of a dense type.

    Builds a value level scala.Long representation of a dense type.

    Author:

    Harshad Deo

    D

    Type to be converted to a value

    Since

    0.1

  16. sealed trait Digit extends AnyRef

    Represents a digit in the dense encoding of a natural number

    Represents a digit in the dense encoding of a natural number

    Author:

    Harshad Deo

    Since

    0.1

  17. type Max[A <: Dense, B <: Dense] = Dense.CompareC.Match[B, A, A, Dense]

    Alias for determing the greatest of two dense numbers

    Alias for determing the greatest of two dense numbers

    Author:

    Harshad Deo

    Since

    0.1

  18. type Min[A <: Dense, B <: Dense] = Dense.CompareC.Match[A, A, B, Dense]

    Alias for determining the lease of two dense numbers

    Alias for determining the lease of two dense numbers

    Author:

    Harshad Deo

    Since

    0.1

  19. type Sq[A <: Dense] = Dense.Sq.A.Sq

    Alias for squaring a dense number.

    Alias for squaring a dense number. Makes the code more pleasant to read

    Author:

    Harshad Deo

    Since

    0.1

  20. type ^[A <: Dense, B <: Dense] = Dense.^.B.ExpHelper[A, DCons[D1, DNil]]

    Alias for raising the first Dense number to the power of the second

    Alias for raising the first Dense number to the power of the second

    Author:

    Harshad Deo

    Since

    0.1

  21. type _0 = DNil

    Dense 0

    Dense 0

    Author:

    Harshad Deo

    Since

    0.1

  22. type _1 = DCons[D1, DNil]

    Dense 1

    Dense 1

    Author:

    Harshad Deo

    Since

    0.1

  23. type _10 = DCons[D0, ::[D1, ::[D0, ::[D1, DNil]]]]

    Dense 10

    Dense 10

    Author:

    Harshad Deo

    Since

    0.1

  24. type _11 = DCons[D1, ::[D1, ::[D0, ::[D1, DNil]]]]

    Dense 11

    Dense 11

    Author:

    Harshad Deo

    Since

    0.1

  25. type _12 = DCons[D0, ::[D0, ::[D1, ::[D1, DNil]]]]

    Dense 12

    Dense 12

    Author:

    Harshad Deo

    Since

    0.1

  26. type _13 = DCons[D1, ::[D0, ::[D1, ::[D1, DNil]]]]

    Dense 13

    Dense 13

    Author:

    Harshad Deo

    Since

    0.1

  27. type _14 = DCons[D0, ::[D1, ::[D1, ::[D1, DNil]]]]

    Dense 14

    Dense 14

    Author:

    Harshad Deo

    Since

    0.1

  28. type _15 = DCons[D1, ::[D1, ::[D1, ::[D1, DNil]]]]

    Dense 15

    Dense 15

    Author:

    Harshad Deo

    Since

    0.1

  29. type _16 = DCons[D0, ::[D0, ::[D0, ::[D0, ::[D1, DNil]]]]]

    Dense 16

    Dense 16

    Author:

    Harshad Deo

    Since

    0.1

  30. type _17 = DCons[D1, ::[D0, ::[D0, ::[D0, ::[D1, DNil]]]]]

    Dense 17

    Dense 17

    Author:

    Harshad Deo

    Since

    0.1

  31. type _18 = DCons[D0, ::[D1, ::[D0, ::[D0, ::[D1, DNil]]]]]

    Dense 18

    Dense 18

    Author:

    Harshad Deo

    Since

    0.1

  32. type _19 = DCons[D1, ::[D1, ::[D0, ::[D0, ::[D1, DNil]]]]]

    Dense 19

    Dense 19

    Author:

    Harshad Deo

    Since

    0.1

  33. type _2 = DCons[D0, ::[D1, DNil]]

    Dense 2

    Dense 2

    Author:

    Harshad Deo

    Since

    0.1

  34. type _20 = DCons[D0, ::[D0, ::[D1, ::[D0, ::[D1, DNil]]]]]

    Dense 20

    Dense 20

    Author:

    Harshad Deo

    Since

    0.1

  35. type _21 = DCons[D1, ::[D0, ::[D1, ::[D0, ::[D1, DNil]]]]]

    Dense 21

    Dense 21

    Author:

    Harshad Deo

    Since

    0.1

  36. type _22 = DCons[D0, ::[D1, ::[D1, ::[D0, ::[D1, DNil]]]]]

    Dense 22

    Dense 22

    Author:

    Harshad Deo

    Since

    0.1

  37. type _3 = DCons[D1, ::[D1, DNil]]

    Dense 3

    Dense 3

    Author:

    Harshad Deo

    Since

    0.1

  38. type _4 = DCons[D0, ::[D0, ::[D1, DNil]]]

    Dense 4

    Dense 4

    Author:

    Harshad Deo

    Since

    0.1

  39. type _5 = DCons[D1, ::[D0, ::[D1, DNil]]]

    Dense 5

    Dense 5

    Author:

    Harshad Deo

    Since

    0.1

  40. type _6 = DCons[D0, ::[D1, ::[D1, DNil]]]

    Dense 6

    Dense 6

    Author:

    Harshad Deo

    Since

    0.1

  41. type _7 = DCons[D1, ::[D1, ::[D1, DNil]]]

    Dense 7

    Dense 7

    Author:

    Harshad Deo

    Since

    0.1

  42. type _8 = DCons[D0, ::[D0, ::[D0, ::[D1, DNil]]]]

    Dense 8

    Dense 8

    Author:

    Harshad Deo

    Since

    0.1

  43. type _9 = DCons[D1, ::[D0, ::[D0, ::[D1, DNil]]]]

    Dense 9

    Dense 9

    Author:

    Harshad Deo

    Since

    0.1

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() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toInt[D <: Dense](implicit dr: DenseIntRep[D]): Int

    Builds value level representation of a Dense as a scala.Int

    Builds value level representation of a Dense as a scala.Int

    Author:

    Harshad Deo

    D

    Dense type to be converted to a value

    Since

    0.3.1

  16. def toLong[D <: Dense](implicit dr: DenseRep[D]): Long

    Builds value level representation of a Dense as a scala.Long

    Builds value level representation of a Dense as a scala.Long

    Author:

    Harshad Deo

    D

    Dense type to be converted to a value

    Since

    0.1

  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. object DenseIntRep

    Contains implicit definitional to build a value level representation of a dense type as a scala.Int

    Contains implicit definitional to build a value level representation of a dense type as a scala.Int

    Author:

    Harshad Deo

    Since

    0.3.1

  22. object DenseRep

    Contains implicit definitions to build the value level representation of a dense type as a scala.Long

    Contains implicit definitions to build the value level representation of a dense type as a scala.Long

    Author:

    Harshad Deo

    Since

    0.1

Deprecated Value Members

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

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Implementation

Number aliases

Operations

Ungrouped