<commit_before>use super::number::NumberOps;
use super::ring::Ring;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct InclinedEdge {
   pub x1: i64,
   pub y1: i64,
   pub x2: i64,
   pub y2: i64,
   pub ox1: i64,
   pub oy1: i64,
   pub ox2: i64,
   pub oy2: i64,
   pub dx: i64,
   pub dy: i64,
}

impl InclinedEdge {
   #[inline]
   pub fn new(x1: i64, y1: i64, x2: i64, y2: i64) -> Self {
      InclinedEdge {
         x1: x1,
         y1: y1,
         x2: x2,
         y2: y2,
         ox1: x1,
         oy1: y1,
         ox2: x2,
         oy2: y2,
         dx: x2 - x1,
         dy: y2 - y1,
      }
   }

   #[inline]
   fn h_intersect(&self, y: i64) -> i64 {
      self.ox1 + (self.dx * (y - self.oy1)).rounding_div(self.dy)
   }

   #[allow(dead_code)]
   #[inline]
   fn v_intersect(&self, x: i64) -> i64 {
      self.oy1 + (self.dy * (x - self.ox1)).rounding_div(self.dx)
   }

   #[inline]
   fn segment(&self, x1: i64, y1: i64, x2: i64, y2: i64) -> Self {
      InclinedEdge {
         x1: x1,
         y1: y1,
         x2: x2,
         y2: y2,
         ox1: self.ox1,
         oy1: self.oy1,
         ox2: self.ox2,
         oy2: self.oy2,
         dx: self.dx,
         dy: self.dy,
      }
   }
}

impl Default for InclinedEdge {
   fn default() -> InclinedEdge {
      InclinedEdge::new(0, 0, 0, 0)
   }
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct HorizontalEdge {
   pub x1: i64,
   pub x2: i64,
   pub y: i64,
}<commit_msg>Removing the dx/dy members from the InclinedEdge struct<commit_after>use super::number::NumberOps;
use super::ring::Ring;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct InclinedEdge {
   pub x1: i64,
   pub y1: i64,
   pub x2: i64,
   pub y2: i64,
   pub ox1: i64,
   pub oy1: i64,
   pub ox2: i64,
   pub oy2: i64,
}

impl InclinedEdge {
   #[inline]
   pub fn new(x1: i64, y1: i64, x2: i64, y2: i64) -> Self {
      InclinedEdge {
         x1: x1,
         y1: y1,
         x2: x2,
         y2: y2,
         ox1: x1,
         oy1: y1,
         ox2: x2,
         oy2: y2,
      }
   }

   #[inline]
   fn h_intersect(&self, y: i64) -> i64 {
      self.ox1 + ((self.ox2 - self.ox1) * (y - self.oy1)).rounding_div(self.oy2 - self.oy1)
   }

   #[inline]
   fn v_intersect(&self, x: i64) -> i64 {
      self.oy1 + ((self.oy2 - self.oy1) * (x - self.ox1)).rounding_div(self.ox2 - self.ox1)
   }

   #[inline]
   fn segment(&self, x1: i64, y1: i64, x2: i64, y2: i64) -> Self {
      InclinedEdge {
         x1: x1,
         y1: y1,
         x2: x2,
         y2: y2,
         ox1: self.ox1,
         oy1: self.oy1,
         ox2: self.ox2,
         oy2: self.oy2,
      }
   }
}

impl Default for InclinedEdge {
   fn default() -> InclinedEdge {
      InclinedEdge::new(0, 0, 0, 0)
   }
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct HorizontalEdge {
   pub x1: i64,
   pub x2: i64,
   pub y: i64,
}
{'fraction_non_alphanumeric': 0.1507467870788468, 'fraction_numerical': 0.07780479333101771, 'mean_word_length': 1.81524926686217, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5129054', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1276, 'n_words': 316}