Skip to content

Commit ac9c2e4

Browse files
committed
use set (ordered) as SDR needs sorted input
1 parent bfdd832 commit ac9c2e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/htm/algorithms/TemporalMemory.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include <iterator>
3737
#include <string>
3838
#include <vector>
39-
#include <unordered_set>
39+
#include <set>
4040

4141

4242
#include <htm/algorithms/TemporalMemory.hpp>
@@ -604,8 +604,8 @@ SDR TemporalMemory::getPredictiveCells() const {
604604
correctDims.push_back(static_cast<CellIdx>(getCellsPerColumn()));
605605
SDR predictive(correctDims);
606606

607-
std::unordered_set<CellIdx> uniqueCells;
608-
uniqueCells.reserve(activeSegments_.size());
607+
std::set<CellIdx> uniqueCells;
608+
//uniqueCells.reserve(activeSegments_.size());
609609

610610
for (const auto segment : activeSegments_) {
611611
const CellIdx cell = connections.cellForSegment(segment);

0 commit comments

Comments
 (0)