예제 #1
0
//! get parameter 
var* sci_fir_up_x::get(int param)
{
var* p_var_ivec = new var_ivec;	// create var_vec;	
 ivec &iv = (dynamic_cast<var_ivec *>(p_var_ivec))->v; // alias to vector	

 var* p_var_cvec = new var_cvec;	// create var_vec;	
 cvec &cv = (dynamic_cast<var_cvec *>(p_var_cvec))->v; // alias to vector	
 	
	switch (param)
	{
	case SCI_SIZE:
		iv.set_length(1);
		iv[0] = get_size();
		#if (DEBUG_LEVEL==3)
			cout << "***** sci_fir_up_x::get SCI_SIZE  *****" << endl;	
			cout << "iv=" << iv << endl;
			cout << "+++++ sci_fir_up_x::get SCI_SIZE  ++++++" << endl;
			go_sleep();
		#endif						
		return(p_var_ivec);

	case SCI_TAPS:
		cv = get_taps();
		#if (DEBUG_LEVEL==3)
			cout << "***** sci_fir_up_x::get SCI_TAPS  *****" << endl;	
			cout << "cv=" << cv << endl;
			cout << "+++++ sci_fir_up_x::get SCI_TAPS  ++++++" << endl;
			go_sleep();
		#endif						
		return(p_var_cvec);

	case SCI_STATE:
		cv = get_input();
		#if (DEBUG_LEVEL==3)
			cout << "***** sci_fir_up_x::get SCI_STATE  *****" << endl;	
			cout << "cv=" << cv << endl;
			cout << "+++++ sci_fir_up_x::get SCI_STATE  ++++++" << endl;
			go_sleep();
		#endif						
		return(p_var_cvec);

	case SCI_OUTPUT:
		cv.set_length(1);
		cv[0] = y0;
		#if (DEBUG_LEVEL==3)
			cout << "***** sci_fir_up_x::get SCI_OUTPUT  *****" << endl;	
			cout << "cv[0]=" << cv[0] << endl;
			cout << "+++++ sci_fir_up_x::get SCI_OUTPUT  ++++++" << endl;
			go_sleep();
		#endif						
		return(p_var_cvec);

	default:
		throw sci_exception ("sci_fir_up_x::get - unknown param");	
	}	     
};
예제 #2
0
int dummy_vf(void) {
  double a;
  fir<double, double> z(32);
  std::vector<double> tmp;

  tmp = get_taps(z);

  a = tmp[0];
  return ((int)a);
}