Message info
 
To:fricas-devel@googlegroups.com From:Serge D. Mechveliani Subject:Re: [fricas-devel] search table Date:Sun, 18 Mar 2012 19:57:24 +0400
 

On Sat, Mar 17, 2012 at 10:00:16PM +0100, Ralf Hemmecke wrote:
>> I need Appropriate_Table(key : Integer, entry : ConstructedDomain)
>>
>> for a fast search/insert of O(log(card table)),
>>
>> Also ConstructedDomain has `Any' inside it, and it would be better
>> to avoid SetCategory for ConstructedDomain.
>>
>> If this is difficult to organize, it would remain to try Array.
>
> Workaround:
>
> Turn ConstructedDomain into something of type SetCategory. You basically
> only have to provide
>
> ((x: %) = (y: %)): Boolean == false
> coerce(x: %): OutputForm == "<unprintable>" :: OutputForm
>
> Since you are probably never going to use those faked implementations,
> it would be the easiest workaround. But look also into the respective
> implementation of HashTable. Of course, you shouldn't call function from
> HashTable that rely on "Entry" being of type "SetCategory". But these
> are only a few. (I haven't actually checked. Coercion to OutputForm
> should be OK. It's just that the output is pretty useless.)
>
> Personally, I tend to agree that there should be a hashtable that does
> not impose SetCategory on its second argument. Of course, one cannot
> output such a table, but maybe the user doesn't want output anyway.
>

I see. Thank you. The workaround looks all right.
But what will be cost of search/insert for this
HashTable(Integer, ConstructedDomain, ?) ?
Regards,

------
Sergei
mechvel@botik.ru

--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To post to this group, send email to fricas-devel@googlegroups.com.
To unsubscribe from this group, send email to fricas-devel+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.