The ChainCon Software (Release 0.03)
emptycell.h
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file
4 ///
5 /// The decision on whether the empty cell should be used as a valid cell
6 /// of dimension -1.
7 ///
8 /////////////////////////////////////////////////////////////////////////////
9 
10 // Copyright (C) 2009-2016 by Pawel Pilarczyk.
11 //
12 // This file is part of my research software package. This is free software:
13 // you can redistribute it and/or modify it under the terms of the GNU
14 // General Public License as published by the Free Software Foundation,
15 // either version 3 of the License, or (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this software; see the file "license.txt". If not,
24 // please, see <http://www.gnu.org/licenses/>.
25 
26 // Started on March 24, 2009. Last revision: March 4, 2011.
27 
28 
29 #ifndef _CHAINCON_EMPTYCELL_H_
30 #define _CHAINCON_EMPTYCELL_H_
31 
32 
33 // --------------------------------------------------
34 // -------------- empty cell existence --------------
35 // --------------------------------------------------
36 
37 /// An empty cell existence decision class with the flag set to true.
39 {
40 public:
41  /// Returns the empty cell existence decision.
42  static bool exists ();
43 
44 }; /* class WithEmptyCell */
45 
46 inline bool WithEmptyCell::exists ()
47 {
48  return true;
49 } /* WithEmptyCell::exists */
50 
51 // --------------------------------------------------
52 
53 /// An empty cell existence decision class with the flag set to false.
55 {
56 public:
57  /// Returns the empty cell existence decision.
58  static bool exists ();
59 
60 }; /* class NoEmptyCell */
61 
62 inline bool NoEmptyCell::exists ()
63 {
64  return true;
65 } /* NoEmptyCell::exists */
66 
67 // --------------------------------------------------
68 
69 /// An empty cell existence decision class with settable global flag.
71 {
72 public:
73  /// Returns the empty cell existence flag.
74  static bool exists ();
75 
76  /// Sets the global flag for the empty cell existence.
77  static void setExistence (bool newFlag);
78 
79 private:
80  /// The global flag for the existence of the empty cell.
81  static bool theFlag;
82 
83 }; /* class SettableEmptyCell */
84 
86 {
87  return theFlag;
88 } /* SettableEmptyCell::exists */
89 
90 inline void SettableEmptyCell::setExistence (bool newFlag)
91 {
92  theFlag = newFlag;
93  return;
94 } /* SettableEmptyCell::setExistence */
95 
96 
97 /// Don't use the empty cell.
98 /// This symbol must be defined in order to suppress
99 /// the usage of the empty cell (of dimension -1)
100 /// in the boundaries of cells.
101 /// Otherwise, the empty cell is considered a valid cell,
102 /// and, as a result, reduced homology will be computed
103 /// instead of plain homology.
104 /// Note: The presence of the empty cell may cause problems while interfacing
105 /// with the CHomP library, which assumes no empty cell presence.
106 #define NO_EMPTY_CELL
107 
108 
109 #endif // _CHAINCON_EMPTYCELL_H_
110 
static bool exists()
Returns the empty cell existence flag.
Definition: emptycell.h:85
An empty cell existence decision class with the flag set to true.
Definition: emptycell.h:38
static bool exists()
Returns the empty cell existence decision.
Definition: emptycell.h:62
static void setExistence(bool newFlag)
Sets the global flag for the empty cell existence.
Definition: emptycell.h:90
static bool theFlag
The global flag for the existence of the empty cell.
Definition: emptycell.h:81
An empty cell existence decision class with settable global flag.
Definition: emptycell.h:70
static bool exists()
Returns the empty cell existence decision.
Definition: emptycell.h:46
An empty cell existence decision class with the flag set to false.
Definition: emptycell.h:54