@@ -427,13 +427,13 @@ void TemporalMemory::activateCells(const SDR &activeColumns, const bool learn) {
427427 const auto columnForSegment = [&](Segment segment) {
428428 return connections.cellForSegment (segment) / cellsPerColumn_;
429429 };
430- const auto identity = [](const UInt a) {return a;}; // TODO use std::identity when c++20
430+ const auto identity = [](const ElemSparse a) {return a;}; // TODO use std::identity when c++20
431431
432432 for (auto &&columnData : groupBy ( // group by columns, and convert activeSegments & matchingSegments to cols.
433433 sparse, identity,
434434 activeSegments_, columnForSegment,
435435 matchingSegments_, columnForSegment)) {
436- UInt column;
436+ CellIdx column;
437437 vector<Segment>::const_iterator activeColumnsBegin, activeColumnsEnd,
438438 columnActiveSegmentsBegin, columnActiveSegmentsEnd,
439439 columnMatchingSegmentsBegin, columnMatchingSegmentsEnd;
@@ -598,9 +598,12 @@ SDR TemporalMemory::cellsToColumns(const SDR& cells) const {
598598 auto correctDims = getColumnDimensions (); // nD column dimensions (eg 10x100)
599599 correctDims.push_back (static_cast <CellIdx>(getCellsPerColumn ())); // add n+1-th dimension for cellsPerColumn (eg. 10x100x8)
600600
601- NTA_CHECK (cells.dimensions == correctDims)
601+ NTA_CHECK (cells.dimensions . size () == correctDims. size () )
602602 << " cells.dimensions must match TM's (column dims x cellsPerColumn) " ;
603603
604+ for (size_t i = 0 ; i<correctDims.size (); i++)
605+ NTA_CHECK (correctDims[i] == cells.dimensions [i]);
606+
604607 SDR cols (getColumnDimensions ());
605608 auto & dense = cols.getDense ();
606609 for (const auto cell : cells.getSparse ()) {
0 commit comments