5#define TRANSEXT_PRIVATES 1
98 lintree.mark_error(
"trying to share unsupported data type");
121 result->data = (
char *)data;
128 result->data = (
char *)data;
167 long data =
lintree.get<
long>();
178 char *
p = (
char *)val->
Data();
185 size_t len =
lintree.get<
size_t>();
186 const char *
p =
lintree.get_bytes(len);
194 size_t len =
lintree.get<
size_t>();
201 char *
p = (
char *)val->
Name();
208 size_t len =
lintree.get<
size_t>();
209 const char *
p =
lintree.get_bytes(len);
217 lintree.mark_error(
"error in name lookup");
223 size_t len =
lintree.get<
size_t>();
287 lintree.mark_error(
"coefficient type not supported");
310 lintree.mark_error(
"coefficient type not supported");
369 int len = rows * cols;
371 for (
int i = 0;
i < len;
i++) {
379 int rows =
v->rows();
380 int cols =
v->cols();
381 int len =
v->length();
384 for (
int i = 0;
i < len;
i++) {
392 int len = rows * cols;
393 for (
int i = 0;
i < len;
i++) {
405 for (
int j=1;
j<=
rVar(r);
j++) {
425 for (
int l = 0;
l < len;
l++) {
453 for (
int l = 0;
l <len;
l++) {
487 for (
int i=0;
i<
mn;
i++)
497 int typ = val->
Typ();
498 void *data = val->
Data();
520 for (
int i=0;
i<n;
i++)
532 if (r ==
lintree.get_last_ring()) {
550 for (
int i=0;
i<r->N;
i++) {
554 if (r->order)
while (r->order[
i] != 0)
i++;
557 if (r->order)
while (r->order[
i] != 0) {
561 switch (r->order[
i]) {
568 for (
int j = r->block0[
i];
j <= r->block1[
i];
j++)
575 lintree.mark_error(
"ring order not implemented");
610 lintree.mark_error(
"cannot find coeffient name");
623 names = (
char **)
omAlloc(
N*
sizeof(
char *));
624 for (
int i=0;
i<
N;
i++)
646 wvhdl[
i] = (
int *)
omAlloc((block1[
i]-block0[
i]+1)*
sizeof(
int));
647 for (
int j=block0[
i];
j<=block1[
i];
j++)
654 lintree.mark_error(
"ring oder not implemented for lintrees");
676 }
else if (ch == -2) {
682 }
else if (ch == -3) {
707 for (
int i=0;
i<
N;
i++)
710 for (
int i=0;
i<
N;
i++) {
712 int block0 =
lintree.get_int();
713 int block1 =
lintree.get_int();
721 for (
int j=block0;
j<=block1;
j++)
727 if (ch == -1 || ch == -2) {
739 for (
int i=0;
i<=n;
i++) {
748 for (
int i=0;
i<=n;
i++) {
750 memcpy(&
l->m[
i], val,
sizeof(*val));
758 for (
int i = 0;
i < n;
i++) {
787 memcpy(&cmd->arg1, val,
sizeof(*val));
793 memcpy(&cmd->arg2, val,
sizeof(*val));
798 memcpy(&cmd->arg3, val,
sizeof(*val));
805 lintree.mark_error(
"error in eval");
822 printf(
"%d: ", (
int)str.size());
823 for (
int i=0;
i<str.size();
i++) {
825 if (ch <
' ' || ch >= 0x7f)
826 printf(
"#%02x", (
int) ch & 0xff);
835 Werror(
"libthread encoding error: %s",
s);
839 Werror(
"libthread decoding error: %s",
s);
889 cursor =
other.cursor;
const CanonicalForm CFMap CFMap & N
LinTree & operator=(const LinTree &other)
void set_last_ring(void *r)
Class used for (list of) interpreter objects.
@ n_Q
rational (GMP) numbers
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static FORCE_INLINE char * nCoeffName(const coeffs cf)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
char name(const Variable &v)
EXTERN_VAR omBin sleftv_bin
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
void set_needs_ring(int typ)
ring decode_ring_raw(LinTree &lintree)
void ref_poly(LinTree &lintree, int by)
void encode_intmat(LinTree &lintree, leftv val)
poly decode_poly(LinTree &lintree, const ring r)
leftv decode_bigint(LinTree &lintree)
void ref_number(LinTree &lintree, int by)
void ref_def(LinTree &lintree, int by)
leftv decode_none(LinTree &lintree)
void encode(LinTree &lintree, leftv val)
void encode_bigint(LinTree &lintree, leftv val)
void ref_none(LinTree &lintree, int by)
void encode_mpz(LinTree &lintree, const mpz_t num)
void updateref(LinTree &lintree, int by)
void ref_number_cf(LinTree &lintree, coeffs cf, int by)
number decode_longrat_cf(LinTree &lintree)
void encode_string(LinTree &lintree, leftv val)
void ref_bigint(LinTree &lintree, int by)
void ref_int(LinTree &lintree, int by)
void encode_none(LinTree &lintree, leftv val)
vector< char > needs_ring
void encode_list(LinTree &lintree, leftv val)
void encode_ring(LinTree &lintree, const ring r)
void decoding_error(const char *s)
vector< LinTreeDecodeFunc > decoders
void(* LinTreeRefFunc)(LinTree &lintree, int by)
void dump_string(string str)
std::string to_string(leftv val)
leftv(* LinTreeDecodeFunc)(LinTree &lintree)
leftv new_leftv(int code, void *data)
leftv decode_command(LinTree &lintree)
void ref_ring(LinTree &lintree, int by)
void encode_command(LinTree &lintree, leftv val)
void ref_ideal(LinTree &lintree, int by)
leftv decode_def(LinTree &lintree)
vector< LinTreeRefFunc > refupdaters
leftv decode_string(LinTree &lintree)
leftv decode_int(LinTree &lintree)
number decode_number_cf(LinTree &lintree, const coeffs cf)
void encode_ideal(LinTree &lintree, int typ, const ideal I, const ring R)
void encoding_error(const char *s)
void encode_int(LinTree &lintree, leftv val)
ideal decode_ideal(LinTree &lintree, int typ, const ring r)
void ref_string(LinTree &lintree, int by)
leftv decode_number(LinTree &lintree)
void encode_def(LinTree &lintree, leftv val)
void decode_mpz(LinTree &lintree, mpz_t &num)
void ref_list(LinTree &lintree, int by)
leftv decode_intmat(LinTree &lintree)
leftv decode_list(LinTree &lintree)
void encode_longrat_cf(LinTree &lintree, const number n)
vector< LinTreeEncodeFunc > encoders
void install(int typ, LinTreeEncodeFunc enc, LinTreeDecodeFunc dec, LinTreeRefFunc ref)
void ref_intmat(LinTree &lintree, int by)
leftv from_string(std::string &str)
void encode_poly(LinTree &lintree, int typ, poly p, const ring r)
void encode_number(LinTree &lintree, leftv val)
leftv decode(LinTree &lintree)
void ref_command(LinTree &lintree, int by)
void(* LinTreeEncodeFunc)(LinTree &lintree, leftv val)
leftv decode_ring(LinTree &lintree)
void encode_number_cf(LinTree &lintree, const number n, const coeffs cf)
The main handler for Singular numbers which are suitable for Singular polynomials.
coeffs nFindCoeffByName(char *cf_name)
find an existing coeff by its "CoeffName"
#define omFreeBin(addr, bin)
static int pLength(poly a)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
static void p_Setm(poly p, const ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static poly p_Init(const ring r, omBin bin)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void Werror(const char *fmt,...)
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
static BOOLEAN rField_is_Zp(const ring r)
static n_coeffType rFieldType(const ring r)
the type of the coefficient filed of r (n_Zp, n_Q, etc)
static ring rIncRefCnt(ring r)
@ ringorder_a64
for int64 weights
@ ringorder_aa
for idElimination, like a, except pFDeg, pWeigths ignore it
@ ringorder_IS
Induced (Schreyer) ordering.
static BOOLEAN rField_is_Q(const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
ideal idInit(int idsize, int rank)
initialise an ideal / module
struct for passing initialization parameters to naInitChar