File: LexOrder.h

package info (click to toggle)
brial 1.2.12-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,404 kB
  • sloc: cpp: 219,610; ansic: 43,783; python: 4,172; makefile: 336; sh: 5
file content (84 lines) | stat: -rw-r--r-- 2,050 bytes parent folder | download | duplicates (7)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// -*- c++ -*-
//*****************************************************************************
/** @file LexOrder.h
 *
 * @author Alexander Dreyer
 * @date 2006-05-18
 *
 * Defining lexicographical ordering.
 *
 * @par Copyright:
 *   (c) 2006-2010 by The PolyBoRi Team
 *
**/
//*****************************************************************************

#ifndef polybori_LexOrder_h_
#define polybori_LexOrder_h_

// include basic definitions
#include <polybori/pbori_defs.h>

// include base order definitions
#include <polybori/orderings/COrderingFacade.h>
#include <polybori/orderings/COrderingTags.h>

BEGIN_NAMESPACE_PBORI

/** @class LexOrder
 * @brief This class defines ordering related functions.
 *
 *
 **/
class LexOrder:
  public COrderingFacade<LexOrder, lex_tag> {

  /// generic access to current type
  typedef LexOrder self;

 public:

  /// Define binary predicate for index comparision
  typedef std::less<idx_type> idx_comparer_type;

  /// Default Constructor
  LexOrder(): base() {};

  /// Copy Constructor
  LexOrder(const self& rhs): base(rhs) {};

  /// Destructor
  ~LexOrder() {};

  /// Comparison of indices corresponding to variables
  comp_type compare(idx_type, idx_type) const;

  /// Comparison of monomials
  comp_type compare(const monom_type&, const monom_type&) const;

  /// Comparison of exponent vectors
  comp_type compare(const exp_type&, const exp_type&) const;

  /// Get leading term
  monom_type lead(const poly_type&) const;

  /// Leading monomial with bound (just the ordinary leading monomial)
  /// @note falls back to @c leadExp, ignores second argument
  monom_type lead(const poly_type& poly, deg_type) const {
    return lead(poly);
  }

  /// Get leading exponent
  exp_type leadExp(const poly_type&) const;

  /// Leading exponent with bound (just the ordinary leading monomial)
  /// @note falls back to @c leadExp, ignores second argument
  exp_type leadExp(const poly_type& poly, deg_type) const {
    return leadExp(poly);
  }
};


END_NAMESPACE_PBORI

#endif // polybori_LexOrder_h_