OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Test List
File TestBiMap.cpp

BiMapTest::OutOfRangeException Tests exception handling when accessing non-existent keys. Verifies that std::out_of_range exceptions are thrown for both left_at() and right_at() when keys are not found.

BiMapTest::RightViewAccess Tests the right view accessor, which provides STL-compatible iterator interface for accessing the right-to-left mapping. Verifies find() and end() operations.

BiMapTest::MakeBiMapHelper Tests the make_bimap() helper function for creating a BiMap from an initializer list. Verifies that the helper function correctly constructs the bidirectional mapping.

BiMapTest::LeftViewAccess Tests the left view accessor, which provides STL-compatible iterator interface for accessing the left-to-right mapping. Verifies find() and end() operations.

BiMapTest::StringToString Tests BiMap with string types for both left and right values. Verifies that the bidirectional mapping works correctly with string keys and values.

BiMapTest::BasicInsertion Tests basic insertion and bidirectional lookup functionality. Verifies that values can be inserted and retrieved from both left-to-right and right-to-left directions.

BiMapTest::FindMethods Tests the find methods (left_find() and right_find()) and their corresponding end iterators. Verifies that find operations return correct iterators for existing keys and end iterators for non-existent keys.

File TestCubicSpline.cpp

CubicSplineTest::InvalidInput Tests error handling for invalid input data. Verifies that exceptions are thrown when: (1) too few data points (< 2) are provided, and (2) x-values are not strictly increasing.

CubicSplineTest::GSLCompatibleInterface Tests the GSL-compatible wrapper functions (gsl_spline_alloc, gsl_spline_init, gsl_spline_eval, etc.). Verifies that the GSL API is correctly implemented and that the accelerator reset functionality works properly.

CubicSplineTest::Extrapolation Tests extrapolation behavior beyond the data range. Verifies that the spline can extrapolate values to the left (before first data point) and right (after last data point) of the input data range.

CubicSplineTest::BasicInterpolation Tests basic cubic spline interpolation at data points and between points. Verifies that the spline exactly reproduces input data points and provides smooth interpolation between them. Uses test data \(y = x^2\).

CubicSplineTest::Accelerator Tests the accelerator optimization for repeated evaluations. The accelerator caches the last interval index to speed up subsequent evaluations in the same interval. Verifies correct behavior when evaluating in the same interval and when switching to different intervals.

CubicSplineTest::SinFunction Tests interpolation accuracy on a smooth function (sine). Creates a spline from sampled sine function data and verifies that interpolated values match the true function values within acceptable tolerance.

File TestFFT.cpp

FFTTest::ComplexFFT_Identity Tests FFT of a constant signal. Verifies basic FFT functionality for complex data. A constant signal should transform to a DC component in the frequency domain.

FFTTest::RealFFT_Transform Tests forward FFT for real-valued data. Verifies that real input data is correctly transformed to the frequency domain using the GSL-compatible packed format, where the result is stored as \([r_0, r_1, i_1, r_2, i_2, \ldots]\).

FFTTest::ComplexFFT_Forward Tests forward FFT for complex data. Verifies that a unit impulse (delta function at \(n=0\)) transforms to a constant in the frequency domain (all components equal to 1).

FFTTest::ComplexFFT_Inverse Tests inverse FFT for complex data. Verifies that a constant in the frequency domain transforms back to an impulse in the time domain, confirming the inverse relationship between forward and inverse transforms.

FFTTest::FFT_InverseRoundTrip Tests round-trip FFT operations (forward followed by inverse). Verifies that applying forward FFT followed by inverse FFT recovers the original signal (within scaling factor \(N\)), confirming the mathematical relationship: \(\text{IFFT}(\text{FFT}(x)) = N \cdot x\).

FFTTest::Radix2Forward Tests radix-2 FFT algorithm for power-of-2 sized data. Verifies that the radix-2 implementation correctly computes FFTs for data sizes that are powers of 2, which allows for optimized computation.

FFTTest::Radix2Inverse Tests radix-2 inverse FFT algorithm. Verifies that the inverse radix-2 transform correctly recovers time-domain signals from frequency-domain representations.

File TestGSLBLAS.cpp

GSLBLASTest::DGEMM_NoTrans Tests double-precision general matrix-matrix multiplication without transposition: \(\mathbf{C} = \alpha \mathbf{A} \mathbf{B} + \beta \mathbf{C}\) with \(\alpha = 1\) and \(\beta = 0\). Verifies correct computation of matrix product for non-square matrices.

GSLBLASTest::DGEMM_WithBeta Tests matrix-matrix multiplication with non-zero \(\beta\) coefficient. Verifies that the operation \(\mathbf{C} = \alpha \mathbf{A} \mathbf{B} + \beta \mathbf{C}\) correctly combines the matrix product with the existing matrix \(\mathbf{C}\).

GSLBLASTest::DGEMM_Transpose Tests matrix-matrix multiplication with transposed matrices. Verifies that \(\mathbf{C} = \mathbf{A}^T \mathbf{B}\) is computed correctly, including the case where \(\mathbf{A}^T\) and \(\mathbf{B}\) have compatible dimensions.

GSLBLASTest::DGEMV Tests double-precision general matrix-vector multiplication: \(\mathbf{y} = \alpha \mathbf{A} \mathbf{x} + \beta \mathbf{y}\). Verifies correct computation of matrix-vector product and combination with existing vector \(\mathbf{y}\).

GSLBLASTest::ZGEMM_Complex Tests complex matrix-matrix multiplication using double-precision complex numbers. Verifies that complex matrix products are computed correctly, including the identity matrix case \(\mathbf{I} \mathbf{I} = \mathbf{I}\).

File TestGSLCompat.cpp

GSLCompatTest::Hypot Tests the hypotenuse function \(\text{hypot}(x, y) = \sqrt{x^2 + y^2}\). Verifies correct computation for Pythagorean triples (e.g., 3-4-5, 5-12-13) and edge cases with zero values.

GSLCompatTest::BinomialCoefficient Tests binomial coefficient \(\binom{n}{m} = \frac{n!}{m!(n-m)!}\). Verifies correct computation including symmetry property \(\binom{n}{m} = \binom{n}{n-m}\) and edge cases: \(\binom{n}{0} = \binom{n}{n} = 1\).

GSLCompatTest::ErrorHandler Tests GSL error handler functions. Verifies that error handlers can be set and disabled without causing crashes or exceptions.

GSLCompatTest::BinomialCoefficientEdgeCases Tests edge cases for binomial coefficients: when \(m > n\) (should return 0), and when \(n = 0\) or \(n = 1\) with various \(m\) values.

GSLCompatTest::FactorialLarge Tests factorial function for larger values (e.g., 20!). For large factorials, the implementation uses the gamma function to avoid overflow. Verifies that large factorials are computed correctly within numerical precision limits.

GSLCompatTest::Factorial Tests factorial function \(n!\) for small integer values. Verifies correct computation of factorials from 0 to 10, including the special case \(0! = 1\).

GSLCompatTest::GammaFunction Tests the gamma function \(\Gamma(x)\) implementation. Verifies that gsl_sf_gamma() matches std::tgamma() for integer values (factorial property: \(\Gamma(n+1) = n!\)) and half-integer values ( \(\Gamma(1/2) = \sqrt{\pi}\)).

GSLCompatTest::PowInt Tests integer power function \(x^n\) for both positive and negative integer exponents. Verifies correct computation of powers including edge cases: \(x^0 = 1\), \(x^1 = x\), and negative powers \(x^{-n} = 1/x^n\).

GSLCompatTest::ErfFunction Tests the error function \(\text{erf}(x)\) implementation. Verifies that gsl_sf_erf() matches std::erf() for various input values, including zero, positive, negative, and large values approaching the asymptotic limit of 1.

File TestGSLComplex.cpp

GSLComplexTest::Division Tests complex number division. Verifies special case: \(1/i = -i\).

GSLComplexTest::Multiplication Tests complex number multiplication using the identity: \((a_1 + b_1i)(a_2 + b_2i) = (a_1a_2 - b_1b_2) + (a_1b_2 + a_2b_1)i\).

GSLComplexTest::Tanh Tests complex hyperbolic tangent function. Verifies behavior for real arguments ( \(\tanh(1)\)) and purely imaginary arguments ( \(\tanh(i) = i\tan(1)\)).

GSLComplexTest::Subtraction Tests complex number subtraction: \((a_1 + b_1i) - (a_2 + b_2i) = (a_1-a_2) + (b_1-b_2)i\).

GSLComplexTest::Conjugate Tests complex conjugate: \(\overline{a + bi} = a - bi\). Verifies that the real part remains unchanged and the imaginary part is negated.

GSLComplexTest::Absolute Tests complex absolute value (modulus): \(|a + bi| = \sqrt{a^2 + b^2}\). Verifies correct computation for a 3-4-5 right triangle case.

GSLComplexTest::Argument Tests complex argument (phase): \(\arg(a + bi) = \arctan(b/a)\). Verifies correct computation for \(1 + i\) (should be \(\pi/4\)).

GSLComplexTest::Addition Tests complex number addition: \((a_1 + b_1i) + (a_2 + b_2i) = (a_1+a_2) + (b_1+b_2)i\). Verifies correct computation of real and imaginary parts.

GSLComplexTest::CreatePolar Tests creation of complex numbers in polar form \(z = r e^{i\theta}\). Verifies that polar coordinates are correctly converted to rectangular form: \(a = r\cos\theta\), \(b = r\sin\theta\).

GSLComplexTest::CreateRectangular Tests creation of complex numbers in rectangular form \(z = a + bi\). Verifies that real and imaginary parts are correctly stored and can be retrieved using GSL_REAL and GSL_IMAG macros.

GSLComplexTest::Exp Tests complex exponential function. Verifies Euler's identity: \(e^{i\pi} = -1\).

GSLComplexTest::Log Tests complex logarithm function. Verifies that \(\ln(1) = 0\) for the principal branch.

File TestGSLEigen.cpp

GSLEigenTest::WorkspaceAllocation Tests allocation and deallocation of eigenvalue computation workspaces. Verifies that workspaces are correctly initialized with the specified size and that memory is properly managed.

GSLEigenTest::EigenNonsymm_Diagonal Tests eigenvalue computation for a diagonal matrix. Verifies that the computed eigenvalues match the diagonal elements (2, 3, 4), confirming that the algorithm correctly identifies eigenvalues for diagonalizable matrices.

GSLEigenTest::EigenNonsymmv_Identity Tests computation of both eigenvalues and eigenvectors for the identity matrix. Verifies that eigenvalues are correct and that eigenvectors are computed (though the implementation may use simplified eigenvector computation).

GSLEigenTest::EigenNonsymmv_Diagonal Tests eigenvalue and eigenvector computation for a diagonal matrix. Verifies that eigenvalues match diagonal elements and that the algorithm completes successfully.

GSLEigenTest::EigenNonsymm_ErrorHandling Tests error handling for invalid input (non-square matrix). Verifies that the function returns an error code when the input matrix dimensions are incompatible with eigenvalue computation.

GSLEigenTest::EigenNonsymm_Identity Tests eigenvalue computation for the identity matrix. Verifies that all eigenvalues are 1.0 (with zero imaginary part) for the identity matrix, confirming that the eigenvalue algorithm correctly handles this special case.

File TestGSLIntegration.cpp

GSLIntegrationTest::LinearFunction Tests integration of a linear function \(f(x) = x\) over the interval \([0, 1]\). Verifies that \(\int_0^1 x \, dx = \frac{1}{2}\) is computed correctly within the specified tolerance.

GSLIntegrationTest::QuadraticFunction Tests integration of a quadratic function \(f(x) = x^2\) over the interval \([0, 2]\). Verifies that \(\int_0^2 x^2 \, dx = \frac{8}{3}\) is computed correctly.

GSLIntegrationTest::SinFunction Tests integration of the sine function \(f(x) = \sin(x)\) over the interval \([0, \pi]\). Verifies that \(\int_0^{\pi} \sin(x) \, dx = 2\) is computed correctly, confirming proper handling of oscillatory functions.

GSLIntegrationTest::ExpFunction Tests integration of the exponential function \(f(x) = e^x\) over the interval \([0, 1]\). Verifies that \(\int_0^1 e^x \, dx = e - 1\) is computed correctly.

GSLIntegrationTest::NegativeRange Tests integration over a range that includes negative values. Verifies that \(\int_{-1}^1 x \, dx = 0\) (odd function over symmetric interval) is computed correctly.

GSLIntegrationTest::SmallRange Tests integration over a small interval. Verifies that the adaptive algorithm works correctly for narrow integration ranges and maintains accuracy.

File TestGSLLinalg.cpp

GSLLinalgTest::ComplexLUInvert Tests matrix inversion for complex matrices. Verifies that complex matrix inversion works correctly, including the identity matrix case.

GSLLinalgTest::LUInvert Tests matrix inversion using LU decomposition: \(\mathbf{A}^{-1}\). Verifies that the computed inverse satisfies \(\mathbf{A} \mathbf{A}^{-1} = \mathbf{I}\) by checking individual elements of the inverse matrix.

GSLLinalgTest::LUInvertIdentity Tests inversion of the identity matrix. Verifies that \(\mathbf{I}^{-1} = \mathbf{I}\), confirming that the inversion algorithm handles the special case correctly.

GSLLinalgTest::ComplexLUDecomp Tests LU decomposition for complex matrices. Verifies that the decomposition algorithm works correctly with complex-valued matrices, including the identity matrix case.

GSLLinalgTest::ComplexLUDet Tests determinant computation for complex matrices. Verifies that the determinant of the identity matrix is correctly computed as 1 (real part) with zero imaginary part.

GSLLinalgTest::LUDet Tests determinant computation using LU decomposition: \(\det(\mathbf{A}) = \det(\mathbf{P}) \det(\mathbf{L}) \det(\mathbf{U})\). Verifies correct computation of determinant for a 2×2 matrix with known determinant value.

GSLLinalgTest::LUDecomp Tests LU decomposition with partial pivoting: \(\mathbf{P} \mathbf{A} = \mathbf{L} \mathbf{U}\), where \(\mathbf{P}\) is a permutation matrix, \(\mathbf{L}\) is lower triangular, and \(\mathbf{U}\) is upper triangular. Verifies that the decomposition completes successfully for a tridiagonal matrix.

File TestGSLMatrix.cpp

GSLMatrixTest::VectorSetGet Tests setting and getting individual vector elements. Verifies that values can be stored and retrieved correctly using element indices.

GSLMatrixTest::VectorAllocation Tests vector memory allocation and deallocation. Verifies correct initialization of vector size and data pointer.

GSLMatrixTest::ComplexVector Tests complex vector operations including scaling with complex scalars. Verifies that complex vectors can be manipulated correctly.

GSLMatrixTest::MatrixSetIdentity Tests creating an identity matrix. Verifies that gsl_matrix_set_identity() sets diagonal elements to 1 and off-diagonal elements to 0.

GSLMatrixTest::VectorSetAll Tests setting all vector elements to a constant value. Verifies uniform initialization of all elements.

GSLMatrixTest::VectorScale Tests vector scaling operation: \(\mathbf{v} \leftarrow \alpha \mathbf{v}\). Verifies that all elements are multiplied by the scaling factor.

GSLMatrixTest::VectorAdd Tests vector addition: \(\mathbf{v}_1 \leftarrow \mathbf{v}_1 + \mathbf{v}_2\). Verifies element-wise addition of two vectors.

GSLMatrixTest::ComplexMatrix Tests complex matrix operations. Verifies that complex matrices can be allocated, elements can be set and retrieved, and complex number operations work correctly.

GSLMatrixTest::MatrixSetZero Tests zeroing a matrix. Verifies that gsl_matrix_set_zero() sets all elements to zero, even if the matrix was previously initialized with non-zero values.

GSLMatrixTest::MatrixSetAll Tests setting all matrix elements to a constant value. Verifies that gsl_matrix_set_all() correctly initializes all elements.

GSLMatrixTest::MatrixSetGet Tests setting and getting individual matrix elements. Verifies that values can be stored and retrieved correctly using row and column indices.

GSLMatrixTest::MatrixAllocation Tests matrix memory allocation and deallocation. Verifies that matrices are correctly allocated with specified dimensions and that memory is properly managed.

File TestHistogram.cpp

HistogramTest::UniformRanges Tests creation of histogram with uniform bin ranges. Verifies that bins are correctly allocated and that range boundaries are set correctly for uniform spacing between specified minimum and maximum values.

HistogramTest::IncrementAndGet Tests incrementing histogram bins and retrieving bin values. Verifies that values are correctly assigned to appropriate bins based on their position within the range, and that bin counts can be retrieved accurately.

HistogramTest::CustomRanges Tests histogram with custom (non-uniform) bin ranges. Verifies that bins with arbitrary range boundaries work correctly and that values are assigned to the correct bins based on the custom ranges.

HistogramTest::OutOfRange Tests handling of values outside the histogram range. Verifies that values below the minimum or above the maximum range do not increment any bins and are silently ignored (no exceptions thrown).

HistogramTest::Histogram2D Tests 2D histogram functionality with uniform ranges. Verifies that 2D histograms can be created, values can be incremented using (x, y) coordinates, and bin values can be retrieved correctly.

HistogramTest::Histogram2DCustomRanges Tests 2D histogram with custom ranges for both x and y dimensions. Verifies that non-uniform bin boundaries work correctly in both dimensions and that values are assigned to the correct 2D bins.

HistogramTest::Histogram2DOutOfRange Tests handling of out-of-range values in 2D histograms. Verifies that values outside the x or y ranges (or both) do not increment any bins.

File TestLinearCompton.cpp

TestLinearCompton::EnergySupportMatchesComptonEndpoints Verifies the exact electron-rest-frame energy support \(\omega_2 \in [\omega_1/(1+2\omega_1/m_e), \omega_1]\) and checks the recoil formula at the forward and backward endpoints.

TestLinearCompton::NinetyDegreeLabForwardBenchmarkMatchesExactFormula Reproduces the same 90 degree crossing benchmark used by the laser element: a 1 GeV electron moving along \(+\hat z\) and a 1030 nm laser propagating along \(+\hat x\). The forward scattered photon energy is compared against the exact stable laboratory-frame formula

TestLinearCompton::DifferentialSpectrumIntegratesToTotalCrossSection Numerically integrates \(d\sigma/d\omega_2\) over the exact support and compares it against the analytic Klein-Nishina total cross section.

TestLinearCompton::ThomsonLimitRecoveredAtLowEnergy Verifies that the exact Klein-Nishina total cross section approaches the Thomson limit for \(\omega_1 \ll m_e\).

File TestQuasiRandom.cpp

QuasiRandomTest::BasicGeneration Tests basic quasi-random number generation. Verifies that the generator can be allocated, that generated values are in the range \([0, 1)\), and that multi-dimensional sequences are generated correctly.

QuasiRandomTest::SequenceUniqueness Tests that generated sequences contain unique values and are not all zeros. Generates a sequence of 100 samples and verifies that values are properly distributed and non-trivial.

QuasiRandomTest::MultiDimensional Tests multi-dimensional quasi-random sequence generation. Verifies that all dimensions of a 5-dimensional sequence are correctly generated and that all values remain within the valid range \([0, 1)\).

QuasiRandomTest::Reproducibility Tests that quasi-random sequences are deterministic and reproducible. Creates two generators with the same initialization and verifies that they produce identical sequences, confirming deterministic behavior.

QuasiRandomTest::Coverage Tests space-filling properties of quasi-random sequences. Generates 1000 samples and verifies that the sequence covers a significant portion of the unit interval, demonstrating better coverage than pseudo-random sequences for low-discrepancy sequences.

File TestRandom.cpp

RandomTest::UniformDistribution Tests uniform random number generation in the range [0, 1). Generates 1000 samples and verifies: (1) all values are within bounds, and (2) the mean is approximately 0.5, confirming uniform distribution properties.

RandomTest::GaussianDistribution Tests Gaussian (normal) random number generation. Generates 10,000 samples with \(\sigma = 2.0\) and verifies: (1) the mean is approximately zero, and (2) the variance is approximately \(\sigma^2 = 4.0\).

RandomTest::SeedReproducibility Tests that seeding the RNG with the same value produces identical sequences. Creates two RNG instances with the same seed and verifies that they generate the same sequence of random numbers, ensuring deterministic behavior.

RandomTest::DifferentSeedsDifferentSequences Tests that different seeds produce different random sequences. Creates two RNG instances with different seeds and verifies that they generate different sequences, confirming proper seed handling.

RandomTest::GaussianStatistics Tests statistical properties of Gaussian distribution with large sample size (100,000 samples). Verifies that the computed mean and standard deviation match the expected values ( \(\mu = 0\), \(\sigma = 1.0\)) within statistical tolerance.