object MatrixD extends Error with Serializable
The MatrixD
companion object provides operations for MatrixD
that don't
require 'this' (like static methods in Java). It provides factory methods for
building matrices from files or vectors.
- Alphabetic
- By Inheritance
- MatrixD
- Serializable
- Serializable
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
++(u: VectoD, w: VectoD): MatrixD
Concatenate (row) vectors 'u' and 'w' to form a matrix with 2 rows.
Concatenate (row) vectors 'u' and 'w' to form a matrix with 2 rows.
- u
the vector to be concatenated as the new first row in matrix
- w
the vector to be concatenated as the new second row in matrix
-
def
++^(u: VectoD, w: VectoD): MatrixD
Concatenate (column) vectors 'u' and 'w' to form a matrix with 2 columns.
Concatenate (column) vectors 'u' and 'w' to form a matrix with 2 columns.
- u
the vector to be concatenated as the new first column in matrix
- w
the vector to be concatenated as the new second column in matrix
-
def
apply(fileName: String, sep: Char = ','): 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.
- fileName
the name of file holding the data
- sep
the character separating the values
-
def
eye(n: Int): MatrixD
Create an n-by-n identity matrix (ones on main diagonal, zeros elsewhere).
Create an n-by-n identity matrix (ones on main diagonal, zeros elsewhere).
- n
the dimension of the square matrix
-
final
def
flaw(method: String, message: String): Unit
Show the flaw by printing the error message.
Show the flaw by printing the error message.
- method
the method where the error occurred
- message
the error message
- Definition Classes
- Error
-
def
form_cw(x: VectoD, y: Double): MatrixD
Form a matrix from a vector and a scalar, column-wise.
Form a matrix from a vector and a scalar, column-wise.
- x
the first vector -> column 0
- y
the second scalar -> column 1 (repeat scalar)
-
def
form_cw(x: Double, y: VectoD): MatrixD
Form a matrix from a scalar and a vector, column-wise.
Form a matrix from a scalar and a vector, column-wise.
- x
the first scalar -> column 0 (repeat scalar)
- y
the second vector -> column 1
-
def
form_cw(x: VectoD, y: VectoD): MatrixD
Form a matrix from two vectors, column-wise.
Form a matrix from two vectors, column-wise.
- x
the first vector -> column 0
- y
the second vector -> column 1
-
def
form_rw(x: VectoD, y: Double): MatrixD
Form a matrix from a vector and a scalar, row-wise.
Form a matrix from a vector and a scalar, row-wise.
- x
the first vector -> row 0
- y
the second scalar -> row 1 (repeat scalar)
-
def
form_rw(x: Double, y: VectoD): MatrixD
Form a matrix from scalar and a vector, row-wise.
Form a matrix from scalar and a vector, row-wise.
- x
the first scalar -> row 0 (repeat scalar)
- y
the second vector -> row 1
-
def
form_rw(x: VectoD, y: VectoD): MatrixD
Form a matrix from two vectors, row-wise.
Form a matrix from two vectors, row-wise.
- x
the first vector -> row 0
- y
the second vector -> row 1
-
def
outer(x: VectoD, y: VectoD): MatrixD
Compute the outer product of vector x and vector y.
Compute the outer product of vector x and vector y. The result of the outer product is a matrix where c(i, j) is the product of i-th element of x with the j-th element of y.
- x
the first vector
- y
the second vector
-
def
times(u: VectoD, a: MatrixD): VectorD
Multiply vector u by matrix a.
Multiply vector u by matrix a. Treat u as a row vector.
- u
the vector to multiply by
- a
the matrix to multiply by (requires sameCrossDimensions)