/* * Given a vector or list of square size, this function transforms it * into a square matrix according to the VM-map (see Section 1.5 in our thesis). * * input: X VECTOR * output: M MAT */ Define VecToMat(X) A := 0*Identity(Isqrt(Len(X))); // Fill the matrix with the needed values Counter := 1; For I := 1 To Isqrt(Len(X)) Do For J := 1 To Isqrt(Len(X)) Do A[I][J] := X[Counter]; Counter := Counter + 1; EndFor; EndFor; Return A; EndDefine;