@@ -50,7 +50,17 @@ QC::QC(string simPath, bool verbose=false) {
50
50
exit (1 );
51
51
}
52
52
qcsim->open (simPath);
53
- if (verbose) cout << " Opened .sim file " << simPath << endl;
53
+ if (verbose) cerr << " Opened .sim file " << simPath << endl;
54
+ // define vector objects to hold intensities
55
+ intensity_int = new vector<uint16_t >();
56
+ intensity_float = new vector<float >();
57
+ if (verbose) cerr << " Created intensity vectors" << endl;
58
+ int vectorSize = qcsim->numProbes * qcsim->numChannels ;
59
+ if (verbose) cerr << " Reserving space for " << vectorSize <<
60
+ " intensities... " ;
61
+ intensity_int->reserve (vectorSize);
62
+ intensity_float->reserve (vectorSize);
63
+ if (verbose) cerr << " done." << endl;
54
64
}
55
65
56
66
void QC::writeMagnitude (string outPath, bool verbose) {
@@ -102,8 +112,10 @@ void QC::writeXydiff(string outPath, bool verbose) {
102
112
void QC::getNextMagnitudes (float magnitudes[], char *sampleName, Sim *sim) {
103
113
// compute magnitudes for each probe from next sample in .sim input
104
114
// can handle arbitrarily many intensity channels; also reads sample name
105
- vector<uint16_t > *intensity_int = new vector<uint16_t >;
106
- vector<float > *intensity_float = new vector<float >;
115
+ // vector<uint16_t> *intensity_int = new vector<uint16_t>;
116
+ // vector<float> *intensity_float = new vector<float>;
117
+ intensity_float->clear ();
118
+ intensity_int->clear ();
107
119
if (sim->numberFormat == 0 ) {
108
120
sim->getNextRecord (sampleName, intensity_float);
109
121
} else {
@@ -120,8 +132,6 @@ void QC::getNextMagnitudes(float magnitudes[], char *sampleName, Sim *sim) {
120
132
}
121
133
magnitudes[i] = sqrt (total);
122
134
}
123
- delete intensity_int;
124
- delete intensity_float;
125
135
}
126
136
127
137
void QC::magnitudeByProbe (float magByProbe[], bool verbose=false ) {
0 commit comments