.. index:: pair: class; gpr::bo::ScaledEuclideanDistance .. _doxid-classgpr_1_1bo_1_1_scaled_euclidean_distance: class gpr::bo::ScaledEuclideanDistance ====================================== .. toctree:: :hidden: Overview ~~~~~~~~ Squared Euclidean distance with one length scale, or one per coordinate. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ScaledEuclideanDistance { public: // construction :target:`ScaledEuclideanDistance`(Eigen::VectorXd length_scales); :ref:`ScaledEuclideanDistance`(Eigen::VectorXd length_scales, std::vector categorical); // methods template double :ref:`squared`(const Left& left, const Right& right) const; const std::vector& :ref:`categorical`() const; const Eigen::VectorXd& :ref:`lengthScales`() const; }; .. _details-classgpr_1_1bo_1_1_scaled_euclidean_distance: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Squared Euclidean distance with one length scale, or one per coordinate. Construction ------------ .. index:: pair: function; ScaledEuclideanDistance .. _doxid-classgpr_1_1bo_1_1_scaled_euclidean_distance_1ad91e87ffa6d6ebef1a2a6f630d08f4a0: .. ref-code-block:: cpp :class: doxyrest-title-code-block ScaledEuclideanDistance(Eigen::VectorXd length_scales, std::vector categorical) Distance with unordered coordinates. A coordinate whose categorical entry is true holds a label. Two rows are then zero apart on that coordinate when the labels are equal and one length-scale unit apart otherwise, so the term is (a != b) / l^2. That is the squared Euclidean distance of a one-hot encoding up to a factor two in l^2, so a radial kernel of it stays positive definite. categorical has one entry per length scale. Methods ------- .. index:: pair: function; squared .. _doxid-classgpr_1_1bo_1_1_scaled_euclidean_distance_1a442b40850550f611833f8f0728c2f97e: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double squared(const Left& left, const Right& right) const One stored scale applies to every coordinate. Otherwise the count matches the vector. .. index:: pair: function; categorical .. _doxid-classgpr_1_1bo_1_1_scaled_euclidean_distance_1a21f67ef8ac8ae4e23640a52524d8392b: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::vector& categorical() const Unordered-coordinate flags. Empty: every coordinate is ordered. .. index:: pair: function; lengthScales .. _doxid-classgpr_1_1bo_1_1_scaled_euclidean_distance_1a87a5f5b734e4dbca5796a98371e33ea2: .. ref-code-block:: cpp :class: doxyrest-title-code-block const Eigen::VectorXd& lengthScales() const The stored length scales: one, or one per coordinate.