Last active
September 28, 2017 04:46
-
-
Save jknthn/5f3a15a291ca375cf4d8372fcd6b0b3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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