35#ifndef _CHOMP_HOMOLOGY_CUBIRED0_H_
36#define _CHOMP_HOMOLOGY_CUBIRED0_H_
83template <
class tCube,
class tVerify>
90 int_t prev = cset. size () + other. size ();
93 if (maincset. empty () && cset. empty ())
104 int dim = (cset. empty ()) ? maincset [0]. dim () :
113 static int_t _maxneighbors = 0;
115 if (maxneighbors != _maxneighbors)
117 _maxneighbors = maxneighbors;
118 buffer. reset (
new unsigned char [(maxneighbors + 7) >> 3]);
119 b. define (buffer. get (), maxneighbors);
129 bool modified (
false);
132 for (
int_t i = 0; i < cset. size () + other. size (); ++ i)
136 if (!quiet && !(count % 373))
137 scon << std::setw (10) << count <<
138 "\b\b\b\b\b\b\b\b\b\b";
141 bool is_other (i >= cset. size ());
144 const tCube &c (is_other ?
145 other [i - cset. size ()] : cset [i]);
152 b. clearall (maxneighbors);
163 other, &b, maxneighbors,
164 no_neighbors, no_neighbors))
170 if (!verify (c, other))
183 sseq <<
'0' << c <<
'\n';
184 other. removenum (i - cset. size ());
198 &b, maxneighbors, no_neighbors))
213 sseq <<
'0' << c <<
'\n';
225 return prev - cset. size () - other. size ();
238template <
class tCube,
class tVerify>
240 const tVerify &verify,
bool quiet =
false)
243 if (cset. empty () || other. empty ())
247 int_t prev = cset. size ();
250 int dim = cset [0]. dim ();
257 static int_t _maxneighbors = 0;
259 if (maxneighbors != _maxneighbors)
261 _maxneighbors = maxneighbors;
262 buffer. reset (
new unsigned char [(maxneighbors + 7) >> 3]);
263 b. define (buffer. get (), maxneighbors);
273 bool modified (
false);
277 for (
int_t i = 0; i < cset. size (); ++ i)
281 if (!quiet && !(count % 373))
282 scon << std::setw (10) << count <<
283 "\b\b\b\b\b\b\b\b\b\b";
286 const tCube &c = cset [i];
289 b. clearall (maxneighbors);
292 if (!
acyclic (c, dim, other, &b, maxneighbors))
296 if (!verify (c, cset, other))
302 sseq <<
"L\n" <<
'2' << c <<
'\n';
314 return prev - cset. size ();
An auto_array template that mimics selected behaviors of the std::auto_ptr template,...
This file contains functions generated using Binary Decision Diagrams for checking the acyclicity of ...
This file contains the definition of a bitfield class which works an array of bits.
This file includes header files with various definitions of cubical cells and defines the standard ty...
This file contains classes and functions related to algebraic chain complexes and chain maps,...
This class defines a bit field that is part of some larger array or that uses an allocated piece of m...
An auto_array template that mimics selected behaviors of the std::auto_ptr template,...
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 includes header files with various definitions of full cubes and defines the standard types...
This file contains some procedures defined for cubical maps.
This file contains a definition of a general geometric complex which represents a polyhedron.
int int_t
Index type for indexing arrays, counting cubes, etc.
This file contains the definition of the container "hashedset" which can be used to represent a set o...
This file defines a class "integer" which represents the ring of integers or the field of integers mo...
This file contains the definition of a tabulated set of configurations of full cubical neighborhood u...
int_t cubreducequiet(const hashedset< tCube > &maincset, hashedset< tCube > &cset, hashedset< tCube > &other, const hashedset< tCube > &keep, const tVerify &verify, bool quiet=true)
Reduces a pair of sets of cubes for relative homology computation.
int_t cubexpand(hashedset< tCube > &cset, hashedset< tCube > &other, const tVerify &verify, bool quiet=false)
Expands the set 'other' towards 'cset' without changing the homology of (cset + other,...
outputstream sseq
An auxiliary stream which captures sequences of processed data.
bool acyclic(int dim, BitField &b)
Checks whether this cube's nieghbors form an acyclic set.
bool acyclic_rel(const tCube &q, int dim, const tSet1 &cset, const tSet2 &other, BitField *b, int_t maxneighbors, hashedset< tCube > *neighbors_main, hashedset< tCube > *neighbors_other)
Verifies whether a cube from the other set can be removed.
setunion< set1type, set2type > makesetunion(const set1type &set1, const set2type &set2)
Creates an object which represents the union of two sets.
int_t getmaxneighbors(int dim)
Returns the maximal number of neighbors of a cube: 3^dim - 1.
outputstream scon
The console output stream to which one should put all the junk that spoils the log file,...
This namespace contains the entire CHomP library interface.
This file contains various procedures relating to neighborhoods of cubes in full cubical sets.
This file contains the definition of a point base class which is used for indexing all the points (n-...
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 the definition of a class which stores tabulated configuration of full cubical nei...
This file contains some useful functions related to the text input/output procedures.