MatrixD

scalation.mathstat.MatrixD
See theMatrixD companion class
object MatrixD

The `MatrixD companion object provides factory methods.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MatrixD.type

Members list

Value members

Concrete methods

def apply(dim: (Int, Int), u: Double*): MatrixD

Create a matrix from repeated values.

Create a matrix from repeated values.

Value parameters

dim

the (row, column) dimensions

u

the repeated values

Attributes

def apply(dim: Int): MatrixD

Create a square matrix of dimension dim where all elements equal zero.

Create a square matrix of dimension dim where all elements equal zero.

Value parameters

dim

the square dimensions

Attributes

def apply(vs: VectorD*): MatrixD

Create a matrix from a variable argument list of vectors (row-wise). Use transpose to make it column-wise.

Create a matrix from a variable argument list of vectors (row-wise). Use transpose to make it column-wise.

Value parameters

vs

the vararg list of vectors

Attributes

def apply(vs: IndexedSeq[VectorD]): MatrixD

Create a matrix from an mutable IndexedSeq of vectors (row-wise). Use transpose to make it column-wise.

Create a matrix from an mutable IndexedSeq of vectors (row-wise). Use transpose to make it column-wise.

Value parameters

vs

the indexed sequence of vectors

Attributes

def apply(vs: IndexedSeq[VectorD]): MatrixD

Create a matrix from an immutable IndexedSeq of vectors (row-wise), as produce by for yield. Use transpose to make it column-wise.

Create a matrix from an immutable IndexedSeq of vectors (row-wise), as produce by for yield. Use transpose to make it column-wise.

Value parameters

vs

the indexed sequence of vectors

Attributes

def eye(dim: Int, dim2: Int): MatrixD

Create a matrix of dimensions dim by dim2 where all elements equal zero.

Create a matrix of dimensions dim by dim2 where all elements equal zero.

Value parameters

dim

the row dimension

dim2

the column dimension

Attributes

def fill(dim: Int, dim2: Int, value: Double): MatrixD

Create a matrix of dimensions dim by dim2 where all elements equal to the given value.

Create a matrix of dimensions dim by dim2 where all elements equal to the given value.

Value parameters

dim

the row dimension

dim2

the column dimension

value

the given value to assign to all elements

Attributes

Create an m-by-1 matrix from an m-vector (column-wise).

Create an m-by-1 matrix from an m-vector (column-wise).

Value parameters

v

the vector to build the matrix from

Attributes

def load(fileName: String, skip: Int, skipCol: Int, sp: Char, fullPath: Boolean): MatrixD

Create a matrix by reading from a text file, e.g., a CSV file.

Create a matrix by reading from a text file, e.g., a CSV file.

Value parameters

fileName

the name of file holding the data

fullPath

flag indivating whether to use full-path or path relative to 'DATA_DIR' defaults to false (relative paths)

skip

the initial number of lines/rows to skip

skipCol

the initial number of columns to skip

sp

the character used to separate values (',', '\t', ...)

Attributes

def loadIter(fileName: String, xCols: Array[Int], yCol: Int, skip: Int, sp: Char, fullPath: Boolean): (MatrixD, VectorD)

Create a matrix-vector pair (x, y) by reading from a text file, e.g., a CSV file. Use readFileIter to only read the necessary columns from the file.

Create a matrix-vector pair (x, y) by reading from a text file, e.g., a CSV file. Use readFileIter to only read the necessary columns from the file.

Value parameters

fileName

the name of file holding the data

fullPath

flag indivating whether to use full-path or path relative to 'DATA_DIR' defaults to false (relative paths)

skip

the initial number of lines to skip

sp

the character used to separate values (',', '\t', ...)

xCols

the columns that are to make up the x-matrix

yCol

the column that is to make up the y-vector (use the defualt -1 to skip this)

Attributes

def one(dim: Int): MatrixD

Create a matrix of dimension dim by 1 that consists of all ones.

Create a matrix of dimension dim by 1 that consists of all ones.

Value parameters

dim

the row dimension

Attributes

def outer(x: VectorD, y: VectorD): MatrixD

Compute the outer product of vector x and vector y. The result of the outer product is a matrix where element (i, j) is the product of i-th element of x with the j-th element of y.

Compute the outer product of vector x and vector y. The result of the outer product is a matrix where element (i, j) is the product of i-th element of x with the j-th element of y.

Value parameters

x

the first vector

y

the second vector

Attributes

inline def (x: VectorD, y: VectorD): MatrixD

Concrete fields

val nullm: MatrixD

A null matrix of type MatrixD.

A null matrix of type MatrixD.

Attributes