37 #include <pds/pdsrv.h> 40 double pds_inc(
unsigned long int t3,
unsigned long int t5,
41 unsigned long int t7,
unsigned long int t11,
42 unsigned long int t13,
unsigned long int t17);
45 void pds_next_inc(
unsigned long int *t3 ,
unsigned long int *t5,
46 unsigned long int *t7 ,
unsigned long int *t11,
47 unsigned long int *t13,
unsigned long int *t17);
49 int main(
int argc,
char** argv)
52 unsigned long int t3=0;
53 unsigned long int t5=0;
54 unsigned long int t7=0;
55 unsigned long int t11=0;
56 unsigned long int t13=0;
57 unsigned long int t17=0;
62 C0=pds_inc(t3,t5,t7,t11,t13,t17);
63 printf(
"%10lu:::%10lu:%10lu:{%3lu,%3lu,%3lu,%3lu,%3lu,%3lu}\n",i,
PDS_RAND_MAX,(
unsigned long int)C0,t3,t5,t7,t11,t13,t17);
64 pds_next_inc(&t3,&t5,&t7,&t11,&t13,&t17);
69 C1=pds_inc(t3,t5,t7,t11,t13,t17);
70 printf(
"%10lu:::%10lu:%10lu:{%3lu,%3lu,%3lu,%3lu,%3lu,%3lu}\n",i,
PDS_RAND_MAX,(
unsigned long int)C1,t3,t5,t7,t11,t13,t17);
71 pds_next_inc(&t3,&t5,&t7,&t11,&t13,&t17);
76 printf(
"<<Numero total de variables aleatorias distintas : %lu>>\n",i);
95 double pds_inc(
unsigned long int t3,
unsigned long int t5,
96 unsigned long int t7,
unsigned long int t11,
97 unsigned long int t13,
unsigned long int t17)
99 return pow(3.0,t3)*pow(5.0,t5)*pow(7.0,t7)*pow(11.0,t11)*pow(13.0,t13)*pow(17.0,t17);
116 void pds_next_inc(
unsigned long int *t3 ,
unsigned long int *t5,
117 unsigned long int *t7 ,
unsigned long int *t11,
118 unsigned long int *t13,
unsigned long int *t17)
121 if(pds_inc((*t3)+1,*t5,*t7,*t11,*t13,*t17)<(
PDS_RAND_MAX*1.0)) {*t3=(*t3)+1;}
124 if(pds_inc(*t3,(*t5)+1,*t7,*t11,*t13,*t17)<(
PDS_RAND_MAX*1.0)) {*t5=(*t5)+1;}
127 if(pds_inc(*t3,*t5,(*t7)+1,*t11,*t13,*t17)<(
PDS_RAND_MAX*1.0)) {*t7=(*t7)+1;}
130 if(pds_inc(*t3,*t5,*t7,(*t11)+1,*t13,*t17)<(
PDS_RAND_MAX*1.0)) {*t11=(*t11)+1;}
133 if(pds_inc(*t3,*t5,*t7,*t11,(*t13)+1,*t17)<(
PDS_RAND_MAX*1.0)) {*t13=(*t13)+1;}
136 if(pds_inc(*t3,*t5,*t7,*t11,*t13,(*t17)+1)<(
PDS_RAND_MAX*1.0)) {*t17=(*t17)+1;}
137 else {*t17=0;*t3=0;*t5=0;*t7=0;*t11=0;*t13=0;}