FerMatrixToFermatArray[mat,varName]
is an auxiliary
function that converts the matrix mat
to a Fermat array
named varName
, where the latter must be a string.
The function returns a string that represents the matrix, a list of auxiliary variables (introduced to be compatible with the restrictions of Fermat) and a replacement rule for converting auxiliary variables back into the original variables.
[{{a, b}, {c, d}}, "mat"] FerMatrixToFermatArray