The Original CHomP Software
cubisets.h
Go to the documentation of this file.
1
3
13
14// Copyright (C) 1997-2020 by Pawel Pilarczyk.
15//
16// This file is part of my research software package. This is free software:
17// you can redistribute it and/or modify it under the terms of the GNU
18// General Public License as published by the Free Software Foundation,
19// either version 3 of the License, or (at your option) any later version.
20//
21// This software is distributed in the hope that it will be useful,
22// but WITHOUT ANY WARRANTY; without even the implied warranty of
23// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24// GNU General Public License for more details.
25//
26// You should have received a copy of the GNU General Public License
27// along with this software; see the file "license.txt". If not,
28// please, see <https://www.gnu.org/licenses/>.
29
30// Started in January 2002. Last revision: February 2, 2018.
31
32
33#ifndef _CHOMP_HOMOLOGY_CUBISETS_H_
34#define _CHOMP_HOMOLOGY_CUBISETS_H_
35
36#include "chomp/system/config.h"
45
46#include <iostream>
47#include <fstream>
48#include <cstdlib>
49
50namespace chomp {
51namespace homology {
52
53// the choice of the reduction algorithms
54#if defined (_REDUCTION0_)
55using namespace reduction0;
56#elsif defined (_REDUCTION1_)
57using namespace reduction1;
58#elsif defined (_REDUCTION2_)
59using namespace reduction2;
60#else
61// the default choice
62using namespace reduction1;
63#endif
64
65
66// --------------------------------------------------
67// ------------------ reduce cubes ------------------
68// --------------------------------------------------
69
75template <class tCube>
77 mvmap<tCube,tCube> &cubmap, const hashedset<tCube> &keep,
78 bool quiet = true)
79{
80 const MapRemainsAcyclic<tCube> mapRemainsAcyclic (cubmap);
81 hashedset<tCube> emptyset;
82 return cubreducequiet (emptyset, cset, other, keep,
83 mapRemainsAcyclic, quiet);
84} /* cubreducequiet */
85
90template <class tCube>
92 mvmap<tCube,tCube> &cubmap, const hashedset<tCube> &keep)
93{
94 return cubreducequiet (cset, other, cubmap, keep, false);
95} /* cubreduce */
96
101template <class tCube>
103 const hashedset<tCube> &keep, bool quiet = true)
104{
105 mvmap<tCube,tCube> emptymap;
106 const MapRemainsAcyclic<tCube> mapRemainsAcyclic (emptymap);
107 hashedset<tCube> emptyset;
108 return cubreducequiet (emptyset, cset, other, keep,
109 mapRemainsAcyclic, quiet);
110} /* cubreducequiet */
111
115template <class tCube>
117 const hashedset<tCube> &keep)
118{
119 return cubreducequiet (cset, other, keep, false);
120} /* cubreduce */
121
125template <class tCube>
127 hashedset<tCube> &cset, bool quiet = true)
128{
129 mvmap<tCube,tCube> emptymap;
130 const MapRemainsAcyclic<tCube> mapRemainsAcyclic (emptymap);
131 hashedset<tCube> emptyset;
132 return cubreducequiet (maincset, cset, emptyset, emptyset,
133 mapRemainsAcyclic, quiet);
134} /* cubreducequiet */
135
138template <class tCube>
139inline int_t cubreduce (const hashedset<tCube> &maincset,
140 hashedset<tCube> &cset)
141{
142 return cubreducequiet (maincset, cset, false);
143} /* cubreduce */
144
145
146// --------------------------------------------------
147// ------------------ expand cubes ------------------
148// --------------------------------------------------
149
152template <class tCube>
154 bool quiet = false)
155{
156 MapCanExpandDummy<tCube> mapCanExpand;
157 return cubexpand (cset, other, mapCanExpand, quiet);
158} /* cubexpand */
159
166template <class tCube>
169 const mvmap<tCube,tCube> &map, bool indexmap,
170 bool checkacyclic, bool quiet = false)
171{
172 MapCanExpand<tCube> mapCanExpand (map, imgsrc, img,
173 indexmap, checkacyclic, quiet);
174 return cubexpand (cset, other, mapCanExpand, quiet);
175} /* cubexpand */
176
177
178} // namespace homology
179} // namespace chomp
180
181#endif // _CHOMP_HOMOLOGY_CUBISETS_H_
182
A dummy class that substitutes MapCanExpand if there is no map to check, so the verification always r...
Definition: cubacycl.h:487
A class for the procecure checking if the image of a given map can be expanded without any harm to th...
Definition: cubacycl.h:392
A wrapper class for the procecure checking if a given map remains acyclic when a given full cube is r...
Definition: cubacycl.h:346
This file contains some precompiler definitions which indicate the operating system and/or compiler u...
This file contains procedures for the verification of acyclicity of full cubical sets,...
This file contains the simplest (and inefficient) implementation of procedures for the geometric redu...
This file contains the original procedures for the geometric reduction of full cubical sets,...
int int_t
Index type for indexing arrays, counting cubes, etc.
Definition: config.h:115
This file contains the definition of the container "hashedset" which can be used to represent a set o...
int_t cubreducequiet(hashedset< tCube > &cset, hashedset< tCube > &other, mvmap< tCube, tCube > &cubmap, const hashedset< tCube > &keep, bool quiet=true)
Reduces a pair of sets of cubes for relative homology computation.
Definition: cubisets.h:76
int_t cubexpand(hashedset< tCube > &cset, hashedset< tCube > &other, bool quiet=false)
Expands the set 'other' towards 'cset' without changing the homology of (cset + other,...
Definition: cubisets.h:153
int_t cubreduce(hashedset< tCube > &cset, hashedset< tCube > &other, mvmap< tCube, tCube > &cubmap, const hashedset< tCube > &keep)
Reduces a pair of sets of cubes for relative homology computation.
Definition: cubisets.h:91
This namespace contains the entire CHomP library interface.
Definition: bitmaps.h:51
This file contains the definition of a set of n-dimensional points with integer coordinates and sever...
This file contains the definition of the container "setunion".
This file contains some useful functions related to the text input/output procedures.