File: complex.h

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (50 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2008  Michael E. Stillman

#ifndef _complex_h_
#define _complex_h_

/* The interface is similar to mpfr:
   Every gmp_CC struct needs to be initialized with init or init_set.
   All rounding is MPFR_RNDN.
   Resulting values are the first argument
*/

#if !defined(SAFEC_EXPORTS)
#include <engine-exports.h>
#endif

#if defined(__cplusplus)
extern "C" {
#endif

  void mpfc_init(gmp_CCmutable result, long precision);
  void mpfc_clear(gmp_CCmutable result);
  void mpfc_init_set(gmp_CCmutable result, gmp_CCmutable a);
  void mpfc_set_si(gmp_CCmutable result, long re);
  void mpfc_set(gmp_CCmutable result, gmp_CCmutable a);
  int mpfc_is_zero(gmp_CCmutable a);
  int mpfc_is_equal(gmp_CCmutable a, gmp_CCmutable b);
  void mpfc_add(gmp_CCmutable result, gmp_CCmutable a, gmp_CCmutable b);
  void mpfc_neg(gmp_CCmutable result, gmp_CCmutable a);
  void mpfc_sub(gmp_CCmutable result, gmp_CCmutable a, gmp_CCmutable b);
  void mpfc_mul(gmp_CCmutable result, gmp_CCmutable a, gmp_CCmutable b);
  void mpfc_invert(gmp_CCmutable result, gmp_CCmutable v);

  void mpfc_sub_mult(gmp_CCmutable result, gmp_CCmutable a, gmp_CCmutable b);
  /* result -= a*b */

  void mpfc_div(gmp_CCmutable result, gmp_CCmutable a, gmp_CCmutable b);
  void mpfc_abs(gmp_RRmutable result, gmp_CCmutable a);
  void mpfc_sqrt(gmp_CCmutable result, gmp_CC a);
  void mpfc_conj(gmp_CCmutable result, gmp_CCmutable a);

#if defined(__cplusplus)
}
#endif

#endif

// Local Variables:
// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
// indent-tabs-mode: nil
// End: