package matrix4cj

public interface IElementWiseOperation<T> where T <: IElementWiseOperation<T> {
    func elementWise(): ElementWiseWapper<T>

    func elementWiseMul(other: T): T
    func elementWiseDiv(other: T): T

    operator func *(other: ElementWiseWapper<T>): T
    operator func /(other: ElementWiseWapper<T>): T
}

public class ElementWiseWapper<T> where T<: IElementWiseOperation<T> {
    private let _ref: T
    internal init(ref: T) {
        this._ref = ref
    }

    internal prop ref: T {
        get() {
            return this._ref
        }
    }

    public operator func *(other: T): T {
        return this._ref.elementWiseMul(other)
    }

    public operator func /(other: T): T {
        return this._ref.elementWiseDiv(other)
    }
}