version 1.10, 2000/08/22 16:00:25
|
version 1.15, 2002/09/24 15:10:40
|
Line 773 ArgNode_t *argp;
|
Line 773 ArgNode_t *argp;
|
case R_VAR: case R_CONSTANT: break; |
case R_VAR: case R_CONSTANT: break; |
case S_VAR: case S_CONSTANT: |
case S_VAR: case S_CONSTANT: |
leng = strlen(FIRST_ARGSTR(argp)); |
leng = strlen(FIRST_ARGSTR(argp)); |
if( (index(FIRST_ARGSTR(argp), ' ') != NULL) ) { |
if( (index(FIRST_ARGSTR(argp), ',') != NULL) ) { |
sscanf(FIRST_ARGSTR(argp),"%ld,%ld", &seed1, &seed2); |
sscanf(FIRST_ARGSTR(argp),"%ld,%ld", &seed1, &seed2); |
setall(seed1,seed2); |
setall(seed1,seed2); |
} |
} |
Line 788 ArgNode_t *argp;
|
Line 788 ArgNode_t *argp;
|
/* random_multivariate_normal(return_array,item_cnt,seed,dimen,mean_vector,covariance_vector) */ |
/* random_multivariate_normal(return_array,item_cnt,seed,dimen,mean_vector,covariance_vector) */ |
/* the dimension of both mean_vector and covariance_vector should be the same as item_cnt */ |
/* the dimension of both mean_vector and covariance_vector should be the same as item_cnt */ |
/* It will return item_cnt numbers in standard normal deviate in return_array */ |
/* It will return item_cnt numbers in standard normal deviate in return_array */ |
/* */ |
/* item_cnt, seed, dimen, mean_vec, cov_vec |
|
are all destroyed after this function !!!*/ |
{ char *mean_vec_str, *cov_vec_str, *seed_str, *out_vec_str; |
{ char *mean_vec_str, *cov_vec_str, *seed_str, *out_vec_str; |
int dimen, item_cnt, tmp_int; |
int dimen, item_cnt, tmp_int; |
long tmp_long; |
long tmp_long; |
Line 829 ArgNode_t *argp;
|
Line 830 ArgNode_t *argp;
|
errCode = 1; |
errCode = 1; |
break; |
break; |
case S_VAR: case S_CONSTANT: |
case S_VAR: case S_CONSTANT: |
mean_vec_str = SECOND_ARGSTR(argp); |
mean_vec_str = strsave( SECOND_ARGSTR(argp) ); |
break; |
break; |
case IDENTIFIER: |
case IDENTIFIER: |
mean_vec_str = SECOND_ARGNAME(argp); |
mean_vec_str = strsave( SECOND_ARGNAME(argp) ); |
/* |
/* |
resultp->s_type = S_CONSTANT; |
resultp->s_type = S_CONSTANT; |
resultp->s_str = strsave("<<THE FIFTH ARG. OF THIS FUNCTION MUST BE AN ARRAY WITH DATA>>"); |
resultp->s_str = strsave("<<THE FIFTH ARG. OF THIS FUNCTION MUST BE AN ARRAY WITH DATA>>"); |
Line 1160 ArgNode_t *argp;
|
Line 1161 ArgNode_t *argp;
|
break; |
break; |
} /* end second switch */ |
} /* end second switch */ |
} break; |
} break; |
case ARRAY_MOMENTS_F: /* */ |
case ARRAY_MOMENTS_F: /* array_moments(output,input) */ |
{ |
{ |
char *tmp_input; |
char *tmp_input; |
Symbol *r_p; |
Symbol *r_p; |
Line 1610 ArgNode_t *argp;
|
Line 1611 ArgNode_t *argp;
|
sprintf(tmpS,"%s()'s arg. cannot be less than zero.\n",FuncStack[Func_idx].s_name); |
sprintf(tmpS,"%s()'s arg. cannot be less than zero.\n",FuncStack[Func_idx].s_name); |
capa_msg(MESSAGE_ERROR,tmpS); |
capa_msg(MESSAGE_ERROR,tmpS); |
} else { |
} else { |
if( FIRST_ARGINT(argp) <= 20 ) { |
if( FIRST_ARGINT(argp) <= 12 ) { |
resultp->s_type = I_CONSTANT; |
resultp->s_type = I_CONSTANT; |
l_fac = 1; |
l_fac = 1; |
for(ii=2; ii <= FIRST_ARGINT(argp); ii++) { l_fac *= ii; } |
for(ii=2; ii <= FIRST_ARGINT(argp); ii++) { l_fac *= ii; } |
Line 1633 ArgNode_t *argp;
|
Line 1634 ArgNode_t *argp;
|
sprintf(tmpS,"%s()'s arg. cannot be less than zero.\n", FuncStack[Func_idx].s_name); |
sprintf(tmpS,"%s()'s arg. cannot be less than zero.\n", FuncStack[Func_idx].s_name); |
capa_msg(MESSAGE_ERROR,tmpS); |
capa_msg(MESSAGE_ERROR,tmpS); |
} else { |
} else { |
if( FIRST_ARGREAL(argp) <= 20.0 ) { |
if( FIRST_ARGREAL(argp) <= 13.0 ) { |
resultp->s_type = I_CONSTANT; |
resultp->s_type = I_CONSTANT; |
l_fac = 1; |
l_fac = 1; |
for(ii=2; ii <= FIRST_ARGREAL(argp); ii++) { l_fac *= ii; } |
for(ii=2; ii <= FIRST_ARGREAL(argp); ii++) { l_fac *= ii; } |