File: front.c

package info (click to toggle)
xppaut 8.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,332 kB
  • sloc: ansic: 74,690; makefile: 127; sh: 92
file content (19 lines) | stat: -rwxr-xr-x 375 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <math.h>

double f(double x,double a)
{
  return  x*(1-x)*(x-a);
}

front(double *in,double *out, int nin, int nout, double *var, double *con)
{
  int i;
  double a=in[0];
  double d=in[1];
  double *x=var+1;
  double *xp=x+81;
  xp[0]=f(x[0],a)+d*(x[1]-x[0]);
  xp[80]=f(x[80],a)+d*(x[79]-x[80]);
  for(i=1;i<80;i++)
    xp[i]=f(x[i],a)+d*(x[i+1]-2*x[i]+x[i-1]);
}