コード例 #1
0
ファイル: polynomial.cpp プロジェクト: engina/pense
double
Polynomial::evaluate_x_y( double x, double y )
{
	assign( "x", x );
	assign( "y", y );
	return evaluator_evaluate_x_y( m_e, x, y );
}
コード例 #2
0
ファイル: cv1d_misc.c プロジェクト: TheTypoMaster/xsmurf
/* 
 * This fct is only kept in case the fct cv1d_mult_with_scaled_ft_fct_ doesn't
 * work properly...
 */ 
void
cv1d_cplx_mult_num_ana_1p_ (complex *a,
			    /*double  (*b_real) (),
			      double  (*b_imag) (),*/
			    void *b_real,
			    void *b_imag,
			    double  param,
			    int     begin,
			    int     end,
			    real    b_step,
			    real    b_begin)
{
  register complex tmp;
  register real    tmp2;
  register int     i;

  assert (a != 0);
  assert (b_real != 0);

  if (b_imag) {
    for (i = begin; i <= end; i++) {
      tmp = a[i];
      tmp2 = b_begin + i*b_step;
      a[i].real = (a[i].real*evaluator_evaluate_x_y(b_real,(double)(tmp2), param)
		   - a[i].imag*evaluator_evaluate_x_y(b_imag,(double)(tmp2), param));
      a[i].imag = (tmp.real*evaluator_evaluate_x_y(b_imag,(double)(tmp2), param)
		   + tmp.imag*evaluator_evaluate_x_y(b_real,(double)(tmp2), param));
    }
  } else {
    for (i = begin; i <= end; i++) {
      tmp2 = evaluator_evaluate_x_y(b_real,(double)(b_begin+i*b_step), param);
      a[i].real *= tmp2;
      a[i].imag *= tmp2;
    }
  }
}