def generateCoincMatrix(nCoinc=10, length=500, activity=50):
 coincMatrix0 = SM32(int(nCoinc), int(length))
 theOnes = numpy.array(([1.0] * activity), dtype=numpy.float32)
 for rowIdx in xrange(nCoinc):
  coinc = numpy.array(random.sample(xrange(length), activity), dtype=numpy.uint32)
  coinc.sort()
  coincMatrix0.setRowFromSparse(rowIdx, coinc, theOnes)
 coincMatrix = SM32(int(nCoinc), int(length))
 coincMatrix.initializeWithFixedNNZR(activity)
 return coincMatrix0

def generateCoincMatrix ( nCoinc = 10 , length = 500 , activity = 50 ) : coincMatrix0 = SM32 ( int ( nCoinc ) , int ( length ) ) theOnes = numpy . array ( ( [ 1.0 ] * activity ) , dtype = numpy . float32 ) for rowIdx in xrange ( nCoinc ) : coinc = numpy . array ( random . sample ( xrange ( length ) , activity ) , dtype = numpy . uint32 ) coinc . sort ( ) coincMatrix0 . setRowFromSparse ( rowIdx , coinc , theOnes ) coincMatrix = SM32 ( int ( nCoinc ) , int ( length ) ) coincMatrix . initializeWithFixedNNZR ( activity ) return coincMatrix0
generate a coincidence matrix .