Changes in src/VectorSet.hpp [cb16fe:014475]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/VectorSet.hpp
rcb16fe r014475 12 12 #include <functional> 13 13 #include <algorithm> 14 #include <limits> 14 15 15 16 /** … … 19 20 */ 20 21 21 class Vector; 22 #include "vector.hpp" 23 #include <list> 22 24 23 25 // this tests, whether we actually have a Vector … … 48 50 void translate(const Vector &translater){ 49 51 // this is needed to allow template lookup 50 transform(this->begin(),this->end(),this->begin(),bind1st(plus<Vector>(),translater)); 52 transform(this->begin(),this->end(),this->begin(),std::bind1st(std::plus<Vector>(),translater)); 53 } 54 55 double minDistSquared(const Vector &point){ 56 if(!this->size()) 57 return std::numeric_limits<double>::infinity(); 58 std::list<double> helper; 59 helper.resize(this->size()); 60 transform(this->begin(),this->end(), 61 helper.begin(), 62 std::bind2nd(std::mem_fun_ref(&Vector::DistanceSquared),point)); 63 return *min_element(helper.begin(),helper.end()); 51 64 } 52 65 }; 53 66 67 // allows simpler definition of VectorSets 68 #define VECTORSET(container_type) VectorSet<container_type<Vector> > 69 54 70 #endif /* VECTORSET_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.