title: Eigen: Packet access and Replicate
body: <p>I'm new to Eigen and I'm trying to understand the semantics of Packet Access in the context of a simple Replicate expression that replicates a vector to (say) 4 columns.</p>
  
  <p>Currently neither the Replicate expression, nor the unary evaluator for it enables packet access and I'm trying to see, for simple cases at least, if I could make some changes so that when I assign to a matrix, the underlying operations can get vectorized.</p>
  
  <p>I tried a hack (which is definitely the wrong way to go about this) in CoreEvaluators.h:1242 where I propagate the PacketAccessBit on the Replicate's ArgType and that generates vectorized code but I'd like to figure out what the right way to do this is.</p>
  
  <pre><code>template&lt;typename ArgType, int RowFactor, int ColFactor&gt; 
  struct unary_evaluator&lt;Replicate&lt;ArgType, RowFactor, ColFactor&gt; &gt;
    : evaluator_base&lt;Replicate&lt;ArgType, RowFactor, ColFactor&gt; &gt;
  {
   [...]
      Flags = (evaluator&lt;ArgTypeNestedCleaned&gt;::Flags &amp; (HereditaryBits|LinearAccessMask|PacketAccessBit) &amp; ~RowMajorBit) | (traits&lt;XprType&gt;::Flags &amp; RowMajorBit),
   [...]
  </code></pre>