Epstein Zeta Library 0.5.0
Calculates the Epstein Zeta function
Loading...
Searching...
No Matches
Macros | Functions
test_epsteinZeta.c File Reference

Benchmarking of the Epstein zeta function. More...

#include "../tools.h"
#include "epsteinZeta.h"
#include "stdbool.h"
#include "utils.h"
#include <complex.h>
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for test_epsteinZeta.c:

Macros

#define MAX_PATH_LENGTH   1024
 
#define BASE_PATH   "csv"
 

Functions

double sHat (double nu, unsigned int dim, double *y)
 Calculates the singularity of the Epstein zeta function as y approaches zero.
 
void freeTestResources (double *a, double *nu, double *x, double *y, double *zetaRef)
 Free memory allocated for test resources.
 
void reportEpsteinZetaError (double complex valZeta, double complex valZetaReg, double errorMaxAbsRel, double tol, double *m, unsigned int dim, double nu, double *x, double *y)
 Reports an error when the Epstein Zeta function representation test fails.
 
void reportEpsteinZetaCutoffError (const char *testCase, double complex zeta1, double complex zeta2, double nu, double *y, unsigned int dim)
 Reports an error when the Epstein Zeta function cutoff test fails.
 
int test_epsteinZeta_epsteinZetaReg ()
 Test function for Epstein Zeta and Regularized Epstein Zeta functions.
 
bool test_epsteinZeta_epsteinZetaReg_represent_as_each_other ()
 Test if the Epstein Zeta function can be represented in terms of the regularized function and the singularity, particularly focusing on cases where nu = dim + 2k, where k is an integer.
 
bool test_epsteinZeta_cutoff ()
 Test the Epstein Zeta function behavior around the cutoff point for nu <= dim.
 
int main ()
 Main function to run all Epstein Zeta function tests.
 

Detailed Description

Benchmarking of the Epstein zeta function.

Function Documentation

◆ freeTestResources()

void freeTestResources ( double * a,
double * nu,
double * x,
double * y,
double * zetaRef )

Free memory allocated for test resources.

This function deallocates memory that was dynamically allocated for various arrays used in the Epstein Zeta function tests.

Parameters
[in]aPointer to the matrix of coefficients.
[in]nuPointer to the array of nu values.
[in]xPointer to the array of x values.
[in]yPointer to the array of y values.
[in]zetaRefPointer to the array of reference zeta values.

◆ main()

int main ( void )

Main function to run all Epstein Zeta function tests.

Returns
number of failed tests.

◆ reportEpsteinZetaCutoffError()

void reportEpsteinZetaCutoffError ( const char * testCase,
double complex zeta1,
double complex zeta2,
double nu,
double * y,
unsigned int dim )

Reports an error when the Epstein Zeta function cutoff test fails.

Parameters
[in]testCaseA string describing the specific test case that failed.
[in]zeta1The first computed value of the Epstein Zeta function.
[in]zeta2The second computed value of the Epstein Zeta function for comparison.
[in]nuThe parameter nu of the Epstein zeta function.
[in]yPointer to the array of y values.
[in]dimThe dimension of the lattice.

◆ reportEpsteinZetaError()

void reportEpsteinZetaError ( double complex valZeta,
double complex valZetaReg,
double errorMaxAbsRel,
double tol,
double * m,
unsigned int dim,
double nu,
double * x,
double * y )

Reports an error when the Epstein Zeta function representation test fails.

This function prints detailed information about the test case that failed, including the computed values, error margins, and input parameters.

Parameters
[in]valZetaThe value computed by epsteinZeta.
[in]valZetaRegThe value computed by the epsteinZetaReg representation.
[in]errorMaxAbsRelThe maximum of absolute and relative errors.
[in]tolThe tolerance level for the test.
[in]mPointer to the matrix of coefficients.
[in]dimThe dimension of the lattice.
[in]nuThe parameter nu of the Epstein zeta function.
[in]xPointer to the array of x values.
[in]yPointer to the array of y values.

◆ sHat()

double sHat ( double nu,
unsigned int dim,
double * y )

Calculates the singularity of the Epstein zeta function as y approaches zero.

Parameters
[in]nuThe parameter nu of the Epstein zeta function.
[in]dimThe dimension of the lattice.
[in]yPointer to the array of y values.
Returns
The value of the singularity function.

◆ test_epsteinZeta_cutoff()

bool test_epsteinZeta_cutoff ( )

Test the Epstein Zeta function behavior around the cutoff point for nu <= dim.

This function tests the Epstein Zeta function for four cases:

  1. At a reference value (y = {0, 0, 0.5})
  2. Just before the cutoff (y = {0, 0, 1e-31})
  3. Just after the cutoff (y = {0, 0, 1e-33})
  4. At zero (y = {0, 0, 0})

It then compares these results to check if:

  • The result after cutoff is the same as at zero
  • In the case that the result just before the cutoff is different from the reference result: That the result before cutoff is different from after cutoff
Returns
number of failed tests.

◆ test_epsteinZeta_epsteinZetaReg()

int test_epsteinZeta_epsteinZetaReg ( )

Test function for Epstein Zeta and Regularized Epstein Zeta functions.

This function tests both the epsteinZeta and epsteinZetaReg functions by comparing their outputs with reference values read from data files. It performs multiple test cases for each function and reports the number of passed tests.

Returns
number of failed tests.

◆ test_epsteinZeta_epsteinZetaReg_represent_as_each_other()

bool test_epsteinZeta_epsteinZetaReg_represent_as_each_other ( )

Test if the Epstein Zeta function can be represented in terms of the regularized function and the singularity, particularly focusing on cases where nu = dim + 2k, where k is an integer.

Returns
number of failed tests. tests pass.