slash.matrix

package slash.matrix

Members list

Type members

Classlikes

object Mat

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

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

Attributes

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

Attributes

Companion
object
Source
Mat.scala
Supertypes
class Object
trait Matchable
class Any
case class MatColumnMetrics(leftLength: IntArray, rightLength: IntArray, maxLength: IntArray)

Attributes

Source
Mat.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait MatFormat

Attributes

Companion
object
Source
Mat.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ASCII
object DEFAULT
class Delimited
object INDEXED
object TEXTBOOK
object TUPLE
Show all
object MatFormat

Attributes

Companion
trait
Source
Mat.scala
Supertypes
class Object
trait Matchable
class Any
Self type
MatFormat.type
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
object Util

Attributes

Source
Util.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Util.type

Extensions

Extensions

extension [M <: Int, N <: Int](a: Mat[M, N])(using ValueOf[M], ValueOf[N])
def flatten: Vec[M * N]

values as a Vector.

values as a Vector.

Attributes

Source
package.scala
def reshape[R <: Int, C <: Int](using ValueOf[R], ValueOf[C]): Mat[R, C]

cast matrix as Mat[R,C]

cast matrix as Mat[R,C]

Value parameters

C

new horizontal dimension

R

new vertical dimension

Attributes

Returns

same values, but recast to RxC

Source
package.scala
extension [M <: Int, N <: Int](a: Mat[M, N])(using ValueOf[M], ValueOf[N], ValueOf[Min[M, N]], N =:= M =:= false)
def solve[V <: Int](b: Mat[M, V])(using ValueOf[V]): Mat[N, V]

Solve a * x = b

Solve a * x = b

Value parameters

b

right hand side

Attributes

Returns

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

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

Mat 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

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

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

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

Computes the inverse of Square Mat m.

Attributes

Returns

the inverse of matrix m

Throws
RuntimeException

"Mat is singular." )

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

Solve a * x = b

Solve a * x = b

Value parameters

b

right hand side

Attributes

Returns

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

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

Mat condition (2 norm)

Mat condition (2 norm)

Attributes

Returns

ratio of largest to smallest singular value.

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

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

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

Attributes

Returns

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

Source
package.scala
def norm2: Double

Two norm

Two norm

Attributes

Returns

maximum singular value.

Source
package.scala
def rank: Int

Mat rank

Mat rank

Attributes

Returns

effective numerical rank, obtained from SV.

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

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

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

Attributes

Returns

the Right Inverse of Mat a.

Source
package.scala
extension [M <: Int, N <: Int](m: Mat[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 (m: Mat[_ <: Int, _ <: Int])
def cast[M <: Int, N <: Int](using ValueOf[M], ValueOf[N]): Mat[M, N]

Attributes

Source
package.scala
extension (s: Double)
inline def +[M <: Int, N <: Int](inline m: Mat[M, N])(using ValueOf[M], ValueOf[N]): Mat[M, N]

Support left add / multiply by Scalars

Support left add / multiply by Scalars

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Attributes

Source
package.scala