\\ --------------- GP code --------------------------------------- \\ \\ Time-stamp: \\ \\ Description: Some general routines, including some vectors \\ necessary routines. \\ \\ \\ Original Author: Ariel Pacetti \\ apacetti@math.utexas.edu \\ University of Texas at Austin \\ \\ Created: Wed Oct 4 2000 \\ \\====================================================================== \\ Given a vector, and an index i, removes the i-th coordinate vectorkill(v,i)= {local(ans); vector(length(v)-1,x,if(x=b, ans=concat(N%b,ans); N=(N-N%b)/b); ans=concat(N,ans)} \\====================================================================== \\ Given a prime number, computes some non-quadratic residue nonquadratic(p)= {local(aux); aux=2; while(kronecker(aux,p)==1,aux=aux+1); aux} \\====================================================================== \\ Given a vector, answers the first position whether the element \\ appears. If the element isn't on the vector, answers [] vectorfindall(v,elmnt)= {local(ans); ans=[;]; for(k=1,length(v),if(v[k]==elmnt,ans=concat(ans,k))); ans} \\====================================================================== \\Given a positive integer n, kills the n-th row of the matrix. matkillrow(M,n)=matrix(matsize(M)[1]-1,matsize(M)[2],i,j,if(i