Template Function libwalrus::do_chunk¶
Defined in File eigenvalue_hafnian.hpp
Function Documentation¶
-
template<typename
T
>
Tlibwalrus
::
do_chunk
(std::vector<T> &mat, int n, unsigned long long int X, unsigned long long int chunksize)¶ Calculates the partial sum \(X,X+1,\dots,X+\text{chunksize}\) using the Cygan and Pilipczuk formula for the hafnian of matrix
mat
.Note that if
X=0
andchunksize=pow(2.0, n/2)
, then the full hafnian is calculated.This function uses OpenMP (if available) to parallelize the reduction.
- Return
the partial sum for hafnian
- Parameters
mat
: vector representing the flattened matrixn
: size of the matrixX
: initial index of the partial sumchunksize
: length of the partial sum
libwalrus_cpp_api/function_namespacelibwalrus_1a34d3ad964fbce00b9197d2ade70baaca
Download Python script
Download Notebook
View on GitHub
Contents
Downloads