13 using namespace Eigen;
19 s <<
"KernelExpansion centers: " << k.
centers.rows() <<
" x " << k.
centers.cols();
20 s <<
", " <<
"coeffs: " << k.
coeffs.rows() <<
" x " << k.
coeffs.cols();
21 s <<
", kernel: " <<
typeid(k.
kernel).name() <<
": " << *k.
kernel;
26 KernelExpansion.KernelExpansion() :
27 coeffs(MatrixXd(0, 0)), centers(MatrixXd(0, 0)), kernel(0) {
36 if (
centers.rows() != points.rows()) {
37 cerr <<
"Argument dimension mismatch. Center dimension:"
38 <<
centers.rows() <<
" vs argument dimension: " << points.rows()
44 cout <<
"evaluating kexp.. " << endl <<
"centers: " <<
centers << endl
45 <<
"points: " << points << endl;
51 cout <<
"done eval kexp. kernel vector: " << kvec <<
", coeffs: " <<
coeffs << endl;
62 switch ((
int) kdata(0)) {
70 cerr <<
"Unknown kernel data: " << kdata << endl;
77 cout <<
"done loading centers: " << res.
centers << endl;
83 cout <<
"done loading coeffs: " << res.
coeffs << endl;
MatrixXd evaluate(MatrixXd x, MatrixXd y)
MatrixXd evaluate(MatrixXd points)
static MatrixXd loadMatrix(string file)
static VectorXd loadVector(string file)
static KernelExpansion * loadFrom(string dir)
ostream & operator<<(ostream &s, const KernelExpansion &k)
virtual ~KernelExpansion()