Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346/****************************************************************************1**2*A convert.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"1112/* convert exponent vector with base address13cp to string whose base address is str */1415void vector_to_string(int cp, int str, struct pcp_vars *pcp)16{17register int *y = y_address;1819register int i;20register int length = 0;21register int lastg = pcp->lastg;2223#include "access.h"2425for (i = 1; i <= lastg; ++i) {26if (y[cp + i] != 0) {27++length;28y[str + 1 + length] = PACK2(y[cp + i], i);29}30}3132y[str + 1] = length;33}3435/* convert exponent-vector with base address cp36to word with base address ptr */3738int vector_to_word(int cp, int ptr, struct pcp_vars *pcp)39{40register int *y = y_address;4142int i, j;43register int length = 1;44register int lastg = pcp->lastg;4546y[ptr + 1] = 1;47for (i = 1; i <= lastg; ++i) {48for (j = 1; j <= y[cp + i]; ++j) {49++length;50y[ptr + length] = i;51}52}5354y[ptr] = length;55return length;56}5758/* convert normal word with base address ptr and exponent 159to string with base address str */60void word_to_string(int ptr, int str, struct pcp_vars *pcp)61{62register int *y = y_address;6364register int i;65register int length = y[ptr];66/* register int exp = y[ptr + 1]; */67#include "access.h"6869for (i = 1; i <= length; ++i)70y[str + 1 + i] = PACK2(1, y[ptr + 1 + i]);7172y[str + 1] = length;73}7475/* convert string with base address str to76exponent vector whose base address is cp */7778void string_to_vector(int str, int cp, struct pcp_vars *pcp)79{80register int *y = y_address;8182register int i;83register int length = y[str + 1];8485#include "access.h"8687for (i = 1; i <= pcp->lastg; ++i)88y[cp + i] = 0;8990for (i = 1; i <= length; ++i)91y[cp + FIELD2(y[str + 1 + i])] = FIELD1(y[str + 1 + i]);92}939495