Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/cxx/include/sparseir/sparseir.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int spir_kernel_get_lambda(const spir_kernel *kernel, double *lambda_out);
* @note For the logistic and regularized bosonic kernels, the domain is
* typically [-1, 1] × [-1, 1] in dimensionless variables.
*/
int spir_kernel_domain(const spir_kernel *k, double *xmin, double *xmax,
int spir_kernel_get_domain(const spir_kernel *k, double *xmin, double *xmax,
double *ymin, double *ymax);

/**
Expand Down
6 changes: 3 additions & 3 deletions backend/cxx/src/cinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ int spir_kernel_get_lambda(const spir_kernel *kernel, double *lambda_out){
}
}

int spir_kernel_domain(const spir_kernel *k, double *xmin, double *xmax,
int spir_kernel_get_domain(const spir_kernel *k, double *xmin, double *xmax,
double *ymin, double *ymax)
{
DEBUG_LOG("spir_kernel_domain called with kernel=" + std::to_string(reinterpret_cast<uintptr_t>(k)));
DEBUG_LOG("spir_kernel_get_domain called with kernel=" + std::to_string(reinterpret_cast<uintptr_t>(k)));
auto impl = get_impl_kernel(k);
if (!impl) {
DEBUG_LOG("Failed to get kernel implementation");
Expand Down Expand Up @@ -122,7 +122,7 @@ int spir_kernel_domain(const spir_kernel *k, double *xmin, double *xmax,

return SPIR_COMPUTATION_SUCCESS;
} catch (const std::exception &e) {
DEBUG_LOG("Exception in spir_kernel_domain: " + std::string(e.what()));
DEBUG_LOG("Exception in spir_kernel_get_domain: " + std::string(e.what()));
return SPIR_INTERNAL_ERROR;
} catch (...) {
return SPIR_INTERNAL_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion backend/cxx/test/cinterface_core.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ TEST_CASE("Kernel Accuracy Tests", "[cinterface]")

// Get domain bounds
double xmin, xmax, ymin, ymax;
int domain_status = spir_kernel_domain(kernel, &xmin, &xmax, &ymin, &ymax);
int domain_status = spir_kernel_get_domain(kernel, &xmin, &xmax, &ymin, &ymax);
REQUIRE(domain_status == SPIR_COMPUTATION_SUCCESS);

// Compare with C++ implementation
Expand Down
6 changes: 3 additions & 3 deletions fortran/_cbinding.inc
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ function c_spir_reg_bose_kernel_new(lambda, status) &
type(c_ptr) :: c_spir_reg_bose_kernel_new
end function

function c_spir_kernel_domain(k, xmin, xmax, ymin, ymax) &
bind(c, name="spir_kernel_domain")
function c_spir_kernel_get_domain(k, xmin, xmax, ymin, ymax) &
bind(c, name="spir_kernel_get_domain")
use iso_c_binding
type(c_ptr), value :: k
type(c_ptr), value :: xmin
type(c_ptr), value :: xmax
type(c_ptr), value :: ymin
type(c_ptr), value :: ymax
integer(c_int) :: c_spir_kernel_domain
integer(c_int) :: c_spir_kernel_get_domain
end function

function c_spir_sve_result_new(k, epsilon, cutoff, lmax, n_gauss, Twork, status) &
Expand Down
2 changes: 1 addition & 1 deletion fortran/_cbinding_public.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public :: c_spir_sve_result_is_assigned
public :: c_spir_logistic_kernel_new
public :: c_spir_reg_bose_kernel_new
public :: c_spir_kernel_domain
public :: c_spir_kernel_get_domain
public :: c_spir_sve_result_new
public :: c_spir_sve_result_get_size
public :: c_spir_sve_result_truncate
Expand Down
2 changes: 1 addition & 1 deletion fortran/test/test_integration.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ subroutine test_case(statistics, case_name)
stop 1
end if

status = c_spir_kernel_domain(k_ptr, c_loc(xmin), c_loc(xmax), c_loc(ymin), c_loc(ymax))
status = c_spir_kernel_get_domain(k_ptr, c_loc(xmin), c_loc(xmax), c_loc(ymin), c_loc(ymax))
if (status /= 0) then
print *, "Error: kernel domain is not assigned"
stop 1
Expand Down
2 changes: 1 addition & 1 deletion python/pylibsparseir/ctypes_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def value(self):
'spir_ir2dlr_dd': ('c_int', ['spir_basis', 'c_int', 'c_int', 'POINTER(c_int)', 'c_int', 'POINTER(c_double)', 'POINTER(c_double)']),
'spir_ir2dlr_zz': ('c_int', ['spir_basis', 'c_int', 'c_int', 'POINTER(c_int)', 'c_int', 'POINTER(c_double_complex)', 'POINTER(c_double_complex)']),
'spir_kernel_clone': ('spir_kernel', ['spir_kernel']),
'spir_kernel_domain': ('c_int', ['spir_kernel', 'POINTER(c_double)', 'POINTER(c_double)', 'POINTER(c_double)', 'POINTER(c_double)']),
'spir_kernel_get_domain': ('c_int', ['spir_kernel', 'POINTER(c_double)', 'POINTER(c_double)', 'POINTER(c_double)', 'POINTER(c_double)']),
'spir_kernel_get_sve_hints_ngauss': ('c_int', ['spir_kernel', 'c_double', 'POINTER(c_int)']),
'spir_kernel_get_sve_hints_nsvals': ('c_int', ['spir_kernel', 'c_double', 'POINTER(c_int)']),
'spir_kernel_get_sve_hints_segments_x': ('c_int', ['spir_kernel', 'c_double', 'POINTER(c_double)', 'POINTER(c_int)']),
Expand Down
4 changes: 2 additions & 2 deletions python/tests/c_api/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_kernel_creation_and_domain(self):
xmax = c_double()
ymin = c_double()
ymax = c_double()
status_val = _lib.spir_kernel_domain(kernel, byref(xmin), byref(xmax),
status_val = _lib.spir_kernel_get_domain(kernel, byref(xmin), byref(xmax),
byref(ymin), byref(ymax))
assert status_val == COMPUTATION_SUCCESS
assert xmin.value == pytest.approx(-1.0)
Expand All @@ -40,7 +40,7 @@ def test_kernel_creation_and_domain(self):
assert status.value == COMPUTATION_SUCCESS
assert kernel is not None

_lib.spir_kernel_domain(kernel, byref(xmin), byref(xmax),
_lib.spir_kernel_get_domain(kernel, byref(xmin), byref(xmax),
byref(ymin), byref(ymax))
assert status_val == COMPUTATION_SUCCESS
assert xmin.value == pytest.approx(-1.0)
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_kernel_creation(self):
xmax = c_double()
ymin = c_double()
ymax = c_double()
_lib.spir_kernel_domain(kernel_log, byref(xmin), byref(xmax), byref(ymin), byref(ymax))
_lib.spir_kernel_get_domain(kernel_log, byref(xmin), byref(xmax), byref(ymin), byref(ymax))
assert xmin.value < xmax.value
assert ymin.value < ymax.value

Expand Down
Loading