indii/ml/aux/Norm.hpp

00001 #ifndef INDII_ML_AUX_NORM_HPP
00002 #define INDII_ML_AUX_NORM_HPP
00003 
00004 #include "vector.hpp"
00005 
00006 #include "boost/serialization/serialization.hpp"
00007 
00008 namespace indii {
00009   namespace ml {
00010     namespace aux {
00011 /**
00012  * Vector norm.
00013  *
00014  * @author Lawrence Murray <lawrence@indii.org>
00015  * @version $Rev: 420 $
00016  * @date $Date: 2008-04-03 20:56:55 +0100 (Thu, 03 Apr 2008) $
00017  *
00018  * @section Serialization
00019  *
00020  * This class supports serialization through the Boost.Serialization
00021  * library.
00022  */
00023 class Norm {
00024 public:
00025   /**
00026    * Destructor.
00027    */
00028   virtual ~Norm();
00029 
00030   /**
00031    * Evaluate the norm.
00032    *
00033    * @param x \f$\mathbf{x}\f$; a vector.
00034    *
00035    * @return \f$\|\mathbf{x}\|\f$; the norm of the vector.
00036    */
00037   virtual double operator()(const vector& x) const = 0;
00038   
00039   /**
00040    * Generate a random unit vector from a uniform distribution over the
00041    * unit vectors in the normed vector space.
00042    *
00043    * @param N Dimensionality of the normed vector space.
00044    *
00045    * @return Random unit vector of length N.
00046    */
00047   virtual vector sample(const unsigned int N) const = 0;
00048 
00049 private:
00050   /**
00051    * Serialize.
00052    */
00053   template<class Archive>
00054   void serialize(Archive& ar, const unsigned int version);
00055 
00056   /*
00057    * Boost.Serialization requirements.
00058    */
00059   friend class boost::serialization::access;
00060 
00061 };
00062 
00063     }
00064   }
00065 }
00066 
00067 template<class Archive>
00068 void indii::ml::aux::Norm::serialize(Archive& ar,
00069     const unsigned int version) {  
00070   //
00071 }
00072 
00073 #endif
00074 

Generated on Wed Dec 17 15:11:57 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3