[petsc-users] Round-off / Machine Zero with MatMult

Paul Urbanczyk gomer at stanford.edu
Fri Jun 17 14:47:19 CDT 2016


Hello all,

I'm using PETSc's "MatMult" function - MatMult(Mat A, Vec x, Vec y) - to 
do a matrix-vector multiply. The Matrix, A, is anti-symmetric, and the 
vector, x, is uniform. Thus, the resulting vector, y, should be all zeros.

The output I'm seeing typically looks like the following:

Vec Object: Vec_0x20b2000_2 1 MPI processes
   type: mpi
Process [0]
0.
0.
-2.08167e-17
-2.08167e-17
-2.08167e-17
-2.08167e-17
-2.08167e-17
-2.08167e-17
0.
0.

Now, I know that -2.08167e-17 is machine zero, but I'm a bit confused 
why a few of the entries would be exactly zero while others are "machine 
zero." I would expect them all to be either exactly zero, or machine 
zero, but not a mixture. Do you have any idea why this might be?

Thanks for your help!

-Paul




More information about the petsc-users mailing list