Skip to content

Commit

Permalink
Added consistency check for Goresky--MacPherson stratifications
Browse files Browse the repository at this point in the history
This *finally* fixes issue #30. I also had to update a test case because
it turns out I was using the wrong stratification. The results did *not*
change, though.
  • Loading branch information
Pseudomanifold committed Nov 9, 2017
1 parent 2148574 commit 5dcacaa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions include/aleph/persistentHomology/PhiPersistence.hh
Expand Up @@ -214,6 +214,19 @@ auto calculateIntersectionHomology( const aleph::topology::SimplicialComplex<Sim
// original indexing, starting from k=2.
bool useOriginalIndexing = is_goresky_macpherson_perversity<Perversity>::value;

if( useOriginalIndexing )
{
// Consistency check: The stratification must have sufficiently many
// simplicial complexes.
if( X.size() <= 2 )
throw std::runtime_error( "Insufficient number of simplicial complexes for stratification" );

// Consistency check: The strata need to satisfy $X_{n-1} = X_{n-2}$
// for a proper Goresky--MacPherson stratification.
if( *(X.rbegin()+1) != *(X.rbegin()+2) )
throw std::runtime_error( "Stratification must satisfy requirements by Goresky & MacPherson" );
}

// 0. Check consistency of strata.
// 1. Create permissibility function based on the dimensionality of
// the intersection of simplices with individual strata.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_persistent_intersection_homology.cc
Expand Up @@ -639,7 +639,7 @@ template <class T> void testTorus()
aleph::topology::Skeleton skeleton;
auto X0 = skeleton(0, K);
auto X1 = skeleton(1, K);
auto X2 = K;
auto X2 = X1;
auto X3 = K;

auto D2 = aleph::calculateIntersectionHomology( L, {X0,X1,X2,X3}, aleph::PerversityGM( {0,0} ) );
Expand Down

0 comments on commit 5dcacaa

Please sign in to comment.