\\ Function from nx2 matrix (graph). t_ffm (A,fun=x->x) = {my (v=A[,1],i); x -> i=t_pos(x,v); if (i,A[i,2],fun(x))} \\ n integers from start to end (if end). t_numbers (n,start=1,end=0) = {my (v); v=vector(n,i,i+start-1); if (end,v[1..min(#v,end-start+1)],v)} t_makepairs (v) = vector (#v\2,i,[v[2*i-1],v[2*i]]) t_makereals (v,k=10,b=2) = {my (p,m); p=b^k+0.0; v=t_maketuples(v,k); v=vector(#v,i,t_ruffini(v[i],b)); apply(x->x/p,v)} t_maketuples (v,n) = vector (#v\n,i,vector(n,j,v[(i-1)*n+j])) \\ Concat of k copies of vector v. t_repvec (v,k) = {my (n=#v); vector(n*k,i,v[(i-1)%n+1])} \\ Very crude string splitting. sep has to be a character. t_split (x,sep=" ") = {my (n,J); x=Vec(x); n=#x; J=[i | i<-t_numbers(n), x[i]==sep]; J=concat([0],J); J=concat(J,[n+1]); vector(#J-1,k,t_word(x[J[k]+1..J[k+1]-1],,""))}