~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to field_rationals.h

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#define FIELD_RATIONALS_H_INCLUDED
3
3
 
4
4
#include <vector>
 
5
#include <cstdio> /* Always include cstdio before gmp.h.*/
 
6
#include <gmp.h> //remove?
5
7
#include "vektor.h"
6
8
#include "field.h"
7
9
 
 
10
 
8
11
class FieldRationalsImplementation : public FieldImplementation
9
12
{
10
13
  FieldElementImplementation *zHomomorphismImplementation(int n);/* Creates FieldElementImplementation object with refcount1 */
12
15
  const char *name();
13
16
  std::string toString()const;
14
17
public:
15
 
  FieldRationalsImplementation();  
 
18
  virtual bool isRationals()const;
 
19
  FieldRationalsImplementation();
16
20
};
17
21
 
18
22
/*
27
31
extern Field Q;
28
32
 
29
33
IntegerVector primitiveVector(vector<FieldElement> const &v);
30
 
 
 
34
IntegerVector toIntegerVector(vector<FieldElement> const &v);// MUST HAVE INTEGER ENTRIES
 
35
int toInteger(FieldElement const &a);// MUST BE INTEGER
 
36
mpq_t *fieldElementToGmp(FieldElement const &c);
 
37
double fieldElementToFloatingPoint(FieldElement const&c);
 
38
/**
 
39
 * Will create a new FieldElement containing the value of c. The gmp representation of c is copied,
 
40
 * so c must be destructed by the caller.
 
41
 */
 
42
FieldElement fieldElementFromGmp(mpq_t *c);
 
43
/**
 
44
 * Will create a new FieldElement containing the value of c. The gmp representation of c is copied,
 
45
 * so c must be destructed by the caller.
 
46
 */
 
47
FieldElement fieldElementFromGmpZ(const mpz_t *c);
 
48
FieldElement gcd(FieldElement const &a, FieldElement const &b, FieldElement &s, FieldElement &t);
 
49
/**
 
50
 * Assumes that a and b are integers in the field of rational numbers.
 
51
 * Assumes that b is non-zero.
 
52
 * The remainder (if pointer is non-zero) is set to the remainder
 
53
 * of a divided by b in the interval [0,B[, where B=abs(b)=max(b,-b).
 
54
 * The return value equals the integer (a-remainder)/b.
 
55
 */
 
56
FieldElement integerDivision(FieldElement const &a, FieldElement const &b, FieldElement *remainder=0);
31
57
#endif