Changes in src/VectorSet.hpp [014475:cb16fe]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/VectorSet.hpp
r014475 rcb16fe 12 12 #include <functional> 13 13 #include <algorithm> 14 #include <limits>15 14 16 15 /** … … 20 19 */ 21 20 22 #include "vector.hpp" 23 #include <list> 21 class Vector; 24 22 25 23 // this tests, whether we actually have a Vector … … 50 48 void translate(const Vector &translater){ 51 49 // this is needed to allow template lookup 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()); 50 transform(this->begin(),this->end(),this->begin(),bind1st(plus<Vector>(),translater)); 64 51 } 65 52 }; 66 53 67 // allows simpler definition of VectorSets68 #define VECTORSET(container_type) VectorSet<container_type<Vector> >69 70 54 #endif /* VECTORSET_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.