trait Scaling extends AnyRef
Scaling utilities.
Often, in order to avoid underflow, we can offload some of the exponent of a double into an int. To make things more efficient, we can actually share that exponent between doubles.
The scales used in this trait are in log space: they can be safely added and subtracted.
- Alphabetic
- By Inheritance
- Scaling
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete 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
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
def
computeScaleDelta(scores: Array[Double]): Int
Computes the log power of two we'd need to scale by so that the max double is between (2 ** scaleConstant, 2 ** -scaleConstant).
- def determineScale(score: Double, oldScale: Int): Int
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
scaleArray(scores: Array[Double], currentScale: Int): Int
Ensures that the max double is between (2**scaleConstant,2**-scaleConstant), scaling the array as necessary.
Ensures that the max double is between (2**scaleConstant,2**-scaleConstant), scaling the array as necessary.
- returns
newScale
- def scaleArrayToScale(scores: Array[Double], currentScale: Int, targetScale: Int): Unit
-
def
scaleValue(score: Double, currentScale: Int, targetScale: Int): Double
Converts the scaled value into "normal" space
-
def
sumArrays(src: Array[Double], srcScale: Int, dest: Array[Double], destScale: Int): Int
Sums
srcintodestassuming they're at different scales.Sums
srcintodestassuming they're at different scales.srcmay be longer thandest, which is useful for allocating a large work buffer.- returns
the new scale
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toLogSpace(score: Double, currentScale: Int): Double
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unscaleValue(score: Double, currentScale: Int): Double
Converts the scaled value into "normal" space
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )