This PR started with a small improvement (replace first + Iterators.drop with Iterators.peel) but lead to some more changes in the end :smile: So taken together, this PR
replaces first + Iterators.drop with Iterators.peel
reduces allocations in kernelmatrix! and kernelmatrix_diag! functions of KernelTensorProduct for > 2 kernels (allocations are the same for 2 kernels and are increased for 1 kernel, but in the latter case one should not construct a KernelTensorProduct in the first place)
adds a missing definition of the binary kernelmatrix_diag! for KernelTensorProduct and a test for it to test_interface
adds a missing definition of the binary kernelmatrix_diag! for ScaledKernel (a quick check revealed it was missing, maybe more kernels have to be fixed for tests to pass)
This PR started with a small improvement (replace
first
+Iterators.drop
withIterators.peel
) but lead to some more changes in the end :smile: So taken together, this PRfirst
+Iterators.drop
withIterators.peel
kernelmatrix!
andkernelmatrix_diag!
functions ofKernelTensorProduct
for > 2 kernels (allocations are the same for 2 kernels and are increased for 1 kernel, but in the latter case one should not construct aKernelTensorProduct
in the first place)kernelmatrix_diag!
forKernelTensorProduct
and a test for it totest_interface
kernelmatrix_diag!
forScaledKernel
(a quick check revealed it was missing, maybe more kernels have to be fixed for tests to pass)