########## # File @(#) Tab2Mat (TAB PACKAGE) Sat Dec 31 16:08:39 Frh 1994 ########## interface(verboseproc=0); # # Tab2Mat(t) converts a tableau (list of lists) into a tableau (matrix). # Indeed, one may represent a tableau by a matrix. # # convertit un tableau (liste de listes) en un tableau (matrice). # En effet, on peut representer un tableau par une matrice. # # SV021094 SV100598 `TAB/Tab2Mat`:=proc(t) local nl, # number of lines... nc, # number of columns... i; # variable for sequence... nl:=nops(t); if (nl=0) then eval(linalg['matrix'](1,1,[` `])) else nc:=max(op(map(nops,t))); if (nc=0) then eval(linalg['matrix'](nl,1,[seq(` `, i=1..nl)])) else eval(linalg['matrix'](nl,nc, map(op, [seq([op(t[i]),(` `$nc-nops(t[i]))], i=1..nl)]))) fi fi end; # # SV240497 `TAB/Tab2Mat/interface`:=proc(t) `TAB/Tab2Mat`(args); end; # # This is the same function but for the TAB package so that it provides # some verifications on the arguments. # # SV051094 `TAB/Tab2Mat/check`:=proc(t) # checking types... if (not TYP['IsTab'](t)) then ERR['TABPerror'](1,procname) fi; end; # # SV160497 `TAB_PACK/Tab2Mat`:=proc(t) `TAB/Tab2Mat/check`(args); `TAB/Tab2Mat/interface`(args) end; # savelib(`TAB/Tab2Mat`, `TAB/Tab2Mat.m`); savelib(`TAB/Tab2Mat/interface`, `TAB/Tab2Mat/interface.m`); savelib(`TAB/Tab2Mat/check`, `TAB/Tab2Mat/check.m`); savelib(`TAB_PACK/Tab2Mat`, `TAB_PACK/Tab2Mat.m`); if (not assigned(_NOQUIT)) then quit; fi;