<commit_before>#ifndef POINT2D_H
#define POINT2D_H

#include <boost/numeric/bindings/traits/ublas_vector.hpp>

namespace shapelens {

/// Templated 2D Point class.
/// publicly inherited from uBLAS vectors

template <class T>
class Point2D : public boost::numeric::ublas::vector<T, boost::numeric::ublas::bounded_array<T,2> >
{
  typedef boost::numeric::ublas::vector<T, boost::numeric::ublas::bounded_array<T,2> > Base_vector;
 public:
  Point2D () : Base_vector(2) {}
  template <class R> Point2D (R x0, R x1) : Base_vector(2) {
    Base_vector::operator()(0) = x0;
    Base_vector::operator()(1) = x1;
  }
  template <class R> Point2D (boost::numeric::ublas::vector_expression<R>& r) : Base_vector(r) { }
  template <class R> void operator=(boost::numeric::ublas::vector_expression<R>& r) {
    Base_vector::operator=(r);
  }
  template <class R> void operator=( Base_vector& r) {
    Base_vector::operator=(r);
  }
  // comparison operator for sorted containers of the STL
  // 2nd dimension first ensures efficient lookup for images
  template <class R>
    bool operator<(const Point2D<R>& b) const {
    if (Base_vector::operator()(1) < b(1) || (Base_vector::operator()(1) == b(1) && Base_vector::operator()(0) < b(0)))
      return true;
    else
      return false;
  }<commit_msg>added Point2D::c_array()<commit_after>#ifndef POINT2D_H
#define POINT2D_H

#include <boost/numeric/bindings/traits/ublas_vector.hpp>

namespace shapelens {

/// Templated 2D Point class.
/// publicly inherited from uBLAS vectors

template <class T>
class Point2D : public boost::numeric::ublas::vector<T, boost::numeric::ublas::bounded_array<T,2> >
{
  typedef boost::numeric::ublas::vector<T, boost::numeric::ublas::bounded_array<T,2> > Base_vector;
 public:
  Point2D () : Base_vector(2) {}
  template <class R> Point2D (R x0, R x1) : Base_vector(2) {
    Base_vector::operator()(0) = x0;
    Base_vector::operator()(1) = x1;
  }
  template <class R> Point2D (boost::numeric::ublas::vector_expression<R>& r) : Base_vector(r) { }
  template <class R> void operator=(boost::numeric::ublas::vector_expression<R>& r) {
    Base_vector::operator=(r);
  }
  template <class R> void operator=( Base_vector& r) {
    Base_vector::operator=(r);
  }
  // comparison operator for sorted containers of the STL
  // 2nd dimension first ensures efficient lookup for images
  template <class R>
    bool operator<(const Point2D<R>& b) const {
    if (Base_vector::operator()(1) < b(1) || (Base_vector::operator()(1) == b(1) && Base_vector::operator()(0) < b(0)))
      return true;
    else
      return false;
  }
  T* c_array() {
    return boost::numeric::bindings::traits::vector_storage(*this);
  }
  const T* c_array() const {
    return boost::numeric::bindings::traits::vector_storage(*this);
  }
{'fraction_non_alphanumeric': 0.15893563466379002, 'fraction_numerical': 0.018338727076591153, 'mean_word_length': 4.8940677966101696, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 31, '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': '625708', 'n_tokens_mistral': 973, 'n_tokens_neox': 959, 'n_words': 217}