Changeset 70
- Timestamp:
- 04/29/08 09:40:11
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spatialindex/trunk/src/spatialindex/LineSegment.cc
r67 r70 173 173 void LineSegment::getCenter(Point& out) const 174 174 { 175 // double coords[m_dimension]; 176 double *coords; 177 coords = (double*) malloc(m_dimension * sizeof(double)); 175 double coords = new double[m_dimension]; 178 176 for (size_t cDim = 0; cDim < m_dimension; cDim++) 179 177 { … … 183 181 } 184 182 183 delete[] coords; 185 184 out = Point(coords, m_dimension); 186 185 } … … 193 192 void LineSegment::getMBR(Region& out) const 194 193 { 195 //double low[m_dimension]; 196 //double high[m_dimension]; 197 double *low; 198 double *high; 199 low = (double*) malloc(m_dimension * sizeof(double)); 200 high = (double*) malloc(m_dimension * sizeof(double)); 194 double low = new double[m_dimension]; 195 double high = new double[m_dimension]; 201 196 for (size_t cDim = 0; cDim < m_dimension; cDim++) 202 197 { … … 205 200 } 206 201 202 delete[] low; 203 delete[] high; 207 204 out = Region(low, high, m_dimension); 208 205 }
