<commit_before>#ifndef _CANVAS_MATRIX_H_
#define _CANVAS_MATRIX_H_

#include <Point.h>

namespace canvas {
  class Matrix {
  public:
  Matrix() : a(1.0), b(0.0), c(0.0), d(1.0), e(0.0), f(0.0) { }
  Matrix(double _a, double _b, double _c, double _d, double _e, double _f)
    : a(_a), b(_b), c(_c), d(_d), e(_e), f(_f) { }
    
    Matrix operator* (const Matrix & other) {
      return multiply(*this, other);    
    }
    
    const Matrix & operator*= (const Matrix & other) {
      *this = multiply(*this, other);
      return *this;
    }
    
    Point multiply(double x, double y) const {
      return Point( x * A.a + y * A.c + A.e,
		    x * A.b + y * A.d + A.f
		    );    
    }
    
    Point multiply(const Point & p) const {
      return multiply(p.x, p.y);
    }
    
  private:
    static Matrix multiply(const Matrix & A, const Matrix & B) {
      return Matrix( A.a * B.a + A.c * B.b,
		     A.b * B.a + A.d * B.b,
		     A.a * B.c + A.c * B.d,
		     A.b * B.c + A.d * B.d,
		     A.a * B.e + A.c * B.f + A.e,
		     A.b * B.e + A.d * B.f + A.f
		     );
    }
    
    double a, b, c, d, e, f;
  };
};

#endif
<commit_msg>fix point multiply<commit_after>#ifndef _CANVAS_MATRIX_H_
#define _CANVAS_MATRIX_H_

#include <Point.h>

namespace canvas {
  class Matrix {
  public:
  Matrix() : a(1.0), b(0.0), c(0.0), d(1.0), e(0.0), f(0.0) { }
  Matrix(double _a, double _b, double _c, double _d, double _e, double _f)
    : a(_a), b(_b), c(_c), d(_d), e(_e), f(_f) { }
    
    Matrix operator* (const Matrix & other) {
      return multiply(*this, other);    
    }
    
    const Matrix & operator*= (const Matrix & other) {
      *this = multiply(*this, other);
      return *this;
    }
    
    Point multiply(double x, double y) const {
      return Point( x * a + y * c + e,
		    x * b + y * d + f
		    );    
    }
    
    Point multiply(const Point & p) const {
      return multiply(p.x, p.y);
    }
    
  private:
    static Matrix multiply(const Matrix & A, const Matrix & B) {
      return Matrix( A.a * B.a + A.c * B.b,
		     A.b * B.a + A.d * B.b,
		     A.a * B.c + A.c * B.d,
		     A.b * B.c + A.d * B.d,
		     A.a * B.e + A.c * B.f + A.e,
		     A.b * B.e + A.d * B.f + A.f
		     );
    }
    
    double a, b, c, d, e, f;
  };
};

#endif

{'fraction_non_alphanumeric': 0.17448487505480054, 'fraction_numerical': 0.01052170100832968, 'mean_word_length': 1.7593712212817412, 'pattern_counts': {'":': 0, '<': 5, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6091880', 'n_tokens_mistral': 1008, 'n_tokens_neox': 960, 'n_words': 254}