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.

  • 1
    $\begingroup$ 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. $\endgroup$
    – Anton Menshov
    May 19 at 22:59
  • $\begingroup$ 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. $\endgroup$ May 20 at 7:12
  • $\begingroup$ @LutzLehmann Perhaps but that doesn't agree with the example and seems like a stretch for what the manual says. $\endgroup$ May 21 at 9:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.