package matrix4cj

extend Float64 <: IMatrixArithmetic<Float64> {
    public operator func *(other: Matrix): Matrix {
        other * this
    }

    public operator func +(other: Matrix): Matrix {
        other + this
    }

    public operator func -(other: Matrix): Matrix {
        let result = Array<Float64>(other.rowNum * other.colNum) {
            i => this - other.data[i]
        }

        return Matrix(result, rowNum: other.rowNum, colNum: other.colNum, order: other.storageOrder)
    }

    public operator func /(other: Matrix): Matrix {
        other * (1.0 / this)
    }
}