Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Matswift
let matrix1 = Matrix(values: [[2.0, 1.0], [3.0, 1.0]])
let matrix2 = Matrix(values: [[1.0, 3.0], [2.0, 4.0]])
let multiplication = matrix1 * matrix2
let division = matrix1 / matrix2
let addition = matrix1 + matrix2
let subtraction = matrix1 - matrix2
let scalarAddition = 2.0 + matrix1
let scalarMultiplication = matrix1 * 3.0
let dotProduct = matrix1.dot(matrix2)
let sum = matrix1.sum()
let transposed = matrix1.T
let log = matrix1.log()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.