<commit_before>// ----------------------------------------------------------------------
//
//  Matrix: Matrix Arbiter
//
// ----------------------------------------------------------------------

#include "matrix_arb.hpp"
#include <iostream>
using namespace std ;

MatrixArbiter::MatrixArbiter()
  : Arbiter(), _matrix(0) {
}

void MatrixArbiter::Init( int size ) {
  Arbiter::Init(size);
  _matrix  = new int [ size * size ] ;
  for ( int i = 0 ; i < size*size ; i++ )
    _matrix[i] = 0 ;
  for ( int i = 0 ; i < size ; i++ )
    _SetPriority( i, size-1, 1 ) ;
}

int MatrixArbiter::_Priority( int row, int column ) const  {
  if ( row <= column ) 
    return _matrix[ row * _input_size + column ] ;
  return 1 -_matrix[ column * _input_size + row ]  ;
}

void MatrixArbiter::_SetPriority( int row, int column, int val )  {
  if ( row <= column ) 
    _matrix[ row * _input_size + column ] = val ;
}

void MatrixArbiter::PrintState() const  {
  cout << "Priority Matrix: " << endl ;
  for ( int r = 0; r < _input_size ; r++ ) {
    for ( int c = 0 ; c < _input_size ; c++ ) {
      cout << _Priority(r,c) << " " ;
    }
    cout << endl ;
  }
  cout << endl ;
}

void MatrixArbiter::UpdateState() {<commit_msg>Fixed matrix arbiter.<commit_after>// ----------------------------------------------------------------------
//
//  Matrix: Matrix Arbiter
//
// ----------------------------------------------------------------------

#include "matrix_arb.hpp"
#include <iostream>
using namespace std ;

MatrixArbiter::MatrixArbiter()
  : Arbiter(), _matrix(0) {
}

void MatrixArbiter::Init( int size ) {
  Arbiter::Init(size);
  _matrix  = new int [ size * size ] ;
  for ( int i = 0 ; i < size*size ; i++ )
    _matrix[i] = 0 ;
  for ( int i = 0 ; i < size ; i++ )
    _SetPriority( i, size-1, 1 ) ;
}

int MatrixArbiter::_Priority( int row, int column ) const  {
  if ( row <= column ) 
    return _matrix[ row * _input_size + column ] ;
  return 1 -_matrix[ column * _input_size + row ]  ;
}

void MatrixArbiter::_SetPriority( int row, int column, int val )  {
  if ( row != column ) 
    _matrix[ row * _input_size + column ] = val ;
}

void MatrixArbiter::PrintState() const  {
  cout << "Priority Matrix: " << endl ;
  for ( int r = 0; r < _input_size ; r++ ) {
    for ( int c = 0 ; c < _input_size ; c++ ) {
      cout << _Priority(r,c) << " " ;
    }
    cout << endl ;
  }
  cout << endl ;
}

void MatrixArbiter::UpdateState() {
{'fraction_non_alphanumeric': 0.25677896466721445, 'fraction_numerical': 0.007395234182415777, 'mean_word_length': 1.851288056206089, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 5, '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': '7029820', 'n_tokens_mistral': 825, 'n_tokens_neox': 809, 'n_words': 222}