breeze.util

package breeze.util

Type members

Classlikes

@SerialVersionUID(3L)
sealed abstract class ArrayBuilder[@specialized T] extends ReusableBuilder[T, Array[T]] with Serializable

A builder class for arrays.

A builder class for arrays.

Type Params
T

the type of the elements for the builder.

Companion
object
object ArrayBuilder

A companion object for array builders.

A companion object for array builders.

Companion
class
object ArrayUtil
final class AwesomeBitSet(val bs: BitSet) extends AnyVal
final class AwesomeScalaBitSet(val bs: BitSet) extends AnyVal
@SerialVersionUID(1L)
class BloomFilter[@specialized(Int, Long) T](val numBuckets: Int, val numHashFunctions: Int, val bits: BitSet) extends T => Boolean with Serializable

A BloomFilter is an approximate set that sometimes gives false positives. That is, if bf(x) returns true, then it might have been added to the set. If it returns false, then it definitely has not. This is useful for caching and approximation.

A BloomFilter is an approximate set that sometimes gives false positives. That is, if bf(x) returns true, then it might have been added to the set. If it returns false, then it definitely has not. This is useful for caching and approximation.

Companion
object
object BloomFilter
Companion
class

Mixin for case classes that compute their hashcode once, and then cache it. Only good if the case class is immutable, and its contents are also immutable "all the way down".

Mixin for case classes that compute their hashcode once, and then cache it. Only good if the case class is immutable, and its contents are also immutable "all the way down".

@SerialVersionUID(1L)
final class CompositeIndex[U](indices: Index[_ <: U]*) extends Index[(Int, U)]

An Index over N kinds of things. A little type unsafe.

An Index over N kinds of things. A little type unsafe.

@SerialVersionUID(1L)
class DenseIntIndex(beg: Int, end: Int) extends Index[Int]

For use when we need an index, but we already have (densely packed) positive ints and don't want hash overhead.

For use when we need an index, but we already have (densely packed) positive ints and don't want hash overhead.

@SerialVersionUID(1L)
class EitherIndex[L, R](left: Index[L], right: Index[R]) extends Index[Either[L, R]]

An Index over two kinds of things. Layout is straightforward: The first left.size entries are from the left index, while the next right.size are from the right index. Values are wrapped in Left/Right

An Index over two kinds of things. Layout is straightforward: The first left.size entries are from the left index, while the next right.size are from the right index. Values are wrapped in Left/Right

trait Encoder[T]

For encoding counters as vectors and decoding vectors back to counters

For encoding counters as vectors and decoding vectors back to counters

Companion
object
object Encoder
Companion
class
final class FileUtil(val sc: StringContext) extends AnyVal
@SerialVersionUID(-7655100457525569617L)
class HashIndex[T] extends MutableIndex[T] with Serializable

Class that builds a 1-to-1 mapping between Ints and T's, which is very useful for efficiency concerns.

Class that builds a 1-to-1 mapping between Ints and T's, which is very useful for efficiency concerns.

Two extra views are provided: the index.synchronized view enables threadsafe access and the index.immutable view keeps prevents the (view) from being updated.

Companion
object
Companion
class

Stores various implicits, also available by importing breeze.util._

Stores various implicits, also available by importing breeze.util._

trait Index[T] extends Iterable[T] with T => Int with Serializable

Trait that marks an O(1) bidirectional map between Ints (increasing from 0) and T's. This class is used, for example, to efficiently build unique vector space mappings for strings. The methods in this trait do not mutate the underlying index. Use either a MutableIndex or one of the companion object constructor methods to build an index.

Trait that marks an O(1) bidirectional map between Ints (increasing from 0) and T's. This class is used, for example, to efficiently build unique vector space mappings for strings. The methods in this trait do not mutate the underlying index. Use either a MutableIndex or one of the companion object constructor methods to build an index.

Companion
object
object Index

Utilities for manipulating and creating Index objects.

Utilities for manipulating and creating Index objects.

Companion
class
@SerialVersionUID(1L)
class Interner[T] extends T => T with Serializable

Class that mimics Java's string interner, but for anything. Threadsafe.

Class that mimics Java's string interner, but for anything. Threadsafe.

Companion
object
object Interner
Companion
class
trait Isomorphism[T, U] extends Serializable

An Isomorphism is defined by a reversible transformation between two types. useful when one set of implicits is easily defined for some type, but not for some other type

An Isomorphism is defined by a reversible transformation between two types. useful when one set of implicits is easily defined for some type, but not for some other type

Companion
object
object Isomorphism
Companion
class
@SerialVersionUID(1L)
class IsomorphismIndex[T, U](val innerIndex: Index[T])(implicit iso: Isomorphism[T, U]) extends Index[U] with Serializable

Maps an index of type T to an index of type U using an isomorphism implicit

Maps an index of type T to an index of type U using an isomorphism implicit

object Iterators

Utilities and implicits for iterators. Nothing major.

Utilities and implicits for iterators. Nothing major.

object JavaArrayOps

This utility class facilitates transparent access of breeze data objects from plain Java without Scala-related Generic complications.

This utility class facilitates transparent access of breeze data objects from plain Java without Scala-related Generic complications.

class LazyLogger(val logger: Logger) extends Serializable

A logger that only evaluates parameters lazily if the corresponding log level is enabled.

A logger that only evaluates parameters lazily if the corresponding log level is enabled.

trait Lens[T, U]

A Lens defines a functional way of handling getters/setters. They're useful for extending transformations on a part of a case class to the whole case class by updating that one component

A Lens defines a functional way of handling getters/setters. They're useful for extending transformations on a part of a case class to the whole case class by updating that one component

Companion
object
object Lens
Companion
class
trait MutableIndex[T] extends Index[T]

An Index that contains an extra method: <em>index</em> that adds the given element (if necessary), returning its (possibly new) position in the index.

An Index that contains an extra method: <em>index</em> that adds the given element (if necessary), returning its (possibly new) position in the index.

abstract class Opt

Base class for all option case classes in breeze

Base class for all option case classes in breeze

@SerialVersionUID(1L)
class OptionIndex[T](inner: Index[T]) extends Index[Option[T]]

Lifts an index of T into an index of Option[T] . The last element is None. Everything else is as you expect.

Lifts an index of T into an index of Option[T] . The last element is None. Everything else is as you expect.

class PairIndex[T, U](tIndex: Index[T], uIndex: Index[U]) extends Index[(T, U)]

An index over pairs from a pair of indexes

An index over pairs from a pair of indexes

object RangeUtils
class SeqExtras[T](s: Seq[T])
trait SerializableLogging extends Serializable

Stupid Typesafe logging lib trait isn't serializable. This is just a better version.

Stupid Typesafe logging lib trait isn't serializable. This is just a better version.

object Sorting
object Terminal
class TopK[T](k: Int)(implicit ord: Ordering[T]) extends Iterable[T]

A Top-K queue keeps a list of the top K elements seen so far as ordered by the given comparator.

A Top-K queue keeps a list of the top K elements seen so far as ordered by the given comparator.

Companion
object
object TopK
Companion
class
class TopKIterable[T](val self: Iterable[T])

A rich iterable extension that adds the topk method.

A rich iterable extension that adds the topk method.

class TopKIterator[T](val self: Iterator[T])

Class that reads in objects serialized with breeze.util.writeObject, ignoring their serialversionuids, and then writes them to the same file.

Class that reads in objects serialized with breeze.util.writeObject, ignoring their serialversionuids, and then writes them to the same file.

trait WideningConversion[@specialized(Int, Float, Short, Byte) F, @specialized(Int, Long, Double) T]

Sort of like Conversion but intended to be restricted to core numeric types

Sort of like Conversion but intended to be restricted to core numeric types

Companion
object
Companion
class
object partition extends UFunc

Creates a copy of the array with its elements rearranged in such a way that the value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved to the start of the array, all greater are moved to the end. Equal elements will be on the immeditate left or right. The ordering of the elements in the two partitions is undefined.

Creates a copy of the array with its elements rearranged in such a way that the value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved to the start of the array, all greater are moved to the end. Equal elements will be on the immeditate left or right. The ordering of the elements in the two partitions is undefined.

Based on the numpy method of the same name. Docs lifted from numpy

object quickSelect extends UFunc
object quickSelectImpl extends UFunc

Types

type TODO = Nothing

Similar to ???, but for types

Similar to ???, but for types

Value members

Concrete methods

@noinline
def CALLER(nth: Int): String

Computes the source file location of the nth parent. 0 is equivalent to LOCATION

Computes the source file location of the nth parent. 0 is equivalent to LOCATION

@noinline
def LOCATION: String

Computes the current source file and line number.

Computes the current source file and line number.

def deserializeFromBytes[T](bytes: Array[Byte]): T
def memoryString: String

Returns a string with info about the available and used space.

Returns a string with info about the available and used space.

def nonstupidObjectInputStream(stream: InputStream, ignoreSerialVersionUID: Boolean): ObjectInputStream

For reasons that are best described as asinine, ObjectInputStream does not take into account Thread.currentThread.getContextClassLoader. This fixes that.

For reasons that are best described as asinine, ObjectInputStream does not take into account Thread.currentThread.getContextClassLoader. This fixes that.

Value Params
ignoreSerialVersionUID

this is not a safe thing to do, but sometimes...

def readObject[T](loc: File): T

Deserializes an object using java serialization

Deserializes an object using java serialization

def readObject[T](loc: File, ignoreSerialVersionUID: Boolean): T

Deserializes an object using java serialization

Deserializes an object using java serialization

def serializeToBytes[T](obj: T): Array[Byte]
def trace[T](a: T): T

prints a and returns it.

prints a and returns it.

def writeObject[T](out: File, parser: T): Unit

Serializes an object using java serialization

Serializes an object using java serialization

Implicits

Implicits

implicit def _bitsetcbf[U]: BuildFrom[BitSet, U, Set[U]]
implicit def arraySeqExtras[T](s: Array[T]): SeqExtras[T]