<commit_before>/**
* @author <NAME>
* Copyright (c) Aldebaran Robotics 2009 All Rights Reserved
*/

#include <almath/types/alposition2d.h>
#include "math.h"
#include <stdexcept>

namespace AL {
  namespace Math {

    Position2D Position2D::operator+ (const Position2D& pPos2) const
    {
      Position2D res;
      res.x = x + pPos2.x;
      res.y = y + pPos2.y;
      return res;
    }

    Position2D Position2D::operator- (const Position2D& pPos2) const
    {
      Position2D res;
      res.x = x - pPos2.x;
      res.y = y - pPos2.y;
      return res;
    }

    Position2D Position2D::operator+ () const
    {
      Position2D res;
      res.x = x;
      res.y = y;
      return res;
    }

    Position2D Position2D::operator- () const
    {
      Position2D res;
      res.x = -x;
      res.y = -y;
      return res;
    }

    Position2D& Position2D::operator+= (const Position2D& pPos2)
    {
      x += pPos2.x;
      y += pPos2.y;
      return *this;
    }

    Position2D& Position2D::operator-= (const Position2D& pPos2)
    {
      x -= pPos2.x;
      y -= pPos2.y;
      return *this;
    }


    bool Position2D::operator!=(const Position2D& pPos2) const
    {
      return !(*this==pPos2);
    }


    bool Position2D::isNear(
      const Position2D& pPos,
      const float&      pEpsilon) const
    {
      if (
        (fabsf(x - pPos.x) > pEpsilon) ||
        (fabsf(y - pPos.y) > pEpsilon))
      {
        return false;
      }
      else
      {
        return true;
      }
    }


    Position2D Position2D::operator* (float pM) const
    {
      Position2D res;
      res.x = x * pM;
      res.y = y * pM;
      return res;
    }

    Position2D operator* (
      const float       pM,
      const Position2D& pPos1)
    {
      return pPos1*pM;<commit_msg>ALMATH: position2D simplify if statement<commit_after>/**
* @author <NAME>
* Copyright (c) Aldebaran Robotics 2009 All Rights Reserved
*/

#include <almath/types/alposition2d.h>
#include "math.h"
#include <stdexcept>

namespace AL {
  namespace Math {

    Position2D Position2D::operator+ (const Position2D& pPos2) const
    {
      Position2D res;
      res.x = x + pPos2.x;
      res.y = y + pPos2.y;
      return res;
    }

    Position2D Position2D::operator- (const Position2D& pPos2) const
    {
      Position2D res;
      res.x = x - pPos2.x;
      res.y = y - pPos2.y;
      return res;
    }

    Position2D Position2D::operator+ () const
    {
      Position2D res;
      res.x = x;
      res.y = y;
      return res;
    }

    Position2D Position2D::operator- () const
    {
      Position2D res;
      res.x = -x;
      res.y = -y;
      return res;
    }

    Position2D& Position2D::operator+= (const Position2D& pPos2)
    {
      x += pPos2.x;
      y += pPos2.y;
      return *this;
    }

    Position2D& Position2D::operator-= (const Position2D& pPos2)
    {
      x -= pPos2.x;
      y -= pPos2.y;
      return *this;
    }


    bool Position2D::operator!=(const Position2D& pPos2) const
    {
      return !(*this==pPos2);
    }


    bool Position2D::isNear(
      const Position2D& pPos,
      const float&      pEpsilon) const
    {
      if (
        (fabsf(x - pPos.x) > pEpsilon) ||
        (fabsf(y - pPos.y) > pEpsilon))
      {
        return false;
      }
      return true;
    }


    Position2D Position2D::operator* (float pM) const
    {
      Position2D res;
      res.x = x * pM;
      res.y = y * pM;
      return res;
    }

    Position2D operator* (
      const float       pM,
      const Position2D& pPos1)
    {
      return pPos1*pM;
{'fraction_non_alphanumeric': 0.12066069428891378, 'fraction_numerical': 0.028275475923852184, 'mean_word_length': 1.8001567398119123, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '5186840', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1313, 'n_words': 302}