35 #ifndef SHARK_MODELS_KERNELS_DISCRETEKERNEL_H 36 #define SHARK_MODELS_KERNELS_DISCRETEKERNEL_H 65 SHARK_RUNTIME_CHECK(matrix.size1() == matrix.size2(),
"[DiscreteKernel::DiscreteKernel] kernel matrix must be square");
67 for (std::size_t i=0; i<matrix.size1(); i++)
69 for (std::size_t j=0; j<i; j++)
71 SHARK_RUNTIME_CHECK(matrix(i, j) == matrix(j, i),
"[DiscreteKernel::DiscreteKernel] kernel matrix must be symmetric");
79 {
return "DiscreteKernel"; }
102 return boost::shared_ptr<State>(
new EmptyState());
117 eval(batchX1,batchX2,result);
125 ensure_size(result,sizeX1,sizeX2);
126 for(std::size_t i = 0; i != sizeX1; ++i)
127 for(std::size_t j = 0; j != sizeX2; ++j)