int main() { loadImages(); initData(); initResults(); cross2DConv(); saveImages(); freeMem(); return 0; }
void HospitalInternalPaymentForm::onSummarizing() { initResults(); QVector<InternalPaymentItem*> payments = InternalPayment::selectFromDB(HospitalInPatient,m_startDateEdit->date(), m_endDateEdit->date()); for(int i = 0; i < payments.size() ; i++) { m_resultModel->setItem(i, 0, new QStandardItem(payments.at(i)->m_strName)); m_resultModel->setItem(i, 1, new QStandardItem(QString::number(payments.at(i)->m_dDueIncome))); } updateIncome(); }
void HospitalInternalPaymentForm::onParticulars() { initResults(); QVector<QVector<QString> > *dueIncome = new QVector<QVector<QString> >; dueIncome = InternalPayment::selectFromDB( m_startDateEdit->date(), m_endDateEdit->date(), "HospitalReceipt", g_strChargeDetails, "HospitalID", g_strAccount); if(dueIncome == NULL) return; for(int nIndexReceipt = 0;nIndexReceipt<dueIncome->size();nIndexReceipt++) { double all = 0.0; QVector<QString> temp = dueIncome->at(nIndexReceipt); for(int nIndexPatient = 0;nIndexPatient<temp.size();nIndexPatient++) { if(nIndexReceipt == 0) { m_resultModel->setHorizontalHeaderItem(nIndexPatient+1, new QStandardItem(Inpatient::getNameByID(temp.at(nIndexPatient)))); } else if( nIndexReceipt > 0) { m_resultModel->setItem(nIndexReceipt-1, nIndexPatient, new QStandardItem(temp.at(nIndexPatient))); if(nIndexPatient!=0) all += temp.at(nIndexPatient).toDouble(); } } if(nIndexReceipt == 0) { m_resultModel->setHorizontalHeaderItem(temp.size()+1, new QStandardItem("合计")); } else if(nIndexReceipt > 0) { m_resultModel->setItem(nIndexReceipt-1, temp.size(), new QStandardItem(QString::number(all))); } } updateIncome(); }
/* * Temporary usage: run_queries <index file> <type> [length] [V] */ int main (int argc, char *argv[]) { int error = 0; error=0; char *filename; char querytype; int i; uint sampleK =1; if (argc < 6) { print_search_usage(argv[0]); exit (1); } filename = argv[1]; sampleK = atoi(argv[2]); querytype = *argv[3]; cerr << "\n SampleK value is " <<sampleK << " BUT IT IS NOT USING ACTUALLY"; //parameters for intersect-operations char *params = NULL; int nchars, len; nchars = argc-5; //nchars = argc; for(i=4;i<argc;i++) nchars += strlen(argv[i]); params = (char *) malloc((nchars+1)*sizeof(char)); params[nchars] = '\0'; nchars = 0; for(i=5;i<argc;i++) { len = strlen(argv[i]); strncpy(params+nchars,argv[i],len); params[nchars+len] = ' '; nchars += len+1; } params[nchars-1] = '\0'; // end parameters /**/ timeFile = fopen("timesSearch.txt","a"); /**/ initResults(argv[1],argv[1]); /**/ fprintf(timeFile,"\n Searching!!: %s %s %s %s %s %s",argv[0],argv[1],argv[2],argv[3],argv[4], params); Load_time = getTime (); //error = load_il (filename, &Index); //IFERRORIL (error); g = new RepairPost(filename); Load_time = getTime () - Load_time; Load_time *= TIMEFACTOR_TO_SEC; fprintf (stderr, "Load index time = %.6f secs\n", Load_time); fflush(stderr); //error = setDefaultSearchOptions_il (Index, params); //IFERRORIL (error); //error = size_il(Index, &Index_size); //IFERRORIL (error); //error = size_il_uncompressed(Index, &Uncompressed_Index_size); //IFERRORIL (error); Index_size = g->size(); Uncompressed_Index_size = g->sizeUncompressed; fprintf(stderr,"Index size = %u bytes\n", Index_size); fflush(stderr); Index_size /=1024; fprintf(stderr,"Index size = %u Kb\n", Index_size); fflush(stderr); switch (querytype){ case EXTRACT: if (argc < 6) { print_search_usage(argv[0]); exit (1); } if (argc > 6) if (*argv[6] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", EXTRACT); } do_extract((uint) atoi(argv[4]), (uint) atoi(argv[5]) ); break; case RECOVER: printf("\n******** %d ******\n" , argc); fflush(stdout);fflush(stderr); if (argc < 6) { print_search_usage(argv[0]); exit (1); } if (argc > 6) if (*argv[6] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", RECOVER); } do_recover(filename); break; case INTERSECT2_SVS_U: if (argc < 6) { print_search_usage(argv[0]); exit (1); } if (argc > 6) if (*argv[6] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", INTERSECT2_SVS_U); } do_intersect2svsUnc((uint) atoi(argv[4]), (uint) atoi(argv[5]) ); break; case INTERSECT2_MERGE: if (argc < 6) { print_search_usage(argv[0]); exit (1); } if (argc > 6) if (*argv[6] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", INTERSECT2_MERGE); } do_intersect2merge((uint) atoi(argv[4]), (uint) atoi(argv[5]) ); break; default: fprintf (stderr, "Unknow option: main ru\n"); exit (1); } //error = free_il(Index); //IFERRORIL(error); delete g; /**/ fclose(timeFile); free(params); return 0; }
struct results* declResults() { struct results* result = malloc(sizeof(struct results)); initResults(result); return result; }
void ClinicInternalPaymentForm::init() { initResults(); m_startDateEdit->setDate(QDate::currentDate()); m_endDateEdit->setDate(QDate::currentDate()); }
/* * Temporary usage: run_queries <index file> <type> [length] [V] */ int main (int argc, char *argv[]) { int error = 0; char *filename; char querytype; uint i; if (argc < 5) { print_search_usage(argv[0]); exit (1); } filename = argv[1]; querytype = *argv[2]; //parameters for intersect-operations char *params = NULL; int nchars, len; nchars = argc-5; //nchars = argc; for(i=3;i< (uint)argc;i++) nchars += strlen(argv[i]); params = (char *) malloc((nchars+1)*sizeof(char)); params[nchars] = '\0'; nchars = 0; for(i=4;i< (uint)argc;i++) { len = strlen(argv[i]); strncpy(params+nchars,argv[i],len); params[nchars+len] = ' '; nchars += len+1; } params[nchars-1] = '\0'; // end parameters /**/ timeFile = fopen("timesSearch.txt","a"); /**/ initResults(argv[1],argv[1]); /**/ /**/ fprintf(timeFile,"\n Searching!!: %s %s %s %s %s",argv[0],argv[1],argv[2],argv[3], params); Load_time = getTime (); error = load_il (filename, &Index); IFERRORIL (error); buildBell_il(Index, "golombRice_BitmapBellMoff.m"); Load_time = getTime () - Load_time; Load_time *= TIMEFACTOR_TO_SEC; fprintf (stderr, "Load index time = %.6f secs\n", Load_time); error = setDefaultSearchOptions_il (Index, params); IFERRORIL (error); error = size_il(Index, &Index_size); IFERRORIL (error); error = size_il_uncompressed(Index, &Uncompressed_Index_size); IFERRORIL (error); Index_size /=1024; fprintf(stderr,"Index size = %lu Kb\n", (ulong)Index_size); switch (querytype){ case EXTRACT: if (argc < 5) { print_search_usage(argv[0]); exit (1); } if (argc > 5) if (*argv[5] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", EXTRACT); } do_extract((uint) atoi(argv[3]), (uint) atoi(argv[4]) ); break; case EXTRACTNOMALLOC: if (argc < 5) { print_search_usage(argv[0]); exit (1); } if (argc > 5) if (*argv[5] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", EXTRACTNOMALLOC); } do_extract_no_malloc((uint) atoi(argv[3]), (uint) atoi(argv[4]) ); break; case INTERSECT2: if (argc < 5) { print_search_usage(argv[0]); exit (1); } if (argc > 5) if (*argv[5] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", INTERSECT2); } do_intersect2((uint) atoi(argv[3]), (uint) atoi(argv[4]) ); break; case INTERSECTN: if (argc < 5) { print_search_usage(argv[0]); exit (1); } if (argc > 5) if (*argv[5] == VERBOSE){ Verbose = 1; fprintf(stderr,"%c", INTERSECTN); } do_intersectN((uint) atoi(argv[3]), (uint) atoi(argv[4]) ); break; default: fprintf (stderr, "Unknow option: main ru\n"); exit (1); } error = free_il(Index); IFERRORIL(error); /**/ fclose(timeFile); free(params); return 0; }