Aliquot Sequence Research  2.0
Compute properties of the sum-of-proper-divisors function.
Data Structures | Functions
pomyang_kparent.h File Reference

api for pom_yang algorithm operations More...

#include <stdbool.h>
#include <stdlib.h>
#include "../inc/PackedArray.h"
#include "../inc/math_macros.h"
Include dependency graph for pomyang_kparent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pomyang_config_t
 Configure the Pomerance-Yang algorithm. More...
 

Functions

PackedArraypomyang_algorithm (const pomyang_config_t *cfg)
 Runs the Pomerance-Yang algorithm. More...
 
uint64_t * pomyang_count_kparent (const pomyang_config_t *cfg)
 runs the Pomerance-Yang algorithm and counts occurrence of kparent numbers. More...
 
void print_to_file (pomyang_config_t *cfg, const char *filename, uint64_t *count, float runtime)
 Prints Pomerance-Yang algorithm configuration. More...
 

Detailed Description

api for pom_yang algorithm operations

Author
Gavin Guinn (gavin.nosp@m.guin.nosp@m.n1@gm.nosp@m.ail..nosp@m.com)
Date
2021-2-17

Function Documentation

◆ pomyang_algorithm()

PackedArray* pomyang_algorithm ( const pomyang_config_t cfg)

Runs the Pomerance-Yang algorithm.

Parameters
cfgSee struct defintion
Returns
PackedArray* containing the number of preimages for even number upto bound. Free'd by caller.

◆ pomyang_count_kparent()

uint64_t* pomyang_count_kparent ( const pomyang_config_t cfg)

runs the Pomerance-Yang algorithm and counts occurrence of kparent numbers.

Parameters
cfgSee struct definition
Returns
uint64_t* buffer of length (UINT8_MAX + 1) with occurrence counts, must be free'd by caller

◆ print_to_file()

void print_to_file ( pomyang_config_t cfg,
const char *  filename,
uint64_t *  count,
float  runtime 
)

Prints Pomerance-Yang algorithm configuration.

Parameters
cfgPointer to config struct.
filenameName of file to write.
countArray of k-parent counts.
runtimeCPU seconds used.