|
Boost-Commit : |
From: chintanraoh_at_[hidden]
Date: 2008-08-13 11:44:06
Author: chintanraoh
Date: 2008-08-13 11:44:06 EDT (Wed, 13 Aug 2008)
New Revision: 48127
URL: http://svn.boost.org/trac/boost/changeset/48127
Log:
new example 3d-points-colour.cpp
Added:
sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/example/3d-points-colour.cpp (contents, props changed)
Added: sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/example/3d-points-colour.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/example/3d-points-colour.cpp 2008-08-13 11:44:06 EDT (Wed, 13 Aug 2008)
@@ -0,0 +1,38 @@
+#include<boost/dsearch/patricia.hpp>
+#include<boost/dsearch/pat_key_traits.hpp>
+#include<iostream>
+#include<vector>
+
+using boost::dsearch::patricia;
+using boost::dsearch::pat_vector_traits;
+
+class colour{
+ public:
+ int R,B,G;
+ colour() : R(0), B(0) ,G(0)
+ {
+ }
+};
+
+int main(int argc, char** argv)
+{
+ typedef patricia<std::vector<int>, colour, pat_vector_traits<int> > pat_type;
+ std::vector<int> coord(3);
+ pat_type colour_cube;
+ colour col;
+
+ for(int i=0;i<256;i++)
+ {
+ coord[0]=col.R = i;
+ for(int j=0;j<256;j++)
+ {
+ coord[1]=col.B = j;
+ for(int k=0;k<256;k++)
+ {
+ coord[2]=col.G = k;
+ colour_cube[coord]=col;
+ }
+ }
+ }
+ return 0;
+}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk