The Original CHomP Software
Public Member Functions | Protected Attributes | List of all members
chomp::homology::MapCanExpand< tCube > Class Template Reference

A class for the procecure checking if the image of a given map can be expanded without any harm to the homology of the codomain when a given full cube is moved from X\A to A in the domain during the expansion procedure conducted in the domain. More...

#include <cubacycl.h>

Public Member Functions

 MapCanExpand (const mvmap< tCube, tCube > &_map, hashedset< tCube > &_imgsrc, hashedset< tCube > &_img, bool _indexmap, bool _checkacyclic, bool _quiet)
 The only allowed constructor. More...
 
template<class tSet1 , class tSet2 >
bool operator() (const tCube &c, const tSet1 &cset, const tSet2 &other) const
 Verifies if the map remains acyclic after the addition or removal of the given cube to/from the given set of cubes. More...
 

Protected Attributes

const mvmap< tCube, tCube > & map
 A reference to the map being verified. More...
 
hashedset< tCube > & imgsrc
 A reference to the source of image cubes. (?) More...
 
hashedset< tCube > & img
 A reference to image of the map, previously computed, modified. More...
 
bool indexmap
 Is theis the index map? More...
 
bool checkacyclic
 Should it be checked that the map acyclicity is preserved? More...
 
bool quiet
 Should any messages be suppressed? More...
 

Detailed Description

template<class tCube>
class chomp::homology::MapCanExpand< tCube >

A class for the procecure checking if the image of a given map can be expanded without any harm to the homology of the codomain when a given full cube is moved from X\A to A in the domain during the expansion procedure conducted in the domain.

Please, note that the codomain provided is modified to ensure that F(A) is a subset of B, where F:(X,A)->(Y,B).

Definition at line 391 of file cubacycl.h.

Constructor & Destructor Documentation

◆ MapCanExpand()

template<class tCube >
chomp::homology::MapCanExpand< tCube >::MapCanExpand ( const mvmap< tCube, tCube > &  _map,
hashedset< tCube > &  _imgsrc,
hashedset< tCube > &  _img,
bool  _indexmap,
bool  _checkacyclic,
bool  _quiet 
)
inline

The only allowed constructor.

Definition at line 429 of file cubacycl.h.

431 :
432 map (_map), imgsrc (_imgsrc), img (_img),
433 indexmap (_indexmap), checkacyclic (_checkacyclic),
434 quiet (_quiet)
435{
436 return;
437} /* MapCanExpand<tCube>::MapCanExpand */
bool checkacyclic
Should it be checked that the map acyclicity is preserved?
Definition: cubacycl.h:421
const mvmap< tCube, tCube > & map
A reference to the map being verified.
Definition: cubacycl.h:409
bool indexmap
Is theis the index map?
Definition: cubacycl.h:418
bool quiet
Should any messages be suppressed?
Definition: cubacycl.h:424
hashedset< tCube > & img
A reference to image of the map, previously computed, modified.
Definition: cubacycl.h:415
hashedset< tCube > & imgsrc
A reference to the source of image cubes. (?)
Definition: cubacycl.h:412

Member Function Documentation

◆ operator()()

template<class tCube >
template<class tSet1 , class tSet2 >
bool chomp::homology::MapCanExpand< tCube >::operator() ( const tCube &  c,
const tSet1 &  cset,
const tSet2 &  other 
) const
inline

Verifies if the map remains acyclic after the addition or removal of the given cube to/from the given set of cubes.

Assumes that the map is acyclic before the change. Returns 'true' if yes for sure, 'false' if there is some doubt.

Definition at line 441 of file cubacycl.h.

443{
444 // take the image and reduce what is outside 'img'
445 const hashedset<tCube> &cubimage = map (c);
446 hashedset<tCube> ximage = cubimage;
447 if (indexmap)
448 ximage. add (c);
449 ximage. remove (img);
450 cubreducequiet (img, ximage);
451
452 // if the image could not be reduced, skip the cube
453 if (!ximage. empty ())
454 return false;
455
456 // make sure that the acyclicity of the map is not spoiled
457 if (checkacyclic && !remainsacyclic (map, c, other))
458 return false;
459
460 // add the image of this cube to the image of the map
461 if (!quiet && !cubimage. empty ())
462 {
463 sseq << "R\n";
464 for (int_t j = 0; j < cubimage. size (); ++ j)
465 sseq << '2' << cubimage [j] << '\n';
466 if (indexmap)
467 sseq << '2' << c << '\n';
468 }
469 img. add (cubimage);
470 if (indexmap)
471 img. add (c);
472
473 // remove from 'imgsrc' all the cubes added to 'img'
474 imgsrc. remove (cubimage);
475 if (indexmap)
476 imgsrc. remove (c);
477
478 return true;
479} /* MapCanExpand<tCube>::operator () */
int int_t
Index type for indexing arrays, counting cubes, etc.
Definition: config.h:115
outputstream sseq
An auxiliary stream which captures sequences of processed data.
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
bool remainsacyclic(const mvmap< tCube, tCube > &map, const tCube &q, const tSet &cset)
Verifies if the map remains acyclic after the addition or removal of the given cube to/from the union...
Definition: cubacycl.h:280

References chomp::homology::cubreducequiet(), chomp::homology::remainsacyclic(), and chomp::homology::sseq.

Member Data Documentation

◆ checkacyclic

template<class tCube >
bool chomp::homology::MapCanExpand< tCube >::checkacyclic
protected

Should it be checked that the map acyclicity is preserved?

Definition at line 421 of file cubacycl.h.

◆ img

template<class tCube >
hashedset<tCube>& chomp::homology::MapCanExpand< tCube >::img
protected

A reference to image of the map, previously computed, modified.

Definition at line 415 of file cubacycl.h.

◆ imgsrc

template<class tCube >
hashedset<tCube>& chomp::homology::MapCanExpand< tCube >::imgsrc
protected

A reference to the source of image cubes. (?)

Definition at line 412 of file cubacycl.h.

◆ indexmap

template<class tCube >
bool chomp::homology::MapCanExpand< tCube >::indexmap
protected

Is theis the index map?

Definition at line 418 of file cubacycl.h.

◆ map

template<class tCube >
const mvmap<tCube,tCube>& chomp::homology::MapCanExpand< tCube >::map
protected

A reference to the map being verified.

Definition at line 409 of file cubacycl.h.

◆ quiet

template<class tCube >
bool chomp::homology::MapCanExpand< tCube >::quiet
protected

Should any messages be suppressed?

Definition at line 424 of file cubacycl.h.


The documentation for this class was generated from the following file: