object MathUtil
Some simple utility methods for various mathematical operations that are implemented in efficient albeit non-idiomatic scala.
- Alphabetic
- By Inheritance
- MathUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
-
def
maxWithIndex(ds: Array[Double], requireUniqueMaximum: Boolean = false): (Double, Int)
Finds the maximum element in the array and returns it with its index.
Finds the maximum element in the array and returns it with its index.
If multiple slots in the array contain the same, maximum, value the index of the first one will be returned.
- ds
an array of doubles of length >= 1
- requireUniqueMaximum
When false the earliest index at which the maximum value occurs is reported. When true, if there are multiple indices with the maximum value then -1 will be returned for the index.
- Exceptions thrown
NoSuchElementException
if either the input array is zero length or the array contains only invalid values (NaN)
-
def
mean(bytes: Array[Byte]): Byte
Calculates the arithmetic mean of an array of bytes.
Calculates the arithmetic mean of an array of bytes. The computation is performed in integer space and the result will therefore always round down.
- bytes
the array of bytes to average
- returns
the floor of the arithmetic mean
-
def
minWithIndex(ds: Array[Double], allowNegativeInfinity: Boolean = false, requireUniqueMinimum: Boolean = false): (Double, Int)
Finds the minimum element in the array and returns it with its index.
Finds the minimum element in the array and returns it with its index. By default negative infinity values are excluded - meaning that minimum non-negative-infinity value will be returned.
If multiple slots in the array contain the same, minimum, value the index of the first one will be returned.
- ds
an array of doubles of length >= 1
- allowNegativeInfinity
if true allow the result to be Double.NegativeInfinity otherwise return the lowest non-infinite value
- requireUniqueMinimum
When false the earliest index at which the minimum value occurs is reported. When true, if there are multiple indices with the minimum value then -1 will be returned for the index.
- Exceptions thrown
NoSuchElementException
if either the input array is zero length or the array contains only invalid values (NaN and possibly NegativeInfinity)
-
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
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( ... )