void print_size_summary(FPSetCascading4 *fp) { uint64_t size_B1 = b1_size, size_B2 = fp->bloom2->tai, size_B3 = fp->bloom3->tai, size_B4 = fp->bloom4->tai, size_T4 = fp->false_positives->capacity() * FPSet::bits_per_element; double total_size = (double)(size_B1 + size_B2 + size_B3 + size_B4 + size_T4); fprintf(stderr,"Size of the Bloom table (B1) : %.2lf MB\n", toMB((double)size_B1)); fprintf(stderr,"Size of the Bloom table (B2) : %.2lf MB\n", toMB((double)size_B2)); fprintf(stderr,"Size of the Bloom table (B3) : %.2lf MB\n", toMB((double)size_B3)); fprintf(stderr,"Size of the Bloom table (B4) : %.2lf MB\n", toMB((double)size_B4)); fprintf(stderr,"Size of the FP table (T4) : %.2lf MB\n", toMB((double)size_T4)); fprintf(stderr," Total %.2lf MB for %lld solid kmers ==> %.2lf bits / solid kmer\n\n", toMB(total_size), nbkmers_solid, total_size / nbkmers_solid); }
int QZDir::getType(QString sub) { if (updateZ()==QZF_NONE) return QZF_NONE; if (sub=="." || sub=="..") return QZF_DIR; if (m_type&QZF_ZIP) { QCString str; toMB(str, sub, "euc-kr"); ZEntry *entry = m_dir.z->findByName(str); if (!entry) return QZF_NONE; if (entry->isDir()) return QZF_DIR; else return QZF_FILE; } else { QFileInfo finfo(m_dir.q->absPath()+"/"+sub); if (finfo.isFile()) { QString ext = finfo.extension(false); //printf("EXT:%s\n", (const char*)ext); if (ext.lower()=="zip") return QZF_DIR; return QZF_FILE; } if (finfo.isDir()) return QZF_DIR; return QZF_NONE; } }
void print_size_summary(FPSet *fp) { int bits_per_FP_element = FPSet::bits_per_element; uint64_t size_B1 = b1_size, size_T1 = fp->capacity() * FPSet::bits_per_element; double total_size = (double)(size_B1 + size_T1); fprintf(stderr,"Size of the Bloom table : %.2lf MB\n", toMB(size_B1) ); fprintf(stderr," %.2lf bits / solid kmer\n", b1_size/(double)(nbkmers_solid) ); fprintf(stderr, "Size of the FP table : %lli FP x %d bits = %.2lf MB \n", fp->capacity(), bits_per_FP_element, toMB((double)(size_T1)) ); fprintf(stderr," actual implementation : %.2lf bits / solid kmer\n", size_T1/(double)nbkmers_solid); fprintf(stderr," assuming list of kmers, i.e. sizeof(kmer_type) bits / FP : %.2lf bits / solid kmer \n\n",(fp->capacity()*sizeof(kmer_type)*8LL)/(double)(nbkmers_solid)); fprintf(stderr," Total %.2lf MB for %lld solid kmers ==> %.2lf bits / solid kmer\n\n", toMB(total_size), nbkmers_solid, total_size / nbkmers_solid); }
bool QZDir::cd(QString str) { if (updateZ()==QZF_NONE) return false; if (str.left(2)=="..") { if (!this->cdUp()) return false; if (str.length()>3 && str.at(2)=='/') return this->cd(str.mid(3)); return true; } if (m_type&QZF_ZIP) { QCString spath; toMB(spath, str, "euc-kr"); ZEntry *entry = m_dir.z->findByName(spath); if (entry==NULL || !entry->isDir()){ return false; } m_dir.z = (ZDirEntry*)entry; return true; } else { QString c_path; c_path = m_dir.q->path(); c_path += "/" + str; ZEntry *entry; QCString zname, sname; int my_type = getNames(c_path, zname, sname, &entry); if (!(my_type&QZF_DIR)) return false; if (my_type==QZF_DIR) return m_dir.q->cd(str); m_type = my_type; entry->grab(); m_dir.z = (ZDirEntry*)entry; return true; } }
/** * Get real name for file. */ int getNames(const QString &full, QCString &zname, QCString &sname, ZEntry **buf) { QString zip_name, suname; int prev_type = QZF_NONE; if (QFile::exists(full)) { QFileInfo qfi(full); if (qfi.isDir()) return QZF_DIR; if (qfi.isFile()) { prev_type = QZF_FILE; } else { return QZF_NONE; } } //printf("File[%s] does not exist!\n", (const char*)full); /* finding zip file name */ int idx; idx = full.length(); zip_name = full; while(idx>=0) { if (QFile::exists(zip_name)) break; idx = full.findRev('/', idx); if (idx<0) return prev_type; zip_name = full.left(idx); idx--; } if (toMB(sname, full.mid(idx+1), "euc-kr")<0) sname = full.mid(idx+1); QFileInfo zdir(zip_name); zip_name = zdir.absFilePath(); ZRootEntry *root = ZDirEntry::getEntry(zip_name.utf8()); if (root==NULL) { if (zdir.extension(false)=="dz") { zname = zip_name.utf8(); sname = NULL; return QZF_DZ|QZF_FILE; } return prev_type; } ZEntry *entry = root->findByName(sname); if (entry==NULL) { return prev_type; } zname = zip_name.utf8(); if (buf) *buf = entry; if (entry->isDir()) { return QZF_ZIP|QZF_DIR; } else { return QZF_ZIP|QZF_FILE; } }