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
- Grouped
- Alphabetic
- By Inheritance
- Dense
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
*[A <: Dense, B <: Dense] = Dense.*.B.Match[Dense._42.type.Karatsuba[B, DNil.type], DNil.type, Dense] forSome {val _42: A}
Alias for multiplying two dense numbers
Alias for multiplying two dense numbers
Author:
Harshad Deo
- Since
0.1
-
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
-
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
-
type
<[A <: Dense, B <: Dense] = Dense.CompareC.Match[True.type, False.type, False.type, 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
-
type
<=[A <: Dense, B <: Dense] = Dense.CompareC.Match[True.type, True.type, False.type, 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
-
type
===[A <: Dense, B <: Dense] = Dense.CompareC.Match[False.type, True.type, False.type, 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
-
type
>[A <: Dense, B <: Dense] = Dense.CompareC.Match[False.type, False.type, True.type, 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
-
type
>=[A <: Dense, B <: Dense] = Dense.CompareC.Match[False.type, True.type, True.type, 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
-
type
Compare[A <: Dense, B <: Dense] = Dense.Compare.A.CompareC[B, EQ.type]
Alias for comparing to dense numbers
Alias for comparing to dense numbers
Author:
Harshad Deo
- Since
0.1
-
trait
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
-
trait
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
-
trait
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
-
class
DenseRep
[D] extends AnyRef
Builda a value level representation of a dense type.
Builda a value level representation of a dense type.
Author:
Harshad Deo
- D
Type to be converted to a value
- Since
0.1
-
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
-
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
-
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
-
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
-
type
^[A <: Dense, B <: Dense] = Dense.^.B.ExpHelper[A, DCons[D1, DNil.type]]
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
-
type
_0 = DNil.type
Dense 0
Dense 0
Author:
Harshad Deo
- Since
0.1
-
type
_1 = DCons[D1, DNil]
Dense 1
Dense 1
Author:
Harshad Deo
- Since
0.1
-
type
_10 = DCons[D0, ::[D1, ::[D0, ::[D1, DNil]]]]
Dense 10
Dense 10
Author:
Harshad Deo
- Since
0.1
-
type
_11 = DCons[D1, ::[D1, ::[D0, ::[D1, DNil]]]]
Dense 11
Dense 11
Author:
Harshad Deo
- Since
0.1
-
type
_12 = DCons[D0, ::[D0, ::[D1, ::[D1, DNil]]]]
Dense 12
Dense 12
Author:
Harshad Deo
- Since
0.1
-
type
_13 = DCons[D1, ::[D0, ::[D1, ::[D1, DNil]]]]
Dense 13
Dense 13
Author:
Harshad Deo
- Since
0.1
-
type
_14 = DCons[D0, ::[D1, ::[D1, ::[D1, DNil]]]]
Dense 14
Dense 14
Author:
Harshad Deo
- Since
0.1
-
type
_15 = DCons[D1, ::[D1, ::[D1, ::[D1, DNil]]]]
Dense 15
Dense 15
Author:
Harshad Deo
- Since
0.1
-
type
_16 = DCons[D0, ::[D0, ::[D0, ::[D0, ::[D1, DNil]]]]]
Dense 16
Dense 16
Author:
Harshad Deo
- Since
0.1
-
type
_17 = DCons[D1, ::[D0, ::[D0, ::[D0, ::[D1, DNil]]]]]
Dense 17
Dense 17
Author:
Harshad Deo
- Since
0.1
-
type
_18 = DCons[D0, ::[D1, ::[D0, ::[D0, ::[D1, DNil]]]]]
Dense 18
Dense 18
Author:
Harshad Deo
- Since
0.1
-
type
_19 = DCons[D1, ::[D1, ::[D0, ::[D0, ::[D1, DNil]]]]]
Dense 19
Dense 19
Author:
Harshad Deo
- Since
0.1
-
type
_2 = DCons[D0, ::[D1, DNil]]
Dense 2
Dense 2
Author:
Harshad Deo
- Since
0.1
-
type
_20 = DCons[D0, ::[D0, ::[D1, ::[D0, ::[D1, DNil]]]]]
Dense 20
Dense 20
Author:
Harshad Deo
- Since
0.1
-
type
_21 = DCons[D1, ::[D0, ::[D1, ::[D0, ::[D1, DNil]]]]]
Dense 21
Dense 21
Author:
Harshad Deo
- Since
0.1
-
type
_22 = DCons[D0, ::[D1, ::[D1, ::[D0, ::[D1, DNil]]]]]
Dense 22
Dense 22
Author:
Harshad Deo
- Since
0.1
-
type
_3 = DCons[D1, ::[D1, DNil]]
Dense 3
Dense 3
Author:
Harshad Deo
- Since
0.1
-
type
_4 = DCons[D0, ::[D0, ::[D1, DNil]]]
Dense 4
Dense 4
Author:
Harshad Deo
- Since
0.1
-
type
_5 = DCons[D1, ::[D0, ::[D1, DNil]]]
Dense 5
Dense 5
Author:
Harshad Deo
- Since
0.1
-
type
_6 = DCons[D0, ::[D1, ::[D1, DNil]]]
Dense 6
Dense 6
Author:
Harshad Deo
- Since
0.1
-
type
_7 = DCons[D1, ::[D1, ::[D1, DNil]]]
Dense 7
Dense 7
Author:
Harshad Deo
- Since
0.1
-
type
_8 = DCons[D0, ::[D0, ::[D0, ::[D1, DNil]]]]
Dense 8
Dense 8
Author:
Harshad Deo
- Since
0.1
-
type
_9 = DCons[D1, ::[D0, ::[D0, ::[D1, DNil]]]]
Dense 9
Dense 9
Author:
Harshad Deo
- Since
0.1
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLong[D <: Dense](implicit dr: DenseRep[D]): Long
Builds value level representation of a Dense
Builds value level representation of a Dense
Author:
Harshad Deo
- D
Dense type to be converted to a value
- Since
0.1
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
object
DNil
extends Dense
Dense Zero
Dense Zero
Author:
Harshad Deo
- Since
0.1
-
object
DenseRep
Contains implicit definitions to build the value level representation of a dense type
Contains implicit definitions to build the value level representation of a dense type
Author:
Harshad Deo
- Since
0.1