xref: /petsc/src/vec/pf/impls/string/cstringbase.template (revision c4762a1b19cd2af06abeed90e8f9d34fb975dd94)
1#define PETSCVEC_DLL
2/*$Id: cstringbase.c,v 1.2 2000/02/04 21:37:18 bsmith Exp $*/
3#include <petscsys.h>
4
5#define NOTLIKELY -1.234567890123
6
7EXTERN_C_BEGIN
8int PETSCVEC_DLLEXPORT PFApply_String(void *value,int n,Scalar *in,Scalar *out)
9{
10  int       i;
11  Scalar    x,y,z,f = NOTLIKELY,x1,x2,x3,x4,x5,f1,f2,f3,f4,f5;
12
13  PetscFunctionBegin;
14  for (i=0; i<n; i++) {
15    x1 = x = in[_MIN_*i];
16#if (_MIN_ > 1)
17    x2 = y = in[_MIN_*i+1];
18#endif
19#if (_MIN_ > 2)
20    x3 = z = in[_MIN_*i+2];
21#endif
22#if (_MIN_ > 3)
23    x4 = in[_MIN_*i+3];
24#endif
25#if (_MIN_ > 4)
26    x5 = in[_MIN_*i+4];
27#endif
28    FUNCTION;
29    if (f == NOTLIKELY) {
30      out[_NOUT_*i] = f1;
31    } else {
32      out[_NOUT_*i] = f;
33    }
34#if (_NOUT_ > 1)
35    out[_NOUT_*i+1] = f2;
36#endif
37#if (_NOUT_ > 2)
38    out[_NOUT_*i+2] = f3;
39#endif
40#if (_NOUT_ > 3)
41    out[_NOUT_*i+3] = f4;
42#endif
43#if (_NOUT_ > 4)
44    out[_NOUT_*i+4] = f5;
45#endif
46  }
47  PetscFunctionReturn(0);
48}
49EXTERN_C_END
50