Packages

object MatrixC extends Error with Serializable

The MatrixC companion object provides operations for MatrixC that don't require 'this' (like static methods in Java). It provides factory methods for building matrices from files or vectors.

Linear Supertypes
Serializable, Serializable, Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MatrixC
  2. Serializable
  3. Serializable
  4. Error
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def ++(u: VectoC, w: VectoC): MatrixC

    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

  2. def ++^(u: VectoC, w: VectoC): MatrixC

    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

  3. def apply(fileName: String, skip: Int): MatrixC

    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

    skip

    the initial number of lines to skip

  4. def apply(fileName: String): MatrixC

    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

  5. def apply(dim: (Int, Int), u: Complex*): MatrixC

    Create a symmetric matrix from repeated values in a lower triangular form.

    Create a symmetric matrix from repeated values in a lower triangular form.

    dim

    the (row, column) dimensions

    u

    the repeated values

  6. def apply(u: Vector[VectoC]): MatrixC

    Create a matrix and assign values from the Scala Vector of vectors 'u'.

    Create a matrix and assign values from the Scala Vector of vectors 'u'. Assumes vectors are column-wise.

    u

    the Vector of vectors to assign

  7. def apply(u: Seq[VectoC], columnwise: Boolean = true): MatrixC

    Create a matrix and assign values from a sequence/array of vectors 'u'.

    Create a matrix and assign values from a sequence/array of vectors 'u'.

    u

    the sequence/array of vectors to assign

    columnwise

    whether the vectors are treated as column or row vectors

  8. def apply(u: Array[Array[Complex]]): MatrixC

    Create a matrix from a two-dimensional array 'u'.

    Create a matrix from a two-dimensional array 'u'.

    u

    the 2D array for the matrix

  9. def eye(m: Int, n: Int = 0): MatrixC

    Create an 'm-by-n' identity matrix I (ones on main diagonal, zeros elsewhere).

    Create an 'm-by-n' identity matrix I (ones on main diagonal, zeros elsewhere). If 'n' is <= 0, set it to 'm' for a square identity matrix. FIX: store as a diagonal matrix.

    m

    the row dimension of the matrix

    n

    the column dimension of the matrix (defaults to 0 => square matrix)

  10. 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
  11. def form_cw(x: VectoC, y: Complex): MatrixC

    Form a matrix from a vector 'x' and a scalar 'y', column-wise.

    Form a matrix from a vector 'x' and a scalar 'y', column-wise.

    x

    the first vector -> column 0

    y

    the second scalar -> column 1 (repeat scalar)

  12. def form_cw(x: Complex, y: VectoC): MatrixC

    Form a matrix from a scalar 'x' and a vector 'y', column-wise.

    Form a matrix from a scalar 'x' and a vector 'y', column-wise.

    x

    the first scalar -> column 0 (repeat scalar)

    y

    the second vector -> column 1

  13. def form_cw(x: VectoC, y: VectoC): MatrixC

    Form a matrix from two vectors 'x' and 'y', column-wise.

    Form a matrix from two vectors 'x' and 'y', column-wise.

    x

    the first vector -> column 0

    y

    the second vector -> column 1

  14. def form_rw(x: VectoC, y: Complex): MatrixC

    Form a matrix from a vector 'x' and a scalar 'y', row-wise.

    Form a matrix from a vector 'x' and a scalar 'y', row-wise.

    x

    the first vector -> row 0

    y

    the second scalar -> row 1 (repeat scalar)

  15. def form_rw(x: Complex, y: VectoC): MatrixC

    Form a matrix from scalar 'x' and a vector 'y', row-wise.

    Form a matrix from scalar 'x' and a vector 'y', row-wise.

    x

    the first scalar -> row 0 (repeat scalar)

    y

    the second vector -> row 1

  16. def form_rw(x: VectoC, y: VectoC): MatrixC

    Form a matrix from two vectors 'x' and 'y', row-wise.

    Form a matrix from two vectors 'x' and 'y', row-wise.

    x

    the first vector -> row 0

    y

    the second vector -> row 1

  17. def outer(x: VectoC, y: VectoC): MatrixC

    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

  18. def setSp(sp_: Char): Unit

    Reset the separating character from its CSV default.

    Reset the separating character from its CSV default.

    sp_

    the new separating character

  19. def times(u: VectoC, a: MatrixC): VectorC

    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')