<commit_before><?php

/**
 * Pixeler
 *
 * UTF-8 Dot matrix renderer.
 *
 * @package pixeler
 * @author <EMAIL>
 * @version 1.0
 * @copyright <NAME> - 2014 - http://dreamnoctis.com
 */

namespace Pixeler;

class Matrix {
  protected $matrix = null,
            $colors = null,
            $width  = 0,
            $height = 0,
            $size   = 0,
            $csize  = 0;

  public function __construct($width,$height){
    $this->width    = 2 * ($w2=ceil($width/2));
    $this->height   = 4 * ($h2=ceil($height/4));
    $this->size     = $this->width * $this->height;
    $this->csize    = $w2 * $h2;
    $this->matrix   = new \SplFixedArray($this->size);
    $this->colors   = new \SplFixedArray($this->csize);
  }

  public function clearColors() {
    $this->colors   = new \SplFixedArray($this->csize);
  }
<commit_msg>Matrix::setData<commit_after><?php

/**
 * Pixeler
 *
 * UTF-8 Dot matrix renderer.
 *
 * @package pixeler
 * @author <EMAIL>
 * @version 1.0
 * @copyright <NAME> - 2014 - http://dreamnoctis.com
 */

namespace Pixeler;

class Matrix {
  protected $matrix = null,
            $colors = null,
            $width  = 0,
            $height = 0,
            $size   = 0,
            $csize  = 0;

  public function __construct($width,$height){
    $this->width    = 2 * ($w2=ceil($width/2));
    $this->height   = 4 * ($h2=ceil($height/4));
    $this->size     = $this->width * $this->height;
    $this->csize    = $w2 * $h2;
    $this->matrix   = new \SplFixedArray($this->size);
    $this->colors   = new \SplFixedArray($this->csize);
  }

  public function setData(array $data) {
    $this->matrix   = \SplFixedArray::fromArray(array_slice($data,0,$this->size),false);
  }
  
  public function clearColors() {
    $this->colors   = new \SplFixedArray($this->csize);
  }

{'fraction_non_alphanumeric': 0.17807456872565386, 'fraction_numerical': 0.021702838063439065, 'mean_word_length': 2.3670411985018727, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4403173', 'n_tokens_mistral': 668, 'n_tokens_neox': 626, 'n_words': 126}