org.saddle.mat

package org.saddle.mat

Members list

Type members

Classlikes

object MatCols

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
MatCols.type
object MatMath

Matrix mathematical helper routines.

Matrix mathematical helper routines.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
MatMath.type

Value members

Concrete methods

def diag(v: Vec[Double]): Mat[Double]

Given a vector, create a matrix whose diagonal entries equal the vector, with zeros off-diagonal.

Given a vector, create a matrix whose diagonal entries equal the vector, with zeros off-diagonal.

Value parameters

v

The vector of source data

Attributes

def ident(n: Int): Mat[Double]

Create a square identity matrix of dimension n x n

Create a square identity matrix of dimension n x n

Value parameters

n

The number of rows/columns of the square matrix

Attributes

def ones(rows: Int, cols: Int): Mat[Double]
def rand(rows: Int, cols: Int): Mat[Double]

Generate a uniform [0,1) random Mat[Double] of a certain size

Generate a uniform [0,1) random Mat[Double] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def randI(rows: Int, cols: Int): Mat[Int]

Generate a uniform random Mat[Int] of a certain size

Generate a uniform random Mat[Int] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def randl(rows: Int, cols: Int): Mat[Long]

Generate a uniform random Mat[Long] of a certain size

Generate a uniform random Mat[Long] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def randn(rows: Int, cols: Int): Mat[Double]

Generate a standard normal random Mat[Double] of a certain size

Generate a standard normal random Mat[Double] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def randn2(rows: Int, cols: Int, mu: Double, sigma: Double): Mat[Double]

Generate a gaussian(mu, sigma) random Mat[Double] of a certain size

Generate a gaussian(mu, sigma) random Mat[Double] of a certain size

Value parameters

cols

Number of rows

mu

Mean of distribution

rows

Number of rows

sigma

Stdev of distribution

Attributes

def randp(rows: Int, cols: Int): Mat[Double]

Generate a uniform random (0,1] Mat[Double] of a certain size

Generate a uniform random (0,1] Mat[Double] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def randpi(rows: Int, cols: Int): Mat[Int]

Generate a uniform random positive Mat[Int] of a certain size

Generate a uniform random positive Mat[Int] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def randpl(rows: Int, cols: Int): Mat[Long]

Generate a uniform random positive Mat[Long] of a certain size

Generate a uniform random positive Mat[Long] of a certain size

Value parameters

cols

Number of rows

rows

Number of rows

Attributes

def repeat[T : ScalarTag](v: Array[T], n: Int, asRows: Boolean): Mat[T]

Repeats an array in a particular direction to create a 2D matrix

Repeats an array in a particular direction to create a 2D matrix

Type parameters

T

type of elements in array

Value parameters

asRows

if true, returns row-tiling; default is column-tiling

n

number of repetitions

v

array of values to repeat

Attributes

def zeros(rows: Int, cols: Int): Mat[Double]