def compute(self, inputVector, learn, activeArray):
if not isinstance(inputVector, numpy.ndarray):<EOL><INDENT>raise TypeError("<STR_LIT>" %<EOL>str(type(inputVector)))<EOL><DEDENT>if inputVector.size != self._numInputs:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (<EOL>inputVector.size, self._numInputs))<EOL><DEDENT>self._updateBookeepingVars(learn)<EOL>inputVector = numpy.array(inputVector, dtype=realDType)<EOL>inputVector.reshape(-<NUM_LIT:1>)<EOL>self._overlaps = self._calculateOverlap(inputVector)<EOL>if learn:<EOL><INDENT>self._boostedOverlaps = self._boostFactors * self._overlaps<EOL><DEDENT>else:<EOL><INDENT>self._boostedOverlaps = self._overlaps<EOL><DEDENT>activeColumns = self._inhibitColumns(self._boostedOverlaps)<EOL>if learn:<EOL><INDENT>self._adaptSynapses(inputVector, activeColumns)<EOL>self._updateDutyCycles(self._overlaps, activeColumns)<EOL>self._bumpUpWeakColumns()<EOL>self._updateBoostFactors()<EOL>if self._isUpdateRound():<EOL><INDENT>self._updateInhibitionRadius()<EOL>self._updateMinDutyCycles()<EOL><DEDENT><DEDENT>activeArray.fill(<NUM_LIT:0>)<EOL>activeArray[activeColumns] = <NUM_LIT:1><EOL>
This is the primary public method of the SpatialPooler class. This
function takes a input vector and outputs the indices of the active columns.
If 'learn' is set to True, this method also updates the permanences of the
columns.

:param inputVector: A numpy array of 0's and 1's that comprises the input
    to the spatial pooler. The array will be treated as a one dimensional
    array, therefore the dimensions of the array do not have to match the
    exact dimensions specified in the class constructor. In fact, even a
    list would suffice. The number of input bits in the vector must,
    however, match the number of bits specified by the call to the
    constructor. Therefore there must be a '0' or '1' in the array for
    every input bit.
:param learn: A boolean value indicating whether learning should be
    performed. Learning entails updating the  permanence values of the
    synapses, and hence modifying the 'state' of the model. Setting
    learning to 'off' freezes the SP and has many uses. For example, you
    might want to feed in various inputs and examine the resulting SDR's.
:param activeArray: An array whose size is equal to the number of columns.
    Before the function returns this array will be populated with 1's at
    the indices of the active columns, and 0's everywhere else.