⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kdtreeleafnode.cpp

📁 dysii是一款非常出色的滤波函数库
💻 CPP
字号:
#include "KDTreeLeafNode.hpp"#include <set>using namespace indii::ml::aux;KDTreeLeafNode::KDTreeLeafNode() : x(0), w(0.0) {  //}KDTreeLeafNode::KDTreeLeafNode(const vector& x, const double w) : x(x),    w(w) {  /* pre-condition */  assert (w > 0.0);    //}KDTreeLeafNode::~KDTreeLeafNode() {  //}double KDTreeLeafNode::getWeight() {  return w;}vector& KDTreeLeafNode::getLower() {  return x;}vector& KDTreeLeafNode::getUpper() {  return x;}vector KDTreeLeafNode::nearestTo(const vector& x) {  /* pre-condition */  assert (x.size() == this->x.size());  return this->x;}double KDTreeLeafNode::densityAt(const vector& x, Norm& N, Kernel& K) {  return w * K(N(x - this->x));}vector KDTreeLeafNode::sample(const double u, Norm& N, Kernel& K) {  /* pre-condition */  assert (u >= 0.0 && u <= getWeight());    return x + K.sample() * N.sample(x.size());}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -