(* Solving Ax = b *) (* To run on command line: math -run "< RandomReal[{-1,1}], Band[{1, 1}] -> RandomReal[{-1,1}], Band[{2, 1}] -> RandomReal[{-1,1}]}, n] Print["----here is the matrix --- "] Print[MatrixForm[T]] Print["----here is the vector --- "] Print[MatrixForm[b]] Print["----Condition number --- "] Print[LinearAlgebra`MatrixConditionNumber[T]] (* solve Tx = b *) S=LinearSolve[T,b] Print["----here is the solution of Ax = b --- "] Print[S] (* compute the residual *) Res = Norm[T.S -b] Print["----the residual --- "] Print[Res] Print["--------- memory used in GB ----------" ] Print[MaxMemoryUsed[]*0.000000001] Exit[]