//This part of the code is inpired from the Bayesopt Library (cholesky_add_row function). However, the mathematical fundations can be easily retrieved by detailling the equations of the extended L matrix that produces the desired kernel.
{
size_tn=_samples.size();
_kernel.conservativeResize(n,n);
size_tn=_samples.size();
_kernel.conservativeResize(n,n);
for(size_ti=0;i<n;++i){
_kernel(i,n-1)=_kernel_function(_samples[i],_samples[n-1])+((i==n-1)?_noise:0);// noise only on the diagonal