SUNphi  1.0
Factorize.hpp File Reference

Factorizes a number with a simple algorithm. More...

#include <ios/Logger.hpp>
#include <vector>

Go to the source code of this file.

Functions

template<typename I >
constexpr Vector< I > SUNphi::factorize (I n)
 Factorizes a number with a simple algorithm. More...
 
template<typename I >
std::map< I, I > SUNphi::factorizeGrouping (const I &i)
 

Detailed Description

Factorizes a number with a simple algorithm.

Definition in file Factorize.hpp.

Function Documentation

template<typename I >
constexpr Vector<I> SUNphi::factorize ( n)

Factorizes a number with a simple algorithm.

Result of the factorization

List of all known primes before 100

Iterator to the initial value of the divisor

Divisor

Dividend

Remainder

Parameters
nNumber to factorize

Definition at line 16 of file Factorize.hpp.

template<typename I >
std::map<I,I> SUNphi::factorizeGrouping ( const I &  i)

Factorize grouping number

Example:

factorizeGrouping(12); // {{2,2},{3,1}}

Ungrouped factors

Definition at line 84 of file Factorize.hpp.