Changeset 7faafd4e in tol
- Timestamp:
- Nov 8, 2009, 8:00:04 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- ae1ad556
- Parents:
- 55230c9
- File:
-
- 1 edited
-
tol_pkg/GisTools/test/test_0001/test.tol (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol_pkg/GisTools/test/test_0001/test.tol
r55230c9 r7faafd4e 20 20 #Embed "../../_GisTools.tol"; 21 21 22 //T est for SelectRowsInHyperCube22 //The order of magnitude required for number of geographic points 23 23 Real point.num.approx = 20000; 24 24 //Number of cities 25 25 Real city.num = 500; 26 //Distance around targets 26 27 Real distance = 2000; 28 //Factor of Country size respect dtarget distance 27 29 Real coordFactor = 400; 30 //Distance of points inside a city 28 31 Real cityInsideDistance = distance / 4; 29 32 33 //Country dimensions 30 34 Real coord.min = -distance*coordFactor; 31 35 Real coord.max = +distance*coordFactor; 32 36 33 37 //Log-Normal random generation of number of point by city 34 38 Matrix city.points = 35 39 { … … 39 43 Round(Exp(Gaussian(city.num,1,nu,0.99995))) 40 44 }; 41 42 45 Matrix city.points.freq = Frequency(city.points,100); 43 46 47 //Exact number of geographic points 44 48 Real point.num = MatSum(city.points); 45 49 50 //Locations of cities 46 51 Matrix city.center = BinGroup("<<",For(1,city.num, Matrix(Real city) 47 52 { … … 49 54 })); 50 55 56 //Locations of points inside each city as gaussian around the center 51 57 Set city.points = For(1,city.num, Matrix(Real city) 52 58 { … … 59 65 }); 60 66 67 //All points 61 68 Matrix points = BinGroup("<<",city.points); 62 69 70 //Target point 63 71 Matrix p0 = SubRow(points,[[IntRand(1,point.num)]])+ 64 72 Gaussian(1, 2, 0, cityInsideDistance); 65 73 66 74 Real t0 = Copy(Time); 75 //Selecting neighbors of target in an hipercube 67 76 WriteLn("SelectRowsInHyperCube full ..."); 68 77 Set p0.select.idx.HC = GisTools::SelectRowsInHyperCube( … … 73 82 "Time:"<<(t1-t0)); 74 83 84 //Selecting neighbors of target in an hipersphere 75 85 WriteLn("SelectRowsInHyperSphere full ..."); 76 86 Set p0.select.idx.HE.1 = GisTools::SelectRowsInHyperSphere( … … 81 91 "Time:"<<(t2-t1)); 82 92 93 //Selecting neighbors of target in an hipersphere from the hipercube 83 94 WriteLn("SelectRowsInHyperSphere over SelectRowsInHyperCube ..."); 84 95 Set p0.select.idx.HE.2 = GisTools::SelectRowsInHyperSphere(
Note: See TracChangeset
for help on using the changeset viewer.
