-
Notifications
You must be signed in to change notification settings - Fork 276
Conversation
instead of dense array of 0/1 for each input position
..waiting until unittests are more verbose (#200) |
mask = sp.mapPotential_(2, false); | ||
NTA_CHECK(check_vector_eq(expectedMask2, mask)); | ||
|
||
// Test with wrapAround and potentialPct = 1 | ||
sp.setPotentialPct(1.0); | ||
|
||
UInt expectedMask3[12] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1}; | ||
UInt expectedMask3[12] = {0, 1, 2, 3, 11}; //{1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about comment on the line before for consistency, and if this is to visualize it then no need for the commas, etc:
// 111100000001
UInt expectedMask3[12] = {0, 1, 2, 3, 11};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about comment on the line before for consistency, and if this is to
visualize it then no need for the commas, etc:
Well, I wanted that to be minimal work :)
@@ -1535,7 +1535,9 @@ namespace nta { | |||
<< "Invalid row index: " << row; | |||
NTA_ASSERT((size_type)(end - begin) == nCols()) | |||
<< "SparseBinaryMatrix::rowFromDense: " | |||
<< "Invalid vector size"; | |||
<< "Invalid vector size " | |||
<< (size_type)(end - begin) << " vs. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra indentation space on this line and next can be removed
👍 |
@breznak Good to merge once you've addressed the remaining review comments. |
@breznak Still in your court? |
@breznak Status update? |
@@ -1545,6 +1547,24 @@ namespace nta { | |||
} | |||
|
|||
//-------------------------------------------------------------------------------- | |||
template <typename InputIterator> | |||
inline void | |||
rowFromSparse(size_type row, InputIterator begin, InputIterator end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a method called replaceSparseRow
that looks like it does the same thing
Sparse map potential
Fixed Collections. It is now a header only implementation
mapPotential() in SP returns a sparse array of active indices only.
Fixes c++ part of numenta/nupic-legacy#1385
Fixes #279