o

MathUtil 

object MathUtil

Some simple utility methods for various mathematical operations that are implemented in efficient albeit non-idiomatic scala.

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

Value Members

1. final def !=(arg0: Any)
Definition Classes
AnyRef → Any
2. final def ##(): Int
Definition Classes
AnyRef → Any
3. final def ==(arg0: Any)
Definition Classes
AnyRef → Any
4. final def asInstanceOf[T0]: T0
Definition Classes
Any
5. def clone()
Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( ... )
6. final def eq(arg0: AnyRef)
Definition Classes
AnyRef
7. def equals(arg0: Any)
Definition Classes
AnyRef → Any
8. def finalize(): Unit
Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
9. final def getClass(): Class[_]
Definition Classes
AnyRef → Any
10. def hashCode(): Int
Definition Classes
AnyRef → Any
11. final def isInstanceOf[T0]
Definition Classes
Any
12. 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)

13. 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

14. 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)

15. final def ne(arg0: AnyRef)
Definition Classes
AnyRef
16. final def notify(): Unit
Definition Classes
AnyRef
17. final def notifyAll(): Unit
Definition Classes
AnyRef
18. final def synchronized[T0](arg0: ⇒ T0): T0
Definition Classes
AnyRef
19. def toString(): String
Definition Classes
AnyRef → Any
20. final def wait(): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
21. final def wait(arg0: Long, arg1: Int): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
22. final def wait(arg0: Long): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )