| 247 | **********************************************************************/ |
| 248 | |
| 249 | static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector ycur, |
| 250 | N_Vector fcur) |
| 251 | { |
| 252 | boole invOK; |
| 253 | real r; |
| 254 | CVDiagMem cvdiag_mem; |
| 255 | |
| 256 | cvdiag_mem = (CVDiagMem) lmem; |
| 257 | |
| 258 | /* If gamma has changed, update factor in M, and save gamma value */ |
| 259 | |
| 260 | if (gammasv != gamma) { |
| 261 | r = gamma / gammasv; |
| 262 | N_VInv(M, M); |
| 263 | N_VAddConst(M, -ONE, M); |
| 264 | N_VScale(r, M, M); |
| 265 | N_VAddConst(M, ONE, M); |
| 266 | invOK = N_VInvTest(M, M); |
| 267 | if (!invOK) return (1); |
| 268 | |
| 269 | gammasv = gamma; |
| 270 | } |
| 271 | |
| 272 | /* Apply M-inverse to b */ |
| 273 | N_VProd(b, M, b); |
| 274 | return(0); |
| 275 | } |
| 276 | |
| 277 | /*************** CVDiagFree ****************************************** |
| 278 |
nothing calls this directly
no test coverage detected