File: pfaff.hpp

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 (52 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download | duplicates (4)
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
51
52
// Copyright 1996 Michael E. Stillman.

#ifndef _pfaff_hh_
#define _pfaff_hh_

#include "matrix.hpp"
#include "matrix-con.hpp"

class MatrixConstructor;

/**
    @ingroup comp

    @brief Computation of pfaffians of a skew symmetric matrix.
*/

class PfaffianComputation : public our_new_delete
{
  const Ring *R;
  const Matrix *M;
  MatrixConstructor pfaffs;
  // One row matrix collecting non-zero pfaffians

  int p;
  bool done;
  size_t *row_set;

  ring_elem calc_pfaff(size_t *r, int p);
  // Compute the pfaffian of the minor with rows
  // and columns r[0]..r[p-1]

  int step();
  // Compute one more pfaffian of size p.

 public:
  PfaffianComputation(const Matrix *M, int p);
  ~PfaffianComputation();

  int calc(int nsteps = -1);
  // Compute nsteps pfaffians.  Only non-negative ones are appended
  // -1 means compute all of them.

  Matrix *pfaffians() { return pfaffs.to_matrix(); }
  const Ring *get_ring() const { return R; }
};

#endif

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