slash.matrix

package slash.matrix

Members list

Type members

Classlikes

object Matrix

This library is fundamentally an adaptation of the Java Matrix library, JaMa, by MathWorks Inc. and the National Institute of Standards and Technology.

This library is fundamentally an adaptation of the Java Matrix library, JaMa, by MathWorks Inc. and the National Institute of Standards and Technology.

Attributes

Companion
class
Source
Matrix.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Matrix.type
opaque class Matrix[M <: Int, N <: Int](val values: Array[Double])(using x$2: ValueOf[M], x$3: ValueOf[N])

Attributes

Companion
object
Source
Matrix.scala
Supertypes
class Object
trait Matchable
class Any
object MatrixSpace

Attributes

Companion
class
Source
MatrixSpace.scala
Supertypes
class Object
trait Matchable
class Any
Self type
opaque class MatrixSpace[M0 <: Int, N0 <: Int](val rowVectorSpace: VectorSpace[M0], val columnVectorSpace: VectorSpace[N0])

Attributes

Companion
object
Source
MatrixSpace.scala
Supertypes
class Object
trait Matchable
class Any

Extensions

Extensions

extension [M <: Int, N <: Int](a: Matrix[M, N])(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], N =:= M =:= false)
def solve[V <: Int](b: Matrix[M, V])(using ValueOf[V]): Matrix[N, V]

Solve a * x = b

Solve a * x = b

Value parameters

b

right hand side

Attributes

Returns

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

Source
package.scala
extension [MN <: Int](m: Matrix[MN, MN])(using ValueOf[MN])

Matrix 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

Matrix 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 inverse: Matrix[MN, MN]

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

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

Computes the inverse of Square Matrix m.

Attributes

Returns

the inverse of matrix m

Throws
RuntimeException

"Matrix is singular." )

Source
package.scala
def solve[V <: Int](b: Matrix[MN, V])(using ValueOf[V]): Matrix[MN, V]

Solve a * x = b

Solve a * x = b

Value parameters

b

right hand side

Attributes

Returns

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

Source
package.scala
extension [M <: Int, N <: Int](m: Matrix[M, N])(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], M >= N =:= true)
def cond: Double

Matrix condition (2 norm)

Matrix condition (2 norm)

Attributes

Returns

ratio of largest to smallest singular value.

Source
package.scala
def leftInverse: Matrix[N, M]

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

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

Attributes

Returns

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

Source
package.scala
def norm2: Double

Two norm

Two norm

Attributes

Returns

maximum singular value.

Source
package.scala
def rank: Int

Matrix rank

Matrix rank

Attributes

Returns

effective numerical rank, obtained from SV.

Source
package.scala
extension [M <: Int, N <: Int](m: Matrix[M, N])(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], N > M =:= true)
def rightInverse(using ValueOf[Min[M, M]]): Matrix[N, M]

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

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

Attributes

Returns

the Right Inverse of Matrix a.

Source
package.scala
extension [M <: Int, N <: Int](m: Matrix[M, N])(using M == 1 || N == 1 =:= true)
def asVector: Vec[M * N]

Attributes

Source
package.scala
inline def copyAsVector[MN <: Int](using MN == M * N =:= true): Vec[MN]

Attributes

Source
package.scala
extension [N <: Int](thisVector: Vec[N])(using ValueOf[N])
inline def *[M <: Int](thatMatrix: Matrix[N, M])(using ValueOf[M]): Matrix[1, M]

Attributes

Source
package.scala
inline def asColumnMatrix: Matrix[N, 1]

Attributes

Source
package.scala
inline def asRowMatrix: Matrix[1, N]

Attributes

Source
package.scala
def times[M <: Int](thatMatrix: Matrix[N, M])(using ValueOf[M]): Matrix[1, M]

Attributes

Source
package.scala