Matrix

ai.dragonfly.math.matrix.Matrix
See theMatrix companion object
class Matrix[M <: Int, N <: Int]

Attributes

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

Members list

Concise view

Type members

Types

type MN = Int

Attributes

Source:
Matrix.scala

Value members

Concrete methods

inline def *(s: Double): Matrix[M, N]

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

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

Attributes

s

scalar

Returns:

s*A

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

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Attributes

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

A = A + B

A = A + B

Attributes

B

another matrix

Returns:

A + B

Source:
Matrix.scala
inline def apply(r: Int, c: Int): Double

Get a single element.

Get a single element.

Attributes

c

Column index.

r

Row index.

Returns:

A(i,j)

Source:
Matrix.scala

Attributes

Source:
Matrix.scala

Get column dimension.

Get column dimension.

Attributes

Returns:

n, the number of columns.

Source:
Matrix.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:

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

Source:
Matrix.scala
def copy: Matrix[M, N]

Make a deep copy of a matrix

Make a deep copy of a matrix

Attributes

Source:
Matrix.scala

Copy the internal two-dimensional array.

Copy the internal two-dimensional array.

Attributes

Returns:

Two-dimensional array copy of matrix elements.

Source:
Matrix.scala
def dim: String

Attributes

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

Get a submatrix.

Get a submatrix.

Attributes

columnIndices

Array of column indices.

r0

Initial row index

Returns:

A(i0:i1,c(:))

Throws:
Source:
Matrix.scala
def getMatrix[M1 <: Int, N1 <: Int](rowIndices: Array[Int], c0: Int)(using ValueOf[M1], ValueOf[N1]): Matrix[M1, N1]

Get a submatrix.

Get a submatrix.

Attributes

c0

Initial column index

c1

Final column index

r

Array of row indices.

Returns:

A(r(:),j0:j1)

Throws:
Source:
Matrix.scala

One norm

One norm

Attributes

Returns:

maximum column sum.

Source:
Matrix.scala

Frobenius norm

Frobenius norm

Attributes

Returns:

sqrt of sum of squares of all elements.

Source:
Matrix.scala

Infinity norm

Infinity norm

Attributes

Returns:

maximum row sum.

Source:
Matrix.scala

Get row dimension.

Get row dimension.

Attributes

Returns:

m, the number of rows.

Source:
Matrix.scala

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

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

Attributes

Returns:

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

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

Set a submatrix.

Set a submatrix.

Attributes

M1

Row dimension of mtrx

N1

Column dimension of mtrx

ValueOf[M1]

Row dimension of mtrx

ValueOf[N1]

Column dimension of mtrx

c0

Initial column index

mtrx

a metrix of lesser or equal dimension to this matrix

r0

Initial row index

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

Set a submatrix.

Set a submatrix.

Attributes

X

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

columnIndices

Array of column indices.

rowIndices

Array of row indices.

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

Set a submatrix.

Set a submatrix.

Attributes

X

A(r(:),j0:j1)

c0

Initial column index

c1

Final column index

rowIndices

Array of row indices.

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

Set a submatrix.

Set a submatrix.

Attributes

X

A(i0:i1,c(:))

columnIndices

Array of column indices.

r0

Initial row index

r1

Final row index

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

Get a submatrix.

Get a submatrix.

Attributes

M1

the number of rows

N1

the number of columns

c0

Initial column index

r0

Initial row index

Returns:

A(i0:i1,j0:j1)

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

Get a submatrix.

Get a submatrix.

Attributes

columnIndices

Array of column indices.

rowIndices

Array of row indices.

Returns:

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

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

A = A - B

A = A - B

Attributes

B

another matrix

Returns:

A - B

Source:
Matrix.scala
def times(s: Double): Matrix[M, N]

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

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

Attributes

s

scalar

Returns:

replace A by s*A

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

Linear algebraic matrix multiplication, A * B

Linear algebraic matrix multiplication, A * B

Attributes

b

another matrix

Returns:

Matrix product, A * B

Throws:
IllegalArgumentException

Matrix inner dimensions must agree.

Source:
Matrix.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:
Matrix.scala

Matrix trace.

Matrix trace.

Attributes

Returns:

sum of the diagonal elements.

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

Matrix transpose.

Matrix transpose.

Attributes

Returns:

Máµ€

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

Unary minus

Unary minus

Attributes

Returns:

-A

Source:
Matrix.scala
inline def update(r: Int, c: Int, value: Double): Unit

Set a single element.

Set a single element.

Attributes

c

Column index.

r

Row index.

value

values(i,j).

Source:
Matrix.scala

Concrete fields

Attributes

Source:
Matrix.scala
val mn: Int

Attributes

Source:
Matrix.scala
val rows: Int

Attributes

Source:
Matrix.scala

Attributes

Source:
Matrix.scala