<commit_before>#include "inmost.h"
#include <stdio.h>


using namespace INMOST;
typedef Storage::real real;
typedef Storage::real_array real_array;

int main(int argc, char ** argv)
{
	if( argc < 3 )
	{
		printf("Usage: %s input_mesh edge_number [output_mesh]\n",argv[0]);
		return -1;
	}
	
	Mesh A("");
	A.Load(argv[1]);
	
	Mesh::GeomParam table;
	table[ORIENTATION] = FACE;
	table[BARYCENTER] = FACE | CELL | EDGE;
	A.PrepareGeometricData(table);
	
	int edge_num = atoi(argv[2]);
	
	if( edge_num >= A.EdgeMaxLocalID(); )
	{
		std::cout << "input edge is " << edge_num << " but only ";
		std::cout << A.EdgeMaxLocalID() << " edges in the mesh" << std::endl;;
		return -1;
	}

	Edge::CollapseEdge(Edge(&A,ComposeHandle(EDGE,edge_num)),0);
	
	if( A.HaveTag("GRIDNAME") )
	{
		Storage::bulk_array nameA = A.self().BulkArray(A.GetTag("GRIDNAME"));
		std::string ins = "_collapse_degenerate";
		nameA.insert(nameA.end(),ins.c_str(),ins.c_str()+ins.size());
	}
	
	if( argc > 3 )
	{<commit_msg>bugfix<commit_after>#include "inmost.h"
#include <stdio.h>


using namespace INMOST;
typedef Storage::real real;
typedef Storage::real_array real_array;

int main(int argc, char ** argv)
{
	if( argc < 3 )
	{
		printf("Usage: %s input_mesh edge_number [output_mesh]\n",argv[0]);
		return -1;
	}
	
	Mesh A("");
	A.Load(argv[1]);
	
	Mesh::GeomParam table;
	table[ORIENTATION] = FACE;
	table[BARYCENTER] = FACE | CELL | EDGE;
	A.PrepareGeometricData(table);
	
	int edge_num = atoi(argv[2]);
	
	if( edge_num >= A.EdgeLastLocalID() )
	{
		std::cout << "input edge is " << edge_num << " but only ";
		std::cout << A.EdgeLastLocalID() << " edges in the mesh" << std::endl;;
		return -1;
	}

	Edge::CollapseEdge(Edge(&A,ComposeHandle(EDGE,edge_num)),0);
	
	if( A.HaveTag("GRIDNAME") )
	{
		Storage::bulk_array nameA = A.self().BulkArray(A.GetTag("GRIDNAME"));
		std::string ins = "_collapse_degenerate";
		nameA.insert(nameA.end(),ins.c_str(),ins.c_str()+ins.size());
	}
	
	if( argc > 3 )
	{
{'fraction_non_alphanumeric': 0.1883248730964467, 'fraction_numerical': 0.008121827411167513, 'mean_word_length': 4.5835694050991505, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 9, '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': '4135808', 'n_tokens_mistral': 838, 'n_tokens_neox': 779, 'n_words': 150}