This task is similar to:

   Matrix multiplication
   Matrix transposition


Task

Implement basic element-wise matrix-matrix and scalar-matrix operations, which can be referred to in other, higher-order tasks.

Implement:

   addition
   subtraction
   multiplication
   division
   exponentiation


Extend the task if necessary to include additional basic operations, which should not require their own specialised task.




ElementWise(M, operation, Val){
    A := Obj_Copy(M), 
    for r, obj in A
        for c, v in obj	{
            V := IsObject(Val) ? Val[r, c] : Val
            switch, operation {
                case "+": A[r, c]	:= A[r, c] + V
                case "-": A[r, c]	:= A[r, c] - V
                case "*": A[r, c]	:= A[r, c] * V
                case "/": A[r, c]	:= A[r, c] / V
                case "Mod": A[r, c]	:= Mod(A[r, c], V)
                case "^": A[r, c]	:= A[r, c] ** V
            }
        }
    return A
}