SUNphi  1.0
Partition.hpp File Reference

Factorizes numbers into partitions. More...

Go to the source code of this file.

Functions

template<typename I , typename Fun >
SUNphi::Impl::loopOnAllFactorizingPartitioning (Vector< I > &partition, const I &n, const Fun &fun, const int &pos=0)
 
template<typename I , typename Fun >
SUNphi::loopOnAllFactorizingPartitioning (const I &n, const Fun &fun, const int &nFacts)
 
template<typename I >
Vector< Vector< I > > SUNphi::listAllFactorizingPartitioning (const I &n, const int &nFacts)
 Gets the list of all factorizing partition of n. More...
 

Detailed Description

Factorizes numbers into partitions.

Definition in file Partition.hpp.

Function Documentation

template<typename I >
Vector<Vector<I> > SUNphi::listAllFactorizingPartitioning ( const I &  n,
const int &  nFacts 
)

Gets the list of all factorizing partition of n.

Parameters
nNumber to factorize
nFactsSize of the partition

Definition at line 75 of file Partition.hpp.

template<typename I , typename Fun >
I SUNphi::Impl::loopOnAllFactorizingPartitioning ( Vector< I > &  partition,
const I &  n,
const Fun &  fun,
const int &  pos = 0 
)

Loop on all factorizing partition of n

Internal implementation, proceeds recursively calling the function until the position is the end

Number of partition found

Parameters
partitionProgressively built partition
nNumbr to factorize
funFunction to be called
posPosition filled at this iteration

Definition at line 23 of file Partition.hpp.

template<typename I , typename Fun >
I SUNphi::loopOnAllFactorizingPartitioning ( const I &  n,
const Fun &  fun,
const int &  nFacts 
)

Loop on all factorizing partition of n

Returns the number of partitions obtained

Built partition

Parameters
nNumber to factorize
funFunction to be invocated at each turn
nFactsSize of the partition

Definition at line 62 of file Partition.hpp.