<commit_before>
//c++ includes
#include <assert.h>
#include <math.h>
#include <iostream> 
#include <string>

//SIGMA includes
#include "moab/CartVect.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"

// std includes
#include <vector>

//GLOBAL Defines
#define CCW 1
#define CW -1

#define MATCH_TOL 1e-7
#define FILENAME_TAG_NAME "FILENAME"

inline void ERR_CHECK(moab::ErrorCode rval) {
  if (rval) {
    assert(false);
    std::cout << "ERROR" << std::endl; 
    exit(1);
  }
}

#ifndef SLICER_H
#define SLICER_H

moab::Interface* mbi();

#endif
  
//special containers for our intersection data
struct Line {
  Line() : started(false), full(false) {}
  moab::CartVect begin;
  moab::CartVect end;
  bool started;
  bool full;
  void add_pnt(moab::CartVect a) {
    
    if (full) {
      std::cout << "Line is full. Point not added." << std::endl;
    }
    
    if(!started) {
      begin = a;
      started = true; 
    }
    else {
	end = a;
	full = true;
    }
  }
};

struct xypnt {
  double x; 
  double y; 
};

struct Loop {
  Loop() : num_pnts(0), closed(false) { }
  ~Loop() { }
  std::vector<moab::CartVect> points;
  std::vector<xypnt> xypnts;
  int num_pnts;
  bool closed;

  void gen_xys(int axis) {
    
    xypnts.clear(); //clear out vector as precaution
    int x = 0 , y = 0;
    
    //set indices for x an y based on slice plane (provided externally)
    switch(axis) {
      case 0:
	x = 1; y = 2; break;
      case 1:
	x = 0; y = 2; break;
      case 2:
	x = 0; y = 1; break;
      }

    //this shouldn't happen
    if ( x == 0 && y == 0 ) {
      ERR_CHECK(moab::MB_FAILURE);
    }
    
    xypnts.resize(points.size());
    for (unsigned int i = 0; i < points.size(); i++) {
      xypnts[i].x = points[i][x];<commit_msg>Removing ERR_CHECK macro. Adding condition for failure in Loop class.<commit_after>
//c++ includes
#include <assert.h>
#include <math.h>
#include <iostream> 
#include <string>

//SIGMA includes
#include "moab/CartVect.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"

// std includes
#include <vector>

//GLOBAL Defines
#define CCW 1
#define CW -1

#define MATCH_TOL 1e-7
#define FILENAME_TAG_NAME "FILENAME"

#ifndef SLICER_H
#define SLICER_H

moab::Interface* mbi();

#endif
  
//special containers for our intersection data
struct Line {
  Line() : started(false), full(false) {}
  moab::CartVect begin;
  moab::CartVect end;
  bool started;
  bool full;
  void add_pnt(moab::CartVect a) {
    
    if (full) {
      std::cout << "Line is full. Point not added." << std::endl;
    }
    
    if(!started) {
      begin = a;
      started = true; 
    }
    else {
	end = a;
	full = true;
    }
  }
};

struct xypnt {
  double x; 
  double y; 
};

struct Loop {
  Loop() : num_pnts(0), closed(false) { }
  ~Loop() { }
  std::vector<moab::CartVect> points;
  std::vector<xypnt> xypnts;
  int num_pnts;
  bool closed;

  void gen_xys(int axis) {
    
    xypnts.clear(); //clear out vector as precaution
    int x = 0 , y = 0;
    
    //set indices for x an y based on slice plane (provided externally)
    switch(axis) {
      case 0:
	x = 1; y = 2; break;
      case 1:
	x = 0; y = 2; break;
      case 2:
	x = 0; y = 1; break;
      }

    //this shouldn't happen
    if ( x == 0 && y == 0 || x == y) {
      MB_CHK_SET_ERR_CONT(moab::MB_FAILURE, "x and y index values cannot be the same");
    }
    
    xypnts.resize(points.size());
    for (unsigned int i = 0; i < points.size(); i++) {
      xypnts[i].x = points[i][x];
{'fraction_non_alphanumeric': 0.1484441906936911, 'fraction_numerical': 0.011133314302026834, 'mean_word_length': 2.6614420062695925, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 17, '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': '1494073', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1343, 'n_words': 379}