Mathieu Carbou on Sun, 04 Nov 2012 22:21:00 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
sseraching in dynamic list
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: sseraching in dynamic list
- From: Mathieu Carbou <mathieu.carbou@gmail.com>
- Date: Sun, 04 Nov 2012 16:20:51 -0500
- Delivery-date: Sun, 04 Nov 2012 22:21:00 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=LK+JvlvrVdXg/CbZRFCId2IKNNzwM6lSCWUtr9eRPK8=; b=b1RBldHpC+3t2JPIE/2lN2E2CgDiSur00R/IwgwO0PfNJemZZ58+E5jkESc5PhvnM9 WT1WsU90FtAWlmU7YBegdX+uKBlYN8hYVvBd6mJxYeZBlQUycwbK5mRR6kJQA46yOg6o O+VBqGXRzK0n0wetsPVFXHP1+GcOtwCKieZQIHQi4ksngX6nAA8KfoCJqisGp8k0DcF6 0Qhjk3lEUpvqxbBGbNh9026RICkeaAVL64AMdEwJl9Nd5XodECOwQSSgyb10r+Pf4EU0 FvrvViqx5XRe0PHQKo5sGm04CZvvVzWRG+OfqZ2foWt3/tzk5w6P1ILAqCSvEUw6tvJL 2cBQ==
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
Hello,
I have a case where I need to put key-value items in a dynamic sorted
list and then search into:
l=List()
listput([2,4])
listput([1,7])
listput([0,3])
listsort(l)
setsearch(l, ...)
The issue is that only vecsearch takes a cmpf function, not setsearch.
Is it possible to add it, or to indicate me a better way to do this ?
Actually I'd like to simulate a HashMap, where the key is unique and the
value can be anything. In my case, the sorting is not necessary, but
since PARI has no Map, I think I need to use the sort feature of lists
to be able to search back in them.
Thank you.
--
Mathieu Carbou
Cell: 514-660-4287