MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / N_VInvTest

Function N_VInvTest

externalpackages/PVODE/source/nvector.cpp:590–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588
589
590boole N_VInvTest(N_Vector x, N_Vector z)
591{
592 integer i, N;
593 real *xd, *zd, val, gval;
594 machEnvType machenv;
595
596 N = x->length;
597 xd = x->data;
598 zd = z->data;
599 machenv = x->machEnv;
600
601 val = 1;
602 for (i=0; i < N; i++) {
603 if (*xd == ZERO)
604 val = 0;
605 else
606 *zd++ = ONE / (*xd++);
607 }
608
609 gval = PVecAllReduce(val, 3, machenv);
610 if (gval == 0)
611 return(FALSE);
612 else
613 return(TRUE);
614}
615
616
617boole N_VConstrProdPos(N_Vector c, N_Vector x)

Callers 2

CVDiagSetupFunction · 0.85
CVDiagSolveFunction · 0.85

Calls 1

PVecAllReduceFunction · 0.85

Tested by

no test coverage detected