- read->read(nameMap);
- globaldata->setListVector(read->getListVector());
- globaldata->setSparseMatrix(read->getMatrix());
+
+ if (format == "matrix") {
+ ifstream in;
+ openInputFile(filename, in);
+ matrix = new FullMatrix(in); //reads the matrix file
+ //memory leak prevention
+ //if (globaldata->gMatrix != NULL) { delete globaldata->gMatrix; }
+ globaldata->gMatrix = matrix; //save matrix for coverage commands
+ }else {
+ read->read(nameMap);
+ //to prevent memory leak
+ if (globaldata->gListVector != NULL) { delete globaldata->gListVector; }
+ globaldata->gListVector = read->getListVector();
+ if (globaldata->gSparseMatrix != NULL) { delete globaldata->gSparseMatrix; }
+ globaldata->gSparseMatrix = read->getMatrix();
+ }