|
Geometry : |
Subject: Re: [geometry] [index] r-tree concerns
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2012-06-24 07:32:26
Adam Wulkiewicz wrote:
W dniu 2012-06-23 12:52, Adam Wulkiewicz napisal(a):
> feverzsj wrote:
> W dniu 2012-06-23 08:13, feverzsj napisal(a):
>> hi, Adam
>> > 1. Should MAX and MIN be compile-time? rtree.v2.01 took run-time
>> MAX and
>> > MIN. It was just a little slower but took more space than the current
>> > one because static size nodes were unable to use (vectors takes more
>> > space). But what are real-life use cases?
>> If there is only slight impact on performance, I think a more dynamic
>> way would be prefered for lib usage.
>> The template <Max Min> can be still present for convenience, e.g.:
>> template<..., int Max = defaultMax, int Min, defaultMin>
>> struct rtree
>> {
>> rtree(..., int max_ = Max, int min_ = Min );
>> };
>
> If someone want to use the most optimized version he should be able to
> use it. So the best thing to do will be providing two interfaces.
> Something you've proposed. Internally it isn't a problem because my
> implementation allows using of various types of nodes. But I don't know
> if it should look the way you've proposed because the user wouldn't know
> which values are used by the rtree. But maby something like this:
>
> rtree<Value, AlgoStaticParams<Max, Min>, UseStatic>
> t(AlgoDynamicParams(max, min));
>
> Or some wrapper
>
> rtree_static<Value, AlgoStaticParams<Max, Min>> t;
> rtree_dynamic<Value, AlgoStaticParams<> >
> t(AlgoDynamicParams(max, min));
>
> The thing is more complicated because there are various creation
> algorithms. Each algorithm may take different compile- and run-time
> parameters. The interface in this case should be carefully designed. It
> would be confusing otherwise. Have to think about this.
Ok, I propose something like this:
rtree<Value, dynamic::rstar<>> t(dynamic::rstar<>(32, 8));
rtree<Value, static::rstar<32, 8>> t; // param default constr.
This will allow to pass a type which may be a mixture of run-time and
compile-time parameters.
Regards,
Adam
Geometry list run by mateusz at loskot.net