source: git/Singular/p_Procs.h @ 55b8ae

fieker-DuValspielwiese
Last change on this file since 55b8ae was 55b8ae, checked in by Olaf Bachmann <obachman@…>, 24 years ago
* p_Procs update git-svn-id: file:///usr/local/Singular/svn/trunk@4562 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.0 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4
5/***************************************************************
6 *  File:    pProcs.h
7 *  Purpose: declaration of primitive procs for polys
8 *  Author:  obachman (Olaf Bachmann)
9 *  Created: 8/00
10 *  Version: $Id: p_Procs.h,v 1.2 2000-08-29 14:10:28 obachman Exp $
11 *******************************************************************/
12#ifndef P_PROCS_H
13#define P_PROCS_H
14#include "structs.h"
15
16// define/undef P_INLINE to inline some procedures
17#undef NO_P_INLINE
18#if defined(NDEBUG) && !defined(NO_INLINE)
19#define P_INLINE inline
20#else
21#define NO_P_INLINE 1
22#define P_INLINE
23#endif
24
25
26// NOTE: the actual procedures below are not inlined,
27// only the dispatching function call
28
29/*------------- Allocation/Deletion ----------------------*/
30// returns a copy of p
31P_INLINE poly p_Copy(poly p, const ring r = currRing);
32// deletes *p, and sets *p to NULL
33P_INLINE void p_Delete(poly *p, const ring r = currRing);
34
35/*------------- comparisons ----------------------*/
36// returns 1 if Lm(p) > Lm(q)
37//         0 if Lm(p) = Lm(q)
38//        -1 if Lm(p) < Lm(q)
39// assumes p != NULL && q != NULL
40P_INLINE int p_LmCmp(const poly p, const poly q, const ring r = currRing);
41
42/*------------- Arithmetic operations ----------------------*/
43/* NOTE as a general rule that
44   pp means input is constant; p means input is destroyed */
45// returns -p
46P_INLINE poly p_Neg(poly p, const ring r = currRing);
47// returns p*n, p is const
48P_INLINE poly pp_Mult_nn(poly p, number n, const ring r = currRing);
49// returns p*n, destroys p
50P_INLINE poly p_Mult_nn(poly p, number n, const ring r = currRing);
51// returns p*m, does neither destroy p nor m
52P_INLINE poly pp_Mult_mm(poly p, poly m, const ring r = currRing);
53// returns p*m, destroys p, const: m
54P_INLINE poly p_Mult_mm(poly p, poly m, const ring r = currRing);
55// returns p+q, destroys p and q
56P_INLINE poly p_Add_q(poly p, poly q, const ring r = currRing);
57// return p - m*q, destroys p; const: q,m
58P_INLINE poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, const ring r = currRing);
59// returns p*q, destroys p and q
60P_INLINE poly p_Mult_q(poly p, poly q, const ring r = currRing);
61// returns p*q, does neither destroy p nor q
62P_INLINE poly pp_Mult_qq(poly p, poly q, const ring r = currRing);
63
64/*------------- p_Proc stuff ----------------------*/
65typedef poly (*p_Copy_Proc_Ptr)(poly p, const ring r);
66typedef void (*p_Delete_Proc_Ptr)(poly *p, const ring r);
67typedef poly (*p_ShallowCopyDelete_Proc_Ptr)(poly p, const ring r, omBin_s* dest_bin);
68typedef poly (*p_Mult_nn_Proc_Ptr)(poly p, number n, const ring r);
69typedef poly (*pp_Mult_nn_Proc_Ptr)(poly p, number n, const ring r);
70typedef poly (*p_Mult_mm_Proc_Ptr)(poly p, poly m, const ring r);
71typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, poly m, 
72                                   poly spNoether, const ring r);
73typedef poly (*p_Add_q_Proc_Ptr)(poly p, poly q, int & shorter, const ring r);
74typedef poly (*p_Minus_mm_Mult_qq_Proc_Ptr)(poly p, poly m, poly q, 
75                                          int &shorter, poly spNoether, 
76                                          const ring r);
77typedef poly (*p_ReverseNeg_Proc_Ptr)(poly p, const ring r);
78typedef poly (*p_Neg_Proc_Ptr)(poly p, const ring r);
79
80typedef struct p_Procs_s
81{
82  p_Copy_Proc_Ptr               p_Copy;
83  p_Delete_Proc_Ptr             p_Delete;
84  p_ShallowCopyDelete_Proc_Ptr  p_ShallowCopyDelete;
85  p_Mult_nn_Proc_Ptr            p_Mult_nn;
86  pp_Mult_nn_Proc_Ptr           pp_Mult_nn;
87  pp_Mult_mm_Proc_Ptr           pp_Mult_mm;
88  p_Mult_mm_Proc_Ptr            p_Mult_mm;
89  p_Add_q_Proc_Ptr              p_Add_q;
90  p_Minus_mm_Mult_qq_Proc_Ptr   p_Minus_mm_Mult_qq;
91  p_ReverseNeg_Proc_Ptr         p_ReverseNeg;
92  p_Neg_Proc_Ptr                p_Neg;
93} pProcs_s;
94
95 
96void p_SetProcs(ring r, p_Procs_s* p_Procs);
97#ifdef RDEBUG
98void p_Debug_GetSpecNames(const ring r, char* &field, char* &length, 
99                          char* &ord);
100void p_Debug_GetProcNames(const ring r, p_Procs_s* p_Procs);
101#endif
102
103#include "p_Inline.cc"
104
105#endif /* ! P_PROCS_H */
Note: See TracBrowser for help on using the repository browser.