<commit_before>#include <isl_map_private.h>
#include <isl_point_private.h>
#include <isl/set.h>
#include <isl/union_set.h>
#include <isl_sample.h>
#include <isl_scan.h>
#include <isl_seq.h>
#include <isl_space_private.h>
#include <isl_local_private.h>
#include <isl_val_private.h>
#include <isl_vec_private.h>
#include <isl_output_private.h>

#include <set_to_map.c>

isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt)
{
	return pnt ? isl_space_get_ctx(pnt->dim) : NULL;
}

/* Return the space of "pnt".
 */
__isl_keep isl_space *isl_point_peek_space(__isl_keep isl_point *pnt)
{
	return pnt ? pnt->dim : NULL;
}

__isl_give isl_space *isl_point_get_space(__isl_keep isl_point *pnt)
{
	return isl_space_copy(isl_point_peek_space(pnt));
}

__isl_give isl_point *isl_point_alloc(__isl_take isl_space *space,
	__isl_take isl_vec *vec)
{
	struct isl_point *pnt;
	isl_size dim;

	dim = isl_space_dim(space, isl_dim_all);
	if (dim < 0 || !vec)
		goto error;

	if (vec->size > 1 + dim) {
		vec = isl_vec_cow(vec);
		if (!vec)
			goto error;
		vec->size = 1 + dim;
	}

	pnt = isl_alloc_type(space->ctx, struct isl_point);
	if (!pnt)
		goto error;

	pnt->ref = 1;
	pnt->dim = space;
	pnt->vec = vec;

	return pnt;
error:
	isl_space_free(space);
	isl_vec_free(vec);
	return NULL;
}

__isl_give isl_point *isl_point_zero(__isl_take isl_space *space)
{
	isl_vec *vec;
	isl_size dim;

	dim = isl_space_dim(space, isl_dim_all);
	if (dim < 0)
		goto error;
	vec = isl_vec_alloc(space->ctx, 1 + dim);
	if (!vec)
		goto error;
	isl_int_set_si(vec->el[0], 1);
	isl_seq_clr(vec->el + 1, vec->size - 1);
	return isl_point_alloc(space, vec);
error:
	isl_space_free(space);
	return NULL;
}

__isl_give isl_point *isl_point_dup(__isl_keep isl_point *pnt)
{
	struct isl_point *pnt2;

	if (!pnt)
		return NULL;
	pnt2 = isl_point_alloc(isl_space_copy(pnt->dim), isl_vec_copy(pnt->vec));
	return pnt2;
}

__isl_give isl_point *isl_point_cow(__isl_take isl_point *pnt)
{
	struct isl_point *pnt2;
	if (!pnt)
		return NULL;

	if (pnt->ref == 1)
		return pnt;

	pnt2 = isl_point_dup(pnt);
	isl_point_free(pnt);
	return pnt2;
}

__isl_give isl_point *isl_point_copy(__isl_keep isl_point *pnt)
{
	if (!pnt)
		return NULL;

	pnt->ref++;
	return pnt;
}

__isl_null isl_point *isl_point_free(__isl_take isl_point *pnt)
{
	if (!pnt)
		return NULL;

	if (--pnt->ref > 0)
		return NULL;

	isl_space_free(pnt->dim);
	isl_vec_free(pnt->vec);
	free(pnt);
	return NULL;
}

__isl_give isl_point *isl_point_void(__isl_take isl_space *space)
{
	if (!space)
		return NULL;

	return isl_point_alloc(space, isl_vec_alloc(space->ctx, 0));
}

isl_bool isl_point_is_void(__isl_keep isl_point *pnt)
{
	if (!pnt)
		return isl_bool_error;

	return pnt->vec->size == 0;
}

/* Return the space of "pnt".<commit_msg>isl_point_is_void: use isl_bool_ok<commit_after>#include <isl_map_private.h>
#include <isl_point_private.h>
#include <isl/set.h>
#include <isl/union_set.h>
#include <isl_sample.h>
#include <isl_scan.h>
#include <isl_seq.h>
#include <isl_space_private.h>
#include <isl_local_private.h>
#include <isl_val_private.h>
#include <isl_vec_private.h>
#include <isl_output_private.h>

#include <set_to_map.c>

isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt)
{
	return pnt ? isl_space_get_ctx(pnt->dim) : NULL;
}

/* Return the space of "pnt".
 */
__isl_keep isl_space *isl_point_peek_space(__isl_keep isl_point *pnt)
{
	return pnt ? pnt->dim : NULL;
}

__isl_give isl_space *isl_point_get_space(__isl_keep isl_point *pnt)
{
	return isl_space_copy(isl_point_peek_space(pnt));
}

__isl_give isl_point *isl_point_alloc(__isl_take isl_space *space,
	__isl_take isl_vec *vec)
{
	struct isl_point *pnt;
	isl_size dim;

	dim = isl_space_dim(space, isl_dim_all);
	if (dim < 0 || !vec)
		goto error;

	if (vec->size > 1 + dim) {
		vec = isl_vec_cow(vec);
		if (!vec)
			goto error;
		vec->size = 1 + dim;
	}

	pnt = isl_alloc_type(space->ctx, struct isl_point);
	if (!pnt)
		goto error;

	pnt->ref = 1;
	pnt->dim = space;
	pnt->vec = vec;

	return pnt;
error:
	isl_space_free(space);
	isl_vec_free(vec);
	return NULL;
}

__isl_give isl_point *isl_point_zero(__isl_take isl_space *space)
{
	isl_vec *vec;
	isl_size dim;

	dim = isl_space_dim(space, isl_dim_all);
	if (dim < 0)
		goto error;
	vec = isl_vec_alloc(space->ctx, 1 + dim);
	if (!vec)
		goto error;
	isl_int_set_si(vec->el[0], 1);
	isl_seq_clr(vec->el + 1, vec->size - 1);
	return isl_point_alloc(space, vec);
error:
	isl_space_free(space);
	return NULL;
}

__isl_give isl_point *isl_point_dup(__isl_keep isl_point *pnt)
{
	struct isl_point *pnt2;

	if (!pnt)
		return NULL;
	pnt2 = isl_point_alloc(isl_space_copy(pnt->dim), isl_vec_copy(pnt->vec));
	return pnt2;
}

__isl_give isl_point *isl_point_cow(__isl_take isl_point *pnt)
{
	struct isl_point *pnt2;
	if (!pnt)
		return NULL;

	if (pnt->ref == 1)
		return pnt;

	pnt2 = isl_point_dup(pnt);
	isl_point_free(pnt);
	return pnt2;
}

__isl_give isl_point *isl_point_copy(__isl_keep isl_point *pnt)
{
	if (!pnt)
		return NULL;

	pnt->ref++;
	return pnt;
}

__isl_null isl_point *isl_point_free(__isl_take isl_point *pnt)
{
	if (!pnt)
		return NULL;

	if (--pnt->ref > 0)
		return NULL;

	isl_space_free(pnt->dim);
	isl_vec_free(pnt->vec);
	free(pnt);
	return NULL;
}

__isl_give isl_point *isl_point_void(__isl_take isl_space *space)
{
	if (!space)
		return NULL;

	return isl_point_alloc(space, isl_vec_alloc(space->ctx, 0));
}

isl_bool isl_point_is_void(__isl_keep isl_point *pnt)
{
	if (!pnt)
		return isl_bool_error;

	return isl_bool_ok(pnt->vec->size == 0);
}

/* Return the space of "pnt".
{'fraction_non_alphanumeric': 0.13480921526277898, 'fraction_numerical': 0.007199424046076314, 'mean_word_length': 5.020585048754063, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 77, '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': '593052', 'n_tokens_mistral': 2614, 'n_tokens_neox': 2440, 'n_words': 497}