org.saddle.util

Additional utilities that need a home

Attributes

Members list

Concise view

Type members

Classlikes

object Concat

Provides a way to append two arrays of possibly different types together by intelligently promoting primitive types where possible.

Provides a way to append two arrays of possibly different types together by intelligently promoting primitive types where possible.

Key method is Concat.append(array1, array2)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Concat.type
class DoubleMap

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
trait Hash[Double]
trait Order[Double]
trait PartialOrder[Double]
trait Eq[Double]
trait Serializable
class Object
trait Matchable
class Any
Self type
trait DoubleTotalOrderTrait extends Order[Double] with Hash[Double]

An Order[Double] instance which produces a total order by ordering NaNs above all other Doubles

An Order[Double] instance which produces a total order by ordering NaNs above all other Doubles

Contrary to the specification of cats, the DoubleOrdering in cats.kernel is not total because NaN is not ordered (all comparisons return false). This behaviour is consistent with IEEE-754, but not very practical.

java.lang.Double.compare orders NaN to be largest of all Doubles.

See https://github.com/scala/scala/pull/8721 See https://github.com/scala/scala/blob/39e82c3f904380f0b40d106723747faf881640d4/src/library/scala/math/Ordering.scala#L465

Attributes

Graph
Supertypes
trait Hash[Double]
trait Order[Double]
trait PartialOrder[Double]
trait Eq[Double]
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object doubleIsNumeric.type
object DoubleTotalOrder.type

Attributes

Graph
Supertypes
trait Hash[Float]
trait Order[Float]
trait PartialOrder[Float]
trait Eq[Float]
trait Serializable
class Object
trait Matchable
class Any
Self type
trait FloatTotalOrderTrait extends Order[Float] with Hash[Float]

See DoubleTotalOrder

See DoubleTotalOrder

Attributes

Graph
Supertypes
trait Hash[Float]
trait Order[Float]
trait PartialOrder[Float]
trait Eq[Float]
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object floatIsNumeric.type
object FloatTotalOrder.type
class IntMap

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
final class LongMap(defaultEntry: Long => Int, initialBufferSize: Int, initBlank: Boolean)

This class implements mutable maps with Long keys based on a hash table with open addressing.

This class implements mutable maps with Long keys based on a hash table with open addressing.

Basic map operations on single entries, including contains and get, are typically substantially faster with LongMap than HashMap. Methods that act on the whole map, including foreach and map are not in general expected to be faster than with a generic map, save for those that take particular advantage of the internal structure of the map: foreachKey, foreachValue, mapValuesNow, and transformValues.

Maps with open addressing may become less efficient at lookup after repeated addition/removal of elements. Although LongMap makes a decent attempt to remain efficient regardless, calling repack on a map that will no longer have elements removed but will be used heavily may save both time and storage space.

This map is not intended to contain more than 2^29 entries (approximately 500 million). The maximum capacity is 2^30, but performance will degrade rapidly as 2^30 is approached.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object LongMap

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LongMap.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object order.type

Value members

Concrete methods

def buildStr(count: Int, total: Int, callback: Int => String, break: => String): String

Creates a string out of ''count'' number of elements extracted from ''total'' elements between offsets [0 ... count / 2) and (total - count / 2 ... total), using a callback that generates a string at each offset, and inserting a break string if count > total.

Creates a string out of ''count'' number of elements extracted from ''total'' elements between offsets [0 ... count / 2) and (total - count / 2 ... total), using a callback that generates a string at each offset, and inserting a break string if count > total.

Attributes

break

Produces a string to insert as a break

callback

Generates a string at each offset

count

Number of elements to print

total

Total number of elements in sequence

final def dividePositiveRoundUp(a: Int, b: Int): Int
final def dividePositiveRoundUp(a: Long, b: Long): Long
def grab[T](arr: Array[T], n: Int): Seq[T]

Takes n elements from the front and from the back of array

Takes n elements from the front and from the back of array

Attributes

arr

Array

n

Number of elements to take