summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-13 11:02:41 +0000
committerpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-13 11:02:41 +0000
commitd78f9b038e49e711d45bb0a2e9696ba2b5765262 (patch)
tree236d0075bd0c826ed3c3c6b34fd82bbc6530af06 /src
parent44a02b6f1c8e1615d57101d9855ddc9a70137156 (diff)
answer to Marc's comments.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1862 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: cb5544ba69d99b1095941b49d850673db36b1fec
Diffstat (limited to 'src')
-rw-r--r--src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h b/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h
index 54f4076b..e2bef0d7 100644
--- a/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h
+++ b/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h
@@ -331,7 +331,8 @@ public:
/**
* Binary (arythmetic) operation on two Persistence_heat_maps.
**/
- friend Persistence_heat_maps operation_on_pair_of_heat_maps( const Persistence_heat_maps& first , const Persistence_heat_maps& second , double (*opertion)( double,double ) )
+ template<typename Operation_type>
+ friend Persistence_heat_maps operation_on_pair_of_heat_maps( const Persistence_heat_maps& first , const Persistence_heat_maps& second , Operation_type operation )
{
//first check if the heat maps are compatible
if ( !first.check_if_the_same( second ) )
@@ -349,7 +350,7 @@ public:
v.reserve( first.heat_map[i].size() );
for ( size_t j = 0 ; j != first.heat_map[i].size() ; ++j )
{
- v.push_back( opertion( first.heat_map[i][j] , second.heat_map[i][j] ) );
+ v.push_back( operation( first.heat_map[i][j] , second.heat_map[i][j] ) );
}
result.heat_map.push_back( v );
}
@@ -384,14 +385,14 @@ public:
**/
friend Persistence_heat_maps operator+( const Persistence_heat_maps& first , const Persistence_heat_maps& second )
{
- return operation_on_pair_of_heat_maps( first , second , plus_ );
+ return operation_on_pair_of_heat_maps( first , second , std::plus<double>() );
}
/**
* This function computes a difference of two objects of a type Persistence_heat_maps.
**/
friend Persistence_heat_maps operator-( const Persistence_heat_maps& first , const Persistence_heat_maps& second )
{
- return operation_on_pair_of_heat_maps( first , second , minus_ );
+ return operation_on_pair_of_heat_maps( first , second , std::minus<double>() );
}
/**
* This function computes a product of an object of a type Persistence_heat_maps with real number.