/* [+MEQ MatlabEQuilibrium Toolbox+] Swiss Plasma Center EPFL Lausanne 2022. All rights reserved. */
# include "meq.h"
# ifdef SINGLE
# define FCT spdom
# else
# define FCT dpdom
# endif

void FCT(bool *Opy, FLT *Fx, FLT FB, FLT Ip, bool *OXy, int nzy, int nry) {
 bool *pOpy = Opy, *pOXy = OXy;
 FLT  *pFx = Fx + nzy + 3;
 int i,j;
 if (Ip > 0.0)
  for (i = nry; i--; pFx += 2)
   for (j = nzy; j--;)
    *pOpy++ = *pOXy++ & (*pFx++ > FB);
 else
  for (i = nry; i--; pFx += 2)
   for (j = nzy; j--;)
    *pOpy++ = *pOXy++ & (*pFx++ < FB);
}
