MUMatrix
public struct MUMatrix<T> where T : MUFloatingPoint, T : CustomStringConvertible
MUMatrix struct of floating point elements
-
2D array of matrix datas.
Declaration
Swift
public private(set) var datas: [[T]] { get }
-
Number of rows.
Declaration
Swift
public private(set) var rowsCount: Int { get }
-
Number of columns.
Declaration
Swift
public private(set) var columnsCount: Int { get }
-
Initialize a matrix with a single value repeated on each rows and columns.
Declaration
Swift
public init(rows: Int, columns: Int, repeatedValue: T)
-
Accesses the element at the specified position.
Declaration
Swift
public subscript(row: Int, column: Int) -> T { get set }
-
Get the row at the specified index.
Declaration
Swift
public func row(_ index: Int) -> [T]
-
Get the column at the specified index.
Declaration
Swift
public func column(_ index: Int) -> [T]
-
Flips the matrix over its diagonal.
Declaration
Swift
public func transpose() -> MUMatrix
-
Resize the matrix and crop values if new matrix is smaller or add 0 if new matrix is bigger.
Declaration
Swift
public func resize(row: Int, column: Int) -> MUMatrix
-
Jacobi Single Value Backward Substitution.
Declaration
Swift
public func singleValueBackSubstitution(row: Int, column: Int, wMatrix: MUMatrix, vMatrix: MUMatrix?, bMatrix: MUMatrix?) -> MUMatrix
-
Fill the selected row at index with a repeated value.
Declaration
Swift
public mutating func fillRow(_ index: Int, value: T)
-
Fill the selected column at index with a repeated value.
Declaration
Swift
public mutating func fillColumn(_ index: Int, value: T)
-
Insert a new row at selected index and fill it with a repeated value.
Declaration
Swift
@discardableResult public mutating func insertRow(_ index: Int, value: T) -> MUMatrix
-
Insert a new column at selected index and fill it with a repeated value.
Declaration
Swift
@discardableResult public mutating func insertColumn(_ index: Int, value: T) -> MUMatrix
-
Perform a rotation in Euclidean space.
Declaration
Swift
public mutating func rotate(firstRow: Int, secondRow: Int, cosine: T, sine: T)
-
Swap first and second value at specified row/column.
Declaration
Swift
public mutating func swapValue(first: (row: Int, column: Int), second: (row: Int, column: Int))
-
Jacobi Singular Value Decomposition
Declaration
Swift
public mutating func jacobiSVD(n: Int = -1) -> MUMatrix
-
Jacobi Singular Value Decomposition
Declaration
Swift
public mutating func jacobiSVD(_ matrixV: inout MUMatrix?, n: Int = -1) -> MUMatrix
-
A textual representation of this instance.
Declaration
Swift
public var description: String { get }
-
The type of the elements of an array literal.
Declaration
Swift
public typealias ArrayLiteralElement = [T]
-
Creates an instance initialized with the given elements.
Declaration
Swift
public init(arrayLiteral elements: [T]...)