norm.hpp

来自「dysii是一款非常出色的滤波函数库」· HPP 代码 · 共 45 行

HPP
45
字号
#ifndef INDII_ML_AUX_NORM_HPP#define INDII_ML_AUX_NORM_HPP#include "vector.hpp"namespace indii {  namespace ml {    namespace aux {/** * Vector norm. * * @author Lawrence Murray <lawrence@indii.org> * @version $Rev: 404 $ * @date $Date: 2008-03-05 14:52:55 +0000 (Wed, 05 Mar 2008) $ */class Norm {public:  /**   * Evaluate the norm.   *   * @param x \f$\mathbf{x}\f$; a vector.   *   * @return \f$\|\mathbf{x}\|\f$; the norm of the vector.   */  virtual double operator()(const vector& x) const = 0;    /**   * Generate a random unit vector from a uniform distribution over the   * unit vectors in the normed vector space.   *   * @param N Dimensionality of the normed vector space.   *   * @return Random unit vector of length N.   */  virtual vector sample(const unsigned int N) const = 0;  };    }  }}#endif

⌨️ 快捷键说明

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