Changeset 7faafd4e in tol


Ignore:
Timestamp:
Nov 8, 2009, 8:00:04 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
ae1ad556
Parents:
55230c9
Message:

commentaries

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1647 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_pkg/GisTools/test/test_0001/test.tol

    r55230c9 r7faafd4e  
    2020#Embed "../../_GisTools.tol";
    2121
    22 //Test for SelectRowsInHyperCube
     22//The order of magnitude required for number of geographic points
    2323Real point.num.approx = 20000;
    24 
     24//Number of cities
    2525Real city.num = 500;
     26//Distance around targets
    2627Real distance = 2000;
     28//Factor of Country size respect dtarget distance
    2729Real coordFactor = 400;
     30//Distance of points inside a city
    2831Real cityInsideDistance = distance / 4;
    2932
     33//Country dimensions
    3034Real coord.min = -distance*coordFactor;
    3135Real coord.max = +distance*coordFactor;
    3236
    33 
     37//Log-Normal random generation of number of point by city
    3438Matrix city.points =
    3539{
    … …  
    3943  Round(Exp(Gaussian(city.num,1,nu,0.99995)))
    4044};
    41 
    4245Matrix city.points.freq = Frequency(city.points,100);
    4346
     47//Exact number of geographic points
    4448Real point.num = MatSum(city.points);
    4549
     50//Locations of cities
    4651Matrix city.center = BinGroup("<<",For(1,city.num, Matrix(Real city)
    4752{
    … …  
    4954}));
    5055
     56//Locations of points inside each city as gaussian around the center
    5157Set city.points = For(1,city.num, Matrix(Real city)
    5258{
    … …  
    5965});
    6066
     67//All points
    6168Matrix points = BinGroup("<<",city.points);
    6269
     70//Target point
    6371Matrix p0 = SubRow(points,[[IntRand(1,point.num)]])+
    6472           Gaussian(1, 2, 0, cityInsideDistance);
    6573
    6674Real t0 = Copy(Time);
     75//Selecting neighbors of target in an hipercube
    6776WriteLn("SelectRowsInHyperCube full ...");
    6877Set p0.select.idx.HC = GisTools::SelectRowsInHyperCube(
    … …  
    7382  "Time:"<<(t1-t0));
    7483
     84//Selecting neighbors of target in an hipersphere
    7585WriteLn("SelectRowsInHyperSphere full ...");
    7686Set p0.select.idx.HE.1 = GisTools::SelectRowsInHyperSphere(
    … …  
    8191  "Time:"<<(t2-t1));
    8292
     93//Selecting neighbors of target in an hipersphere from the hipercube
    8394WriteLn("SelectRowsInHyperSphere over SelectRowsInHyperCube ...");
    8495Set p0.select.idx.HE.2 = GisTools::SelectRowsInHyperSphere(
Note: See TracChangeset for help on using the changeset viewer.