ai.dragonfly.math.matrix.util

Members list

Concise view

Type members

Classlikes

case class CannotExpressMatrixAsVector[M <: Int, N <: Int](m: Matrix[M, N]) extends Exception

Attributes

Source:
Exceptions.scala
Graph
Supertypes
trait Product
trait Equals
class Exception
class Throwable
class Object
trait Matchable
class Any
case class MatrixNotSymmetricPositiveDefinite[M <: Int, N <: Int](m: Matrix[M, N]) extends Exception

Attributes

Source:
Exceptions.scala
Graph
Supertypes
trait Product
trait Equals
class Exception
class Throwable
class Object
trait Matchable
class Any
case class UnsupportedMatrixDimension(rows: Int, columns: Int) extends Exception

Attributes

Source:
Exceptions.scala
Graph
Supertypes
trait Product
trait Equals
class Exception
class Throwable
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

Attributes

b

right hand side

Returns:

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

Source:
util.scala
extension [M <: Int, N <: Int](m: Matrix[M, N])
def rightInverse(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], N > M =:= true)(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:
util.scala
extension [MN <: Int](m: Matrix[MN, MN])(using ValueOf[MN])
def solve[V <: Int](b: Matrix[MN, V])(using ValueOf[V]): Matrix[MN, V]

Solve a * x = b

Solve a * x = b

Attributes

b

right hand side

Returns:

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

Source:
util.scala
extension [MN <: Int](m: Matrix[MN, MN])
def determinant(using ValueOf[MN]): Double

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:
util.scala
def inverse(using ValueOf[MN]): 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:
util.scala
extension [M <: Int, N <: Int](m: Matrix[M, N])
def cond(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], M >= N =:= true): Double

Matrix condition (2 norm)

Matrix condition (2 norm)

Attributes

Returns:

ratio of largest to smallest singular value.

Source:
util.scala
def leftInverse(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], M >= N =:= true): 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:
util.scala
def norm2(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], M >= N =:= true): Double

Two norm

Two norm

Attributes

Returns:

maximum singular value.

Source:
util.scala
def rank(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], M >= N =:= true): Int

Matrix rank

Matrix rank

Attributes

Returns:

effective numerical rank, obtained from SV.

Source:
util.scala
extension [N <: Int](thisVector: Vec[N])
inline def asColumnMatrix(using ValueOf[N]): Matrix[N, 1]

Attributes

Source:
util.scala
inline def asRowMatrix(using ValueOf[N]): Matrix[1, N]

Attributes

Source:
util.scala