void ReadANSYS::useReadANSYSAttribute(const coDistributedObject *inName) { const char *wert = NULL; if (inName == NULL) { return; } wert = inName->getAttribute("READ_ANSYS"); if (wert == NULL) // perhaps the attribute is hidden in a set structure { if (inName->isType("SETELE")) { int no_elems; const coDistributedObject *const *setList = ((coDoSet *)(inName))->getAllElements(&no_elems); int elem; for (elem = 0; elem < no_elems; ++elem) { useReadANSYSAttribute(setList[elem]); } } return; } istringstream pvalues(wert); char *value = new char[strlen(wert) + 1]; while (pvalues.getline(value, strlen(wert) + 1)) { int param; for (param = 0; param < hparams_.size(); ++param) { hparams_[param]->load(value); } } delete[] value; }
int get_saturation_pvalues(Chromosome &chromosome, int q_min, int q_max, int length, int t_f, int t_r, int c_f, int c_r, bool ctrl) { if(ctrl) { Pvalues pvalues(length, q_min, q_max, t_f, t_r, c_f, c_r); for(int i=0;i<chromosome.sum_num;i++) { chromosome.SUMMITS[i].p_value=pvalues.get_p_value( chromosome.SUMMITS[i].q_beg_chip+chromosome.SUMMITS[i].q_end_chip -(chromosome.SUMMITS[i].q_beg_ctrl+chromosome.SUMMITS[i].q_end_ctrl),false); } } else { Pvalues pvalues(length, q_min, q_max, t_f,t_r); for(int i=0;i<chromosome.sum_num;i++) { chromosome.SUMMITS[i].p_value=pvalues.get_p_value(chromosome.SUMMITS[i].q_beg_chip+chromosome.SUMMITS[i].q_end_chip, false); } } return 0; }
DataFrame Result::as_data_frame(CharacterVector names) { int nrow = size(); CharacterVector y(nrow); CharacterVector x(nrow); CharacterVector z(nrow); NumericVector pvalues(nrow); int copied = 0; for (int i = 0; i < (int) results_.size(); ++i) { results_[i]->copy(y, x, z, pvalues, copied); copied += results_[i]->size(); } return DataFrame::create( Named(CHAR(names[0])) = y, Named(CHAR(names[1])) = x, Named(CHAR(names[2])) = z, Named("pvalue") = pvalues); }
void muste_statmsf(char *argv) { int i; // RS Variable init prind=1; sum=NULL; sum2=NULL; f=NULL; w=NULL; f2=NULL; X=NULL; rlabX=NULL; clabX=NULL; T=NULL; rlabT=NULL; clabT=NULL; v=NULL; s_init(argv); typeT=lrT=lcT=0; // to avoid warnings from compiler // specs=spec_msf; if (g<2) { init_remarks(); rem_pr("STATMSF <Survo_data>,<output_line> "); rem_pr(" LIMITS=<low1>,<up1>,<up2>,..."); rem_pr("computes means, standard deviations, and frequency distributions"); rem_pr("of active variables. Cases can be limited by IND and CASES specifications."); rem_pr("The frequencies are computed according to a classification given by the"); rem_pr("LIMITS specification where <low1> is the lower limit of the first class 1"); rem_pr("and <up1>,<up2>,... are the upper limits of the classes 1,2,..."); rem_pr("The default setting is LIMITS=0,1,2,3,4,5 ."); wait_remarks(1); rem_pr("STATMSF <Survo_data> / TRESHOLDS=<matrix_file>"); rem_pr("where <matrix_file> is of the form"); rem_pr("row label 1st column"); rem_pr("variable_1 treshold_value_1"); rem_pr("variable_2 treshold_value_2"); rem_pr("..."); rem_pr("computes relative frequencies of values exceeding treshold values"); rem_pr("given as the first column of <matrix_file> for variables given"); rem_pr("as row labels in <matrix_file> for active observations"); rem_pr("in <Survo_data>."); rem_pr("The results are saved in a matrix file TAILFREQ.M ."); wait_remarks(2); return; } results_line=0; i=spec_init(r1+r-1); if (i<0) return; i=spfind("PRIND"); if (i>=0) prind=atoi(spb[i]); i=spfind("TRESHOLDS"); if (i>=0) { pvalues(i); return; } if (g>2) { results_line=edline2(word[2],1,1); if (results_line==0) return; } i=data_read_open(word[1],&d); if (i<0) return; i=spfind("LIMITS"); if (i<0) { n_class=5; limit[0]=0; for (i=1; i<=5; ++i) limit[i]=i; } else { strcpy(x,spb[i]); n_class=split(x,osa,MAXCLASS); for (i=0; i<n_class; ++i) limit[i]=atof(osa[i]); --n_class; } i=mask(&d); if (i<0) return; weight_variable=activated(&d,'W'); i=m_test_scaletypes(); if (i<0) return; i=conditions(&d); if (i<0) return; /* permitted only once */ m=d.m_act; if (m==0) { sur_print("\nNo active (acceptable) variables!"); WAIT; return; } i=m_space_allocation(); if (i<0) return; // i=optdim_d(); if (i && i<d.m) err(0); // i=optdim_o(); if (i && (long)i<d.n) err(0); compute_sums(); m_printout(); data_close(&d); s_end(argv); }