title: Fast operations between binary numpy arrays
body: <p>I want to perform memory and time efficient operations between numpy arrays containing only <code>-1</code> and <code>1</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>&gt;&gt;&gt; m1
  array([[-1,  1,  1, -1],
         [ 1, -1, -1, -1]], dtype=int8)
  &gt;&gt;&gt; m2
  array([-1,  1, -1,  1], dtype=int8)
  &gt;&gt;&gt; np.dot(m1, m2)
  array([ 0, -2], dtype=int8)
  </code></pre>
  
  <p>In this case, the binary variables are represented by <code>np.int8</code> type variables, which is already a bit better than <code>np.int32</code>. </p>
  
  <p>Is there a way to represents this values by one bit sized variables and perform fast operations? I need to do dot products and additions.</p>