Matrix

public struct Matrix
extension Matrix: CustomStringConvertible
extension Matrix: Hashable
extension Matrix: Sequence

Swift representation of a complex 2-dimensional matrix

Public properties

  • Number of rows in the matrix

    Declaration

    Swift

    public let rowCount: Int
  • Number of columns per row in the matrix

    Declaration

    Swift

    public let columnCount: Int
  • Returns first element in first row

    Declaration

    Swift

    public var first: Complex<Double> { get }
  • Use [row, column] to access elements in the matrix

    Declaration

    Swift

    public subscript(row: Int, column: Int) -> Complex<Double> { get }

Public init methods

  • Errors throwed by Matrix()

    See more

    Declaration

    Swift

    public enum InitError : Error
  • Initializes a new Matrix instance with elememts

    Declaration

    Swift

    public init(_ elements: [[Complex<Double>]]) throws

    Parameters

    elements

    List of sub-list where each sub-list is a row in the matrix.

    Return Value

    A new Matrix instance.

CustomStringConvertible methods

  • Declaration

    Swift

    public var description: String { get }

Public properties

  • Maps matrix into a list of rows

    Declaration

    Swift

    public var elements: [[Complex<Double>]] { get }

Sequence methods

  • Declaration

    Swift

    public typealias Iterator = ArraySlice<Complex<Double>>.Iterator
  • Returns iterator that traverses the matrix by column

    Declaration

    Swift

    public func makeIterator() -> Matrix.Iterator