MeshKit
1.0
|
00001 // IAWeights.hpp 00002 // Interval Assignment for Meshkit 00003 // 00004 // Weights or coefficients of 00005 // 00006 // Tools for making them unique. 00007 00008 #ifndef MESHKIT_IA_IAWEIGHTS_HP 00009 #define MESHKIT_IA_IAWEIGHTS_HP 00010 00011 #include <vector> 00012 00013 namespace MeshKit { 00014 00015 class IAWeights : public std::vector<double> 00016 { 00017 00018 public: 00020 IAWeights(); 00021 00023 virtual ~IAWeights(); 00024 00025 // data 00026 00027 // debug 00028 const bool debugging; 00029 00030 // algorithms 00031 00032 // return a number between -1 and 1, but not close to zero 00033 // generate double in [-1,-0.5] U [.5,1] 00034 static double rand_excluded_middle(); 00035 00036 // rescale and randomize so fabs of weights are in [lo, hi], 00037 // and different from each other 00038 void uniquify(const double lo, const double hi); 00039 00040 // debug 00041 void print() const; 00042 00043 }; 00044 00045 } // namespace MeshKit 00046 00047 #endif