kernelopts(numcpus=1); # setting numcpus to 1 is not sufficient to turn off multicores for LinearAgebra which is an external library # In Unix use setenv OMP_NUM_THREADS 1 in the shell U := rand(10^10): F := proc() Float(U(),-10) end: # create 10 digit float on [0,1) with(linalg): with(LinearAlgebra): for n in [50,100,200] do printf("n=%d\n\n",n); A := matrix(n,n,F): B := matrix(n,n,F): b := vector(n,F): C := augment(A,b): # Using the old linalg package with software floats CodeTools[Usage](rref(C)): CodeTools[Usage](linsolve(A,b)): CodeTools[Usage](multiply(A,B)): CodeTools[Usage](singularvals(A)): CodeTools[Usage](eigenvalues(A)): printf("LinearAlgebra\n"); # Using the new Linear Algebra package with hardware floats A := Matrix(convert(A,listlist),datatype=float[8]): B := Matrix(convert(B,listlist),datatype=float[8]): b := Vector(convert(b,list),datatype=float[8]): C := : CodeTools[Usage](ReducedRowEchelonForm(A)): # slow? # Run these 100 times to get an accurate timing CodeTools[Usage](to 100 do LinearSolve(A,b) od): CodeTools[Usage](to 100 do A.B od): CodeTools[Usage](to 100 do SingularValues(A) od): CodeTools[Usage](to 100 do Eigenvalues(A) od); od: