MatF

slash.matrixf.MatF
See theMatF companion object
opaque class MatF[M <: Int, N <: Int](val values: Array[Float])(using x$2: ValueOf[M], x$3: ValueOf[N])

Attributes

Companion
object
Source
MatF.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

opaque type MN

Attributes

Source
MatF.scala

Value members

Concrete methods

inline def *(s: Float): MatF[M, N]

Multiply a matrix by a scalar, C = A * s

Multiply a matrix by a scalar, C = A * s

Value parameters

s

scalar

Attributes

Returns

A * s

Source
MatF.scala
def *[V <: Int](thatMatrix: MatF[N, V])(using ValueOf[V]): MatF[M, V]

Attributes

Source
MatF.scala
inline def *=(s: Float): MatF[M, N]

Attributes

Source
MatF.scala
inline def +(B: MatF[M, N]): MatF[M, N]

Attributes

Source
MatF.scala
inline def +(s: Float): MatF[M, N]

Add a scalar to a matrix, C = A + s

Add a scalar to a matrix, C = A + s

Value parameters

s

scalar

Attributes

Returns

A + s

Source
MatF.scala
inline def +=(B: MatF[M, N]): MatF[M, N]

Attributes

Source
MatF.scala
inline def +=(s: Float): MatF[M, N]

Attributes

Source
MatF.scala
inline def -(B: MatF[M, N]): MatF[M, N]

Attributes

Source
MatF.scala
inline def -(s: Float): MatF[M, N]

Attributes

Source
MatF.scala
inline def -=(B: MatF[M, N]): MatF[M, N]

Attributes

Source
MatF.scala
inline def -=(s: Float): MatF[M, N]

Attributes

Source
MatF.scala
def add(B: MatF[M, N]): MatF[M, N]

A = A + B

A = A + B

Value parameters

B

another matrix

Attributes

Returns

A + B

Source
MatF.scala
def addScalar(d: Float)(using ValueOf[N]): MatF[M, N]

A = A + d

A = A + d

Value parameters

d

a scalar

Attributes

Returns

A + d

Source
MatF.scala
inline def apply(r: Int, c: Int): Float

Get a single element.

Get a single element.

Value parameters

c

Column index.

r

Row index.

Attributes

Returns

A(i,j)

Source
MatF.scala

Attributes

Source
MatF.scala
def asVector: VecF[M * N]
Extension method from slash.matrixf

Attributes

Source
package.scala
def cast[M <: Int, N <: Int](using ValueOf[M], ValueOf[N]): MatF[M, N]
Extension method from slash.matrixf

Attributes

Source
package.scala

Get column dimension.

Get column dimension.

Attributes

Returns

n, the number of columns.

Source
MatF.scala

Make a one-dimensional column packed copy of the internal array.

Make a one-dimensional column packed copy of the internal array.

Attributes

Returns

MatF elements packed in a one-dimensional array by columns.

Source
MatF.scala
inline def columnVector(column: Int): VecF[M]

Value parameters

column

the column of the matrix to return as a vector.

Attributes

Returns

a copy of the specified matrix column in VecF[M] format.

Source
MatF.scala

Attributes

Returns

a copy of this matrix in the form of an array of column vectors.

Source
MatF.scala
inline def concatenateColumns[N1 <: Int](m: MatF[M, N1])(using ValueOf[N1], ValueOf[N + N1]): MatF[M, N + N1]

Attributes

Source
MatF.scala
inline def concatenateColumns(m: MatF[_ <: Int, _ <: Int]): Array[Float]

Attributes

Source
MatF.scala
inline def concatenateRows[M1 <: Int](m: MatF[M1, N])(using ValueOf[M1], ValueOf[M + M1]): MatF[M + M1, N]

Attributes

Source
MatF.scala
inline def concatenateRows(m: MatF[_ <: Int, _ <: Int]): Array[Float]

Attributes

Source
MatF.scala
def cond: Double
Extension method from slash.matrixf

MatF condition (2 norm)

MatF condition (2 norm)

Attributes

Returns

ratio of largest to smallest singular value.

Source
package.scala
def copy: MatF[M, N]

Make a deep copy of a matrix

Make a deep copy of a matrix

Attributes

Source
MatF.scala
inline def copyAsVector[MN <: Int](using (MN == (M * N)) =:= true): VecF[MN]
Extension method from slash.matrixf

Attributes

Source
package.scala
inline def copyValues: Array[Float]

Copy the internal two-dimensional array.

Copy the internal two-dimensional array.

Attributes

Returns

Two-dimensional array copy of matrix elements.

Source
MatF.scala
def csv: String

Attributes

Source
MatF.scala
def csv(alignment: (Mat[_ <: Int, _ <: Int], MatFormat) => Array[Array[String]], sb: StringBuilder): String

Attributes

Source
MatF.scala
Extension method from slash.matrixf

MatF determinant https://en.wikipedia.org/wiki/Determinant the determinant is nonzero if and only if the matrix is invertible and the linear map represented by the matrix is an isomorphism

MatF determinant https://en.wikipedia.org/wiki/Determinant the determinant is nonzero if and only if the matrix is invertible and the linear map represented by the matrix is an isomorphism

Attributes

Returns

the determinant of this matrix.

Source
package.scala
def diagonalVector(using ValueOf[Min[M, N]]): VecF[Min[M, N]]

Attributes

Source
MatF.scala
def dim: String

Attributes

Source
MatF.scala
def flatten: VecF[M * N]
Extension method from slash.matrixf

values as a Vector.

values as a Vector.

Attributes

Source
package.scala
def inv: MatF[MN, MN]
Extension method from slash.matrixf

https://en.wikipedia.org/wiki/Invertible_matrix

https://en.wikipedia.org/wiki/Invertible_matrix

Computes the inverse of Square MatF m.

Attributes

Returns

the inverse of matrix m

Throws
RuntimeException

"MatF is singular." )

Source
package.scala
def leftInverse: MatF[N, M]
Extension method from slash.matrixf

Solve b * m = I[N, N] m = MatF[M, N] with M > N and Rank = N, has a left inverse b = MatF[N, M] such that b * m = I[N, N]

Solve b * m = I[N, N] m = MatF[M, N] with M > N and Rank = N, has a left inverse b = MatF[N, M] such that b * m = I[N, N]

Attributes

Returns

b = MatF[N, M] the Left Inverse of MatF m.

Source
package.scala
inline def lindex(r: Int, c: Int): Int

Attributes

Source
MatF.scala
def lowerTriangular: MatF[M, N]

Attributes

Source
MatF.scala
def norm1: Double

One norm

One norm

Attributes

Returns

maximum column sum.

Source
MatF.scala
def norm2: Double
Extension method from slash.matrixf

Two norm

Two norm

Attributes

Returns

maximum singular value.

Source
package.scala

Frobenius norm

Frobenius norm

Attributes

Returns

sqrt of sum of squares of all elements.

Source
MatF.scala

Infinity norm

Infinity norm

Attributes

Returns

maximum row sum.

Source
MatF.scala
def rank: Int
Extension method from slash.matrixf

MatF rank

MatF rank

Attributes

Returns

effective numerical rank, obtained from SV.

Source
package.scala
def render(format: MatFormat, alignment: (Mat[_ <: Int, _ <: Int], MatFormat) => Array[Array[String]], sb: StringBuilder): StringBuilder

Attributes

Source
MatF.scala
def reshape[R <: Int, C <: Int](using ValueOf[R], ValueOf[C]): MatF[R, C]
Extension method from slash.matrixf

cast matrix as MatF[R,C]

cast matrix as MatF[R,C]

Value parameters

C

new horizontal dimension

R

new vertical dimension

Attributes

Returns

same values, but recast to RxC

Source
package.scala
def rightInverse(using ValueOf[Min[M, M]]): MatF[N, M]
Extension method from slash.matrixf

m = MatF[M, N] with M < N and Rank = M, has a right inverse b = MatF[N, M] such that m * b = Identity[M, M]

m = MatF[M, N] with M < N and Rank = M, has a right inverse b = MatF[N, M] such that m * b = Identity[M, M]

Attributes

Returns

the Right Inverse of MatF a.

Source
package.scala

Get row dimension.

Get row dimension.

Attributes

Returns

m, the number of rows.

Source
MatF.scala
inline def rowPackedArray: Array[Float]

Make a one-dimensional row packed copy of the internal array.

Make a one-dimensional row packed copy of the internal array.

Attributes

Returns

MatF elements packed in a one-dimensional array by rows.

Source
MatF.scala
inline def rowVector(row: Int): VecF[N]

Value parameters

row

the row of the matrix to return as a vector.

Attributes

Returns

a copy of the specified matrix row in VecF[N] format.

Source
MatF.scala
def rowVectors: Array[VecF[N]]

Attributes

Returns

a copy of this matrix in the form of an array of row vectors.

Source
MatF.scala
def setMatrix[M1 <: Int, N1 <: Int](r0: Int, c0: Int, thatMatrix: MatF[M1, N1])(using ValueOf[M1], ValueOf[N1]): Unit

Set a submatrix.

Set a submatrix.

Type parameters

M1

Row dimension of thatMatrix

N1

Column dimension of thatMatrix

Value parameters

ValueOf[M1]

Row dimension of thatMatrix

ValueOf[N1]

Column dimension of thatMatrix

c0

Initial column index

r0

Initial row index

thatMatrix

a metrix of lesser or equal dimension to this matrix

Attributes

Source
MatF.scala
def setMatrix[M1 <: Int, N1 <: Int](rowIndices: Array[Int], columnIndices: Array[Int], thatMatrix: MatF[M1, N1]): Unit

Set a submatrix.

Set a submatrix.

Value parameters

columnIndices

Array of column indices.

rowIndices

Array of row indices.

thatMatrix

A(r(:),c(:))

Attributes

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def setMatrix[M1 <: Int, N1 <: Int](rowIndices: Array[Int], c0: Int, thatMatrix: MatF[M1, N1])(using ValueOf[M1], ValueOf[N1]): Unit

Set a submatrix.

Set a submatrix.

Value parameters

c0

Initial column index

c1

Final column index

rowIndices

Array of row indices.

thatMatrix

A(r(:),j0:j1)

Attributes

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def setMatrix[M1 <: Int, N1 <: Int](r0: Int, columnIndices: Array[Int], thatMatrix: MatF[M1, N1])(using ValueOf[M1], ValueOf[N1]): Unit

Set a submatrix.

Set a submatrix.

Value parameters

columnIndices

Array of column indices.

r0

Initial row index

r1

Final row index

thatMatrix

A(i0:i1,c(:))

Attributes

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def solve[V <: Int](b: MatF[MN, V])(using ValueOf[V]): MatF[MN, V]
Extension method from slash.matrixf

Solve a * x = b

Solve a * x = b

Value parameters

b

right hand side

Attributes

Returns

x = MatF[MN, V] such that a * x = b

Source
package.scala
def solve[V <: Int](b: MatF[M, V])(using ValueOf[V]): MatF[N, V]
Extension method from slash.matrixf

Solve a * x = b

Solve a * x = b

Value parameters

b

right hand side

Attributes

Returns

least squares solution x = MatF[M, V] such that a * x = b

Source
package.scala
def strictEquals(obj: Any): Boolean

Attributes

Source
MatF.scala
def subMatrix[M1 <: Int, N1 <: Int](r0: Int, c0: Int)(using ValueOf[M1], ValueOf[N1]): MatF[M1, N1]

Get a submatrix.

Get a submatrix.

Type parameters

M1

the number of rows

N1

the number of columns

Value parameters

c0

Initial column index

r0

Initial row index

Attributes

Returns

A(i0:i1,j0:j1)

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def subMatrix[M1 <: Int, N1 <: Int](rowIndices: Array[Int], columnIndices: Array[Int])(using ValueOf[M1], ValueOf[N1]): MatF[M1, N1]

Get a submatrix.

Get a submatrix.

Value parameters

columnIndices

Array of column indices.

rowIndices

Array of row indices.

Attributes

Returns

A(r(:),c(:))

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def subMatrix[M1 <: Int, N1 <: Int](r0: Int, columnIndices: Array[Int])(using ValueOf[M1], ValueOf[N1]): MatF[M1, N1]

Get a submatrix.

Get a submatrix.

Value parameters

columnIndices

Array of column indices.

r0

Initial row index

Attributes

Returns

A(i0:i1,c(:))

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def subMatrix[M1 <: Int, N1 <: Int](rowIndices: Array[Int], c0: Int)(using ValueOf[M1], ValueOf[N1]): MatF[M1, N1]

Get a submatrix.

Get a submatrix.

Value parameters

c0

Initial column index

c1

Final column index

r

Array of row indices.

Attributes

Returns

A(r(:),j0:j1)

Throws
ArrayIndexOutOfBoundsException

Submatrix indices

Source
MatF.scala
def subtract(B: MatF[M, N]): MatF[M, N]

A = A - B

A = A - B

Value parameters

B

another matrix

Attributes

Returns

A - B

Source
MatF.scala
def times(s: Float): MatF[M, N]

Multiply a matrix by a scalar in place, A = s*A

Multiply a matrix by a scalar in place, A = s*A

Value parameters

s

scalar

Attributes

Returns

replace A by s*A

Source
MatF.scala
def times[V <: Int](b: MatF[N, V])(using ValueOf[V]): MatF[M, V]

Linear algebraic matrix multiplication, A * B

Linear algebraic matrix multiplication, A * B

Value parameters

b

another matrix

Attributes

Returns

MatF product, A * B

Throws
IllegalArgumentException

MatF inner dimensions must agree.

Source
MatF.scala
def toMat: Mat[M, N]
Extension method from slash.matrixf

Extension methods for all matrices.

Extension methods for all matrices.

Attributes

Source
package.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
MatF.scala
def trace: Double

MatF trace.

MatF trace.

Attributes

Returns

sum of the diagonal elements.

Source
MatF.scala
def transpose: MatF[N, M]

MatF transpose.

MatF transpose.

Attributes

Returns

Máµ€

Source
MatF.scala
def tsv: String

Attributes

Source
MatF.scala
def tsv(alignment: (Mat[_ <: Int, _ <: Int], MatFormat) => Array[Array[String]], sb: StringBuilder): String

Attributes

Source
MatF.scala
inline def unary_-: MatF[M, N]

Unary minus

Unary minus

Attributes

Returns

-A

Source
MatF.scala
inline def update(r: Int, c: Int, value: Float): Unit

Set a single element.

Set a single element.

Value parameters

c

Column index.

r

Row index.

value

values(i,j).

Attributes

Source
MatF.scala
def upperTriangular: MatF[M, N]

Attributes

Source
MatF.scala

Concrete fields

val MxN: Int

Attributes

Source
MatF.scala
val columns: Int

Attributes

Source
MatF.scala
val rows: Int

Attributes

Source
MatF.scala

Attributes

Source
MatF.scala