# How to reconcile difference between Arpack manual and example?

The ARPACK manual for znaupd on pp. 128–129 says:

Mode 2:[...]
OP = inv[M]*A and B = M.
[...]
IDO = 1: compute Y = OP * Z and Z = B * X where
IPNTR(1) is the pointer into WORKD for X,
IPNTR(2) is the pointer into WORKD for Y,
IPNTR(3) is the pointer into WORKD for Z.

I interpret that as:

When IDO=1, compute the matrix=vector product $$Z = MX$$ and store the result Z at IPNTR(3) then compute another matrix-vector product $$rhs = AZ$$ then solve the linear system $$MY = rhs$$ and store the result Y at IPNTR(2).

However, the example zndrv3.f does this:

When IDO=1, compute the matrix-vector product $$rhs = AX$$ Then solve the linear system $$MY = rhs$$ and store the result Y at IPNTR(2).

Which seems contradictory since it lacks one of the multiplications by $$M$$ and doesn't store Z.

So I'm not sure what I should do. I tried to copy the example but it didn't work (seems like wrong solutions). There are other possible reasons it didn't work but this is one of them I want to confirm. There's a similar inconsistency for dsaupd and doing it like the examples works OK there.

• Can you clarify, what exactly "didn't work" means and formulate what exactly is the contradiction between the example and the documentation? That can help the community to find a solution to the problem. Commented May 19, 2023 at 22:59
• In programming terms, operations are executed left-to-right, so the statement in a strict reading says that Y=OP*Z is computed with the input Z, and then the output Z, overwriting the input in the referenced array, is computed as Z=B*M. This would also be slightly more useful for the solution of the generalized eigenvalue problem. Commented May 20, 2023 at 7:12
• @LutzLehmann Perhaps but that doesn't agree with the example and seems like a stretch for what the manual says. Commented May 21, 2023 at 9:09