Commit b9222383 authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[ADD] tested if an array instead of vector would be a performance improvement...

[ADD] tested if an array instead of vector would be a performance improvement or not, leaving it commented out for later tests.
parent 7a98ec96
......@@ -41,8 +41,12 @@ namespace
// will contain every point-to-point square-distances
std::vector< std::vector< double > > m( qsize, std::vector< double >( rsize, 0.0 ) );
// double **m = new double*[qsize];
for( size_t i = 0; i < qsize; ++i )
{
// m[i] = new double[rsize];
for( size_t j = 0; j < rsize; ++j )
{
m[i][j] = q[i].distanceSquare( r[j] );
......@@ -53,6 +57,7 @@ namespace
for( size_t i = 0; i < qsize; ++i )
{
minSoFar = *( std::min_element( m[i].begin(), m[i].end() ) );
// minSoFar = *( std::min_element( &m[i][0], &m[i][rsize] ) );
if( minSoFar > thresholdSquare )
{
qr += std::sqrt( minSoFar );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment