Fix division

This commit is contained in:
Wenbin Zhang 2016-01-20 11:52:15 -08:00
parent cc4e3e9718
commit 2c89872b54
1 changed files with 2 additions and 2 deletions

View File

@ -165,13 +165,13 @@ public func mul(x: Matrix<Double>, y: Matrix<Double>) -> Matrix<Double> {
}
public func div(x: Matrix<Double>, y: Matrix<Double>) -> Matrix<Double> {
let yInv = y
let yInv = inv(y)
precondition(x.columns == yInv.rows, "Matrix dimensions not compatible")
return mul(x, y: yInv)
}
public func div(x: Matrix<Float>, y: Matrix<Float>) -> Matrix<Float> {
let yInv = y
let yInv = inv(y)
precondition(x.columns == yInv.rows, "Matrix dimensions not compatible")
return mul(x, y: yInv)
}