void SPxSolver::reLoad() { METHOD( "SPxSolver::reLoad()" ); unInit(); unLoad(); theLP = this; if (thepricer) thepricer->clear(); if (theratiotester) theratiotester->clear(); }
bool CbmpPicture::loadBmpPicture(UINT resID) { unLoad(); // 卸载已存在的位图资源 if (! bmp.LoadBitmap(resID)) { return false; } bmp.GetBitmap(&Bitmap); return true; }
void SPxSolver::loadLP(const SPxLP& lp) { METHOD( "SPxSolver::loadLP()" ); clear(); unInit(); unLoad(); if (thepricer) thepricer->clear(); if (theratiotester) theratiotester->clear(); SPxLP::operator=(lp); reDim(); SPxBasis::load(this); }
void LMGraph::loadFromFiles(const char *graphFileName, const char *offsetsFileName, const int h) { unLoad(); // read graph file FILE *f = fopen(graphFileName, "rb"); if(f == NULL) { printf("Couldn't open %s for reading.\n", graphFileName); return; } _fseeki64(f, 0, SEEK_END); graphPos = graphSize = (unsigned int)_ftelli64(f); rewind(f); graphBuffer = new unsigned char [ graphSize ]; if(graphBuffer == NULL) { fclose(f); return; } fread(graphBuffer, 1, graphSize, f); fclose(f); // read offsets file f = fopen(offsetsFileName, "rb"); if(f == NULL) { printf("Couldn't open %s for reading.\n", offsetsFileName); return; } _fseeki64(f, 0, SEEK_END); int fSize = (int)_ftelli64(f); rewind(f); offsetsCnt = (fSize - 16) >> 2; if(offsetsCnt < 2) { delete[] graphBuffer; fclose(f); return; } offsets = new unsigned int [offsetsCnt]; fread(&numNodes, 4, 1, f); fread(&maxSuccListLength, 4, 1, f); fread(&maxResidListLength, 4, 1, f); fread(&maxUncomprSize, 4, 1, f); fread(offsets, 4, offsetsCnt, f); this->h = h; loaded = true; }
int main() { FILE *fDb,*fDb2; int ch; checkCounter(fDb,fDb2); while(1) { printf("\n1.Show Present State of RTL\n"); printf("2.Show IO Stack\n"); printf("3.Feed Catridges\n"); printf("4.Drive Prosessing\n"); printf("5.Unload Catridges\n"); printf("6.Reset RTL\n"); printf("7.Close\n\n"); printf("Enter the choice\n"); scanf("%d",&ch); switch(ch) { case 1:showRTL(fDb,fDb2); break; case 2:showRTLwIO(fDb,fDb2); break; case 3:feedTape(fDb,fDb2); break; case 4:driveProcess(); break; case 5:unLoad(fDb,fDb2); break; case 6:initialize(fDb,fDb2); break; case 7:exit(0); break; default:printf("Wrong choice\n"); break; } } return 0; }
Character::~Character() { unLoad(); }
LMGraph::~LMGraph() { if(loaded) unLoad(); }
void LMGraph::loadFromTextFile(const char *inputFileName, const int h) { // load graph from wg4 file unLoad(); // open input file WG4Reader reader(inputFileName); if(reader.error()) return; numNodes = reader.numNodes(); numEdges = reader.numEdges(); maxSuccListLength = maxResidListLength = maxUncomprSize = 0; offsets = new unsigned int[ (numNodes + (h << 1) - 1) / h ]; offsetsCnt = 0; graphBuffer = new unsigned char[ initGraphBufferSize ]; graphPos = 0; graphSize = initGraphBufferSize; CChunk chunk(numNodes, h); // read all nodes for(int nodeNr = 0, hCounter = 0; nodeNr < numNodes; nodeNr++) { if((nodeNr >> 16) << 16 == nodeNr) printf("."); int numSucc; reader.getNumSucc(&numSucc); // check for maximum list length if(numSucc > maxSuccListLength) maxSuccListLength = numSucc; // get all successors for(int succNr = 0; succNr < numSucc; succNr++) { // take successor node number int succNodeNr; reader.getNextSucc(&succNodeNr); // create an edge //chunk.createEdge(nodeNr, succNodeNr); chunk.createEdge(succNodeNr, hCounter); } hCounter++; // process each chunk if((hCounter == h) || (nodeNr == numNodes-1)) { // add offset offsets[offsetsCnt++] = graphPos; int oldPos = graphPos; graphPos += chunk.process(graphBuffer + graphPos, graphSize - graphPos, &maxResidListLength, &maxUncomprSize); // if buffer 90% filled, resize it if((unsigned int)(10 * graphPos) > (9 * graphSize)) resizeBuffer(); hCounter = 0; // if it is the last chunk, add additional offset if(nodeNr == numNodes-1) offsets[offsetsCnt++] = graphPos; } } this->h = h; loaded = true; }
ConvertCityCodeMgr::~ConvertCityCodeMgr() { unLoad(); }