示例#1
0
文件: coulomb.c 项目: cran/gsl
void hydrogenicR(int *n, int *l, double *Z, double *r, int *len, double *val, double *err, int *status)
{
	int i;
	gsl_sf_result result;
	gsl_set_error_handler_off();
	
	for(i = 0; i< *len ; i++){
		status[i] = gsl_sf_hydrogenicR_e(n[i], l[i], Z[i], r[i], &result) ;
		val[i] = result.val;
		err[i] = result.err;
	}
}  
示例#2
0
/// Hydrogen wave functions.
double
hydrogen(unsigned int n, double l, double Z, double r)
{
  gsl_sf_result result;
  int stat = gsl_sf_hydrogenicR_e(n, l, Z, r, &result);
  if (stat != GSL_SUCCESS)
    {
      std::ostringstream msg("Error in hydrogen:");
      msg << " n=" << n << " l=" << l << " Z=" << Z << " r=" << r;
      throw std::runtime_error(msg.str());
    }
  else
    return result.val;
}
示例#3
0
static VALUE rb_gsl_sf_hydrogenicR_e(VALUE obj, VALUE n, VALUE l, 
				     VALUE Z, VALUE r)
{
  gsl_sf_result *rslt = NULL;
  VALUE v;
  // local variable "status" declared and set, but never used
  //int status;
  CHECK_FIXNUM(n); CHECK_FIXNUM(l);
  Need_Float(Z); Need_Float(r);
  v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, rslt);
  /*status =*/ gsl_sf_hydrogenicR_e(FIX2INT(n), FIX2INT(l),
			    NUM2DBL(Z), NUM2DBL(r), rslt);
  return v;
}
示例#4
0
 /**
  * C++ version of gsl_sf_hydrogenicR_e().
  * R_n := norm exp(-Z r/n) (2Z/n)^l Laguerre[n-l-1, 2l+1, 2Z/n r]
  * normalization such that psi(n,l,r) = R_n Y_{lm}
  * @param n An integer
  * @param l an integer
  * @param Z A real value
  * @param r A real value
  * @param result The result as a @c gsl::sf::result object
  * @return Error code on failure
  */
 inline int hydrogenicR_e( int const n, int const l, double const Z, double const r, result& result ){
   return gsl_sf_hydrogenicR_e( n, l, Z, r, &result ); } 
示例#5
0
double gsl_sf_hydrogenicR(const int n, const int l, const double Z, const double r)
{
  EVAL_RESULT(gsl_sf_hydrogenicR_e(n, l, Z, r, &result));
}