source: git/kernel/sbuckets.h @ b29153

spielwiese
Last change on this file since b29153 was b3e756, checked in by Motsak Oleksandr <motsak@…>, 16 years ago
*motsak: Init is not implemented for sBuckets git-svn-id: file:///usr/local/Singular/svn/trunk@10834 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.7 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    sbuckets.h
6 *  Purpose: declaration of routines for sorting and adding up polys using
7 *           a bucket sort
8 *  Note:    If you need to extract the leading momonial of a bucket,
9 *           use kbuckets, instead.
10 *  Author:  obachman (Olaf Bachmann)
11 *  Created: 9/00
12 *  Version: $Id: sbuckets.h,v 1.2 2008-07-04 14:17:15 motsak Exp $
13 *******************************************************************/
14#ifndef S_BUCKETS_H
15#define S_BUCKETS_H
16
17#include "structs.h"
18
19//////////////////////////////////////////////////////////////////////////
20// Creation/Destruction of buckets
21//
22sBucket_pt    sBucketCreate(ring r = currRing);
23void          sBucketDestroy(sBucket_pt *bucket);
24
25
26/////////////////////////////////////////////////////////////////////////////
27// Convertion from/to SBpolys
28//
29
30// Converts p into a bucket poly (SBpoly) and destroys p
31// Assumes length <= 0 || pLength(p) == length
32// void sBucketInit(sBucket_pt bucket, poly p, int length);
33
34// creates and returns new bucket, initializes it with p
35// sBucket_pt sBucketInit( poly p, int length, ring r = currRing);
36
37// Converts SBpoly into a poly and clears bucket
38// i.e., afterwards SBpoly == 0
39// assumes all monomials in bucket are different
40void sBucketClearMerge(sBucket_pt bucket, poly *p, int *length);
41
42// Converts SBpoly into a poly and clears bucket
43// i.e., afterwards SBpoly == 0
44// bucket may contain equal monials
45void sBucketClearAdd(sBucket_pt bucket, poly *p, int *length);
46
47// Converts SBpoly into a poly and detroys bucket
48inline void sBucketDestroyMerge(sBucket_pt bucket, poly *p, int *length)
49{
50  sBucketClearMerge(bucket, p, length);
51  sBucketDestroy(&bucket);
52}
53
54// Converts SBpoly into a poly and detroys bucket
55inline void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
56{
57  sBucketClearAdd(bucket, p, length);
58  sBucketDestroy(&bucket);
59}
60
61
62//////////////////////////////////////////////////////////////////////////
63///
64/// Merges p into Spoly: assumes Bpoly and p have no common monoms
65///
66void sBucket_Merge_p(sBucket_pt bucket, poly p, int lp);
67// adds poly p to bucket
68void sBucket_Add_p(sBucket_pt bucket, poly p, int lp);
69
70
71//////////////////////////////////////////////////////////////////////////
72///
73/// Sorts p with bucektSort: assumes all monomials of p are different
74///
75poly sBucketSortMerge(poly p, ring r);
76
77//////////////////////////////////////////////////////////////////////////
78///
79/// Sorts p with bucektSort: p may have equal monomials
80///
81poly sBucketSortAdd(poly p, ring r);
82
83
84#endif // P_BUCKET_SORT
Note: See TracBrowser for help on using the repository browser.