Exemple #1
0
void f2 (void)
{
  vecint foobar = (vecint) {0, 0};
  foobar = vecfunc (foobar);

  f3 ();
}
Exemple #2
0
void f3 (void)
{
  vecint foobar = (vecint) {0, 0};
  foobar = vecfunc (foobar);

  throw int();
}
Exemple #3
0
void f3 (void)
{
  /* Force a use of a V2SI register if available.  On the PPC/E500,
     this will cause the compiler to save the registers in this
     function in 64-bits.  */
  vecint foobar = (vecint) {0, 0};
  foobar = vecfunc (foobar);

  throw int();
}
Exemple #4
0
// Returns f = 0.5F.F at x. ALso stores value of F in fvec
double NRfmin(double x[]) {
	int n = XSIZE;
	double sum = 0;
	int i;
	double *fvectmp;

	fvectmp = vecfunc(x);
	for (i = 0; i < n; i++) {
		fvec[i] = fvectmp[i];
	}
	for (i = 0; i < n; i++) {
		//sum += SQR(fvec[i]);	
		sum += (fvec[i] * fvec[i]);
	}
	return 0.5 * sum;
}
Exemple #5
0
void NRfdjac(double x[], double fvecIn[], double df[XSIZE][XSIZE]) {
	const double EPS = 1.0e-8;
	int n = XSIZE;
	int i, j;

	double xh[XSIZE];
	for(i = 0; i < XSIZE; i++) {
		xh[i] = x[i];
	}

	for(j = 0; j < n; j++) {
		double temp = xh[j];
		double h = EPS * fabs(temp);
		if (h == 0.0) h = EPS;
		xh[j] = temp + h;
		h = xh[j] - temp;
		double *f = vecfunc(xh);
		xh[j] = temp;
		for (i = 0; i < n; i++) {
			df[i][j] = (f[i] - fvecIn[i]) / h;
		}
	}
}