Commit 12a93d9d authored by Nghia Truong's avatar Nghia Truong
Browse files

COMP: Fix VS2013 compiling issues

parent e0e6d88d
......@@ -57,7 +57,7 @@ public:
}
void join(MaxL2NormFunctor& pObj) { m_Result = m_Result > pObj.m_Result ? m_Result : pObj.m_Result; }
Real getResult() const noexcept { return std::sqrt(m_Result); }
Real getResult() const { return std::sqrt(m_Result); }
private:
Real m_Result = 0;
......
......@@ -64,7 +64,7 @@ public:
}
private:
std::atomic_flag m_Lock = ATOMIC_FLAG_INIT;
std::atomic_flag m_Lock;
};
} // end namespace ParallelUtils
} // end namespace imstk
......@@ -33,8 +33,7 @@ SpatialHashTableSeparateChaining::SpatialHashTableSeparateChaining()
void
SpatialHashTableSeparateChaining::insertPoints(const StdVectorOfVec3d& points)
{
// TODO: make more efficient
for (auto i = 0; i < points.size(); i++)
for (size_t i = 0; i < points.size(); i++)
{
this->insertPoint(points[i]);
}
......@@ -49,7 +48,6 @@ SpatialHashTableSeparateChaining::insertPoint(const Vec3d& point)
entry.cellSize = m_cellSize;
m_table->insert(entry);
m_currentID++;
}
......@@ -153,8 +151,8 @@ SpatialHashTableSeparateChaining::getPointsInSphere(std::vector<size_t>& result,
{
PointEntry point;
point.point = Vec3d(ppos[0] + m_cellSize[0] * i,
ppos[1] + m_cellSize[1] * j,
ppos[2] + m_cellSize[2] * k);
ppos[1] + m_cellSize[1] * j,
ppos[2] + m_cellSize[2] * k);
point.cellSize = m_cellSize;
auto bucket = m_table->bucket(point);
......@@ -168,12 +166,12 @@ SpatialHashTableSeparateChaining::getPointsInSphere(std::vector<size_t>& result,
visited.insert(bucket);
auto first = m_table->begin(bucket);
auto last = m_table->end(bucket);
auto last = m_table->end(bucket);
for (auto it = first; it != last; ++it)
{
const Vec3d& qpos = it->point;
const auto d2 = (ppos - qpos).squaredNorm();
const auto d2 = (ppos - qpos).squaredNorm();
if (d2 < radiusSqr)
{
result.push_back(it->ID);
......
......@@ -148,15 +148,13 @@ public:
/// \brief Get data in a cell
/// \param A linearized index of cell
///
template<class IndexType>
CellData& getCellData(IndexType linearizedIdx) { assert(linearizedIdx < m_CellData.size()); return m_CellData[linearizedIdx]; }
CellData& getCellData(size_t linearizedIdx) { assert(linearizedIdx < m_CellData.size()); return m_CellData[linearizedIdx]; }
///
/// \brief Get data in a cell
/// \param A linearized index of cell
///
template<class IndexType>
const CellData& getCellData(IndexType linearizedIdx) const { assert(linearizedIdx < m_CellData.size()); return m_CellData[linearizedIdx]; }
const CellData& getCellData(size_t linearizedIdx) const { assert(linearizedIdx < m_CellData.size()); return m_CellData[linearizedIdx]; }
///
/// \brief Get data in a cell
......
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