GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/****************************************************************************1**2*A calculate_jacobi.c ANUPQ source Eamonn O'Brien3**4*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany5*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia6**7*/89#include "pq_defs.h"10#include "pcp_vars.h"11#include "constants.h"1213/* calculate an individual jacobi */1415void calculate_jacobi(struct pcp_vars *pcp)16{17register int *y = y_address;1819Logical invalid = FALSE;20int bound = pcp->ccbeg;21int output;22int a, b, c;2324#include "access.h"2526printf("Input the three components for the consistency calculation: ");27read_value(FALSE, "", &c, 1);28read_value(FALSE, "", &b, 1);29read_value(TRUE, "", &a, 1);3031/* check the validity of the components */32invalid =33outside(a, bound) || outside(b, bound) || outside(c, bound) ||34pcp->cc <= 2 || c < b || b < a ||35(a != b && b != c &&36WT(y[pcp->structure + c]) + WT(y[pcp->structure + b]) +37WT(y[pcp->structure + a]) >38pcp->cc) ||39((a == b || b == c) &&40WT(y[pcp->structure + a]) + WT(y[pcp->structure + c]) + 1 > pcp->cc);4142/* if valid, calculate the jacobi */43if (!invalid) {44output = pcp->fullop;45pcp->fullop = TRUE;46jacobi(c, b, a, 0, pcp);47pcp->fullop = output;48} else {49PRINT("Incorrect values %d, %d, %d for Jacobi calculation\n", c, b, a);50pcp->redgen = 0;51}52}5354/* check if x lies outside permitted range from 1 to y */55int outside(int x, int y)56{57return (x <= 0) || (x > y);58}596061