VectorConstructors

trait VectorConstructors[Vec <: (Vector)]

Trait that can mixed to companion objects to enable utility methods for creating vectors.

class Object
trait Matchable
class Any
object DenseVector.type
object Vector.type

Value members

Abstract methods

def apply[@specialized(Double, Int, Float, Long) V](values: Array[V]): Vec[V]

Creates a vector with the specified elements

Creates a vector with the specified elements

def zeros[V : Zero](size: Int): Vec[V]

Creates a Vector of size size.

Creates a Vector of size size.

Concrete methods

def apply[V : ClassTag](values: V*): Vec[V]

Creates a vector with the specified elements

Creates a vector with the specified elements

def rand[T : ClassTag](size: Int, rand: Rand[T]): Vec[T]

Creates a Vector of uniform random numbers in (0,1)

Creates a Vector of uniform random numbers in (0,1)

def range(start: Int, end: Int): Vec[Int]
def range(start: Int, end: Int, step: Int): Vec[Int]
def rangeD(start: Double, end: Double, step: Double): Vec[Double]
def rangeF(start: Float, end: Float, step: Float): Vec[Float]

Implicits

Implicits

implicit def canCreateZeros[V : Zero]: CanCreateZeros[Vec[V], Int]