Bill Allombert on Tue, 16 Jan 2024 15:18:31 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Bizarre semantic of vecsearch/setsearch
|
- To: Pari Developers Mailing List <pari-dev@pari.math.u-bordeaux.fr>
- Subject: Re: Bizarre semantic of vecsearch/setsearch
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Tue, 16 Jan 2024 15:18:24 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1705414705; c=relaxed/relaxed; bh=CNIDJj9j387jSsVK+fQ03kGep8s0WbNaqLo50z/VZus=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=GTecJQjpph59ZNCVaEGJhtpQDDRk6usJXpdRZuNI6cB5fSTMuBPCHlwMjocJ7QWF9Sv0krKRSZyKOxPtNG6gTFcYVTkfYHfcA9wiX4Wx+ugPgmMkhLMhtUvs6AA3gm8qyTYneOqLcGwabBR87G3ehW7rASr8Bwono0Z2Y3bHq7qiZIM8NuWPSG/qVvsgaNxEAt+pqP/XWfWUN+xAnvK3f/rNC3lapsJDRT1kuVIwH4sWTg/H6qb0HguAGSPmv/lyDKVeS+RZdPQ0kKBUUSnv9kBe7m/S5A21Lscx3tjJiyK7H6nWmiwQaYB4d/UIJoBIYNGgapoJ3pPiRneMl+ujHtFAa210kjE6pAMtsHUvd1Mbpxht++oBLH4n7dWXJ5jaeMEqOCiAZljnifucwUQEBolU74tJv7CItFuoUGoekD9xjVR4v7vaPD78zVw0N3yv+0gORmO+grO+W697qTj/K+4fpg+GzLfGr3uIp8F5UslF/4rq6BpgV7GXywRs5sBNxRpvlm4tUdbRE586xsqA6ESDcGWRx3/zY6wCINVwoTQrkKIvcMord4IkEbJ6ECoX5POJXIuKx94fYpN56lb28xlfFMoNfoUeFwBV9jcdvPkHqQkkuz24m2z9gCUTVMvSFK1OIAy4rJrPYGQ1wUMOycICu9bPtumY54m6L/vsdxs=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1705414705; cv=none; b=321c0LKKhwyrFa5vOoDJU6Ius+5QmukzRODgnzpg4O9Eg6L2JnAh2GBJhKDpCgAA4rQEzhM0G/ZyyqNqgg2GC6ZL8hNS8lnBT/6ev3R8cWwIw+4cHW8HFZYdIZiuDmNs2uwp/S6xEtxBoRT7kk4GMv6wMz+SnNdeumUn2YF/8KbmHpJ3+qi/Il/quviNqCgdw6+B6JVBiW6kGEUZ3SH9npxS+4uXMrsZ0tmk6KIci24rZgUFJ8+eqR1hqRTNhKet6xt7zvuYXX4D3yOLtVSAw+/Oj1CIssgNDN6pW3SSPMiYFpYAZvzcJ5npkUG6Stsu668qr5/eBsNWyJb0r7ghTH3VCCqct+yV1y7bV7EQACFqICtyVCxCzqIobTVhT3xJbKQctdUNIJ0Ykl3hT6P+wz4ZrCxQLGW8jOn/0vA2HLXehuLI8VKPHz8JcWR7BrIk3W83bSMYrkNNuZQdMCFjz0FD87Owns75tJc6Wo43qClF3sEgpOYPE+fJn8XHW4403MIPoKReIswqkRU3M/cIZ82DwLyxkkO8K33NCknkgSH8uujefk2PwO2TnjxNEckOOadXgI9YeCfR9ikj9AsbBIc9+s8dmem31RTmVMUoXyRZiIIDp5g4rSSq/brPLT9Gw8G0aYbRLAsdR06lHmaOO4moYe9TlaDtK/ljGNExwwM=
- Authentication-results: smail; arc=none
- Delivery-date: Tue, 16 Jan 2024 15:18:31 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1705414705; bh=CNIDJj9j387jSsVK+fQ03kGep8s0WbNaqLo50z/VZus=; h=Date:From:To:Subject:References:In-Reply-To:From; b=SgKG4Cf4Up2Zl8V34rO50KwWZzQEeX28UDEsjc0z8jaIE5EVKIEVBKkooJs4KJWAG TG9ovGJXgR6E7gO/N048aECWxHldlAJrtvYr4srA6ACw77M2E+XNT+5kQtw8WZ+YT3 Uv6HxucldC4uF0i67I+tGtDog/sh4XIBFbP+Gio3zGhYhs89t2Ai+FtHHR3px2GcSV yDkdBcLxABNXAGWN78j+laI/STEgUhjwes5fHtWEsZwlS5YOU7YGdn5GAsxi7FLVn3 9RJQnXtsTbR5bQo+2vVA/75DJ4rLs86cHp7l3fd7Ka96q8jOpwyQw5ic2/hZMar82i oFQBa2ApuHcUHL+4LCZXR0tT2ZVRwJ+XA24d5O1BQggK+OfG8FV54odHWyZhORSOb1 ssthlqzQJ1rO7Ijfl8ZHdVBTf6JRGCr3qFeK4sIDRQKBji1T6DKgVeV7ig3yl2V4jY ZvBTuhDuP8SWYVq4VLB/5ifYHIcDfJ1jS9Yc4o4btcBARFLMe1hopURolv9OWuSrVN 4JtXDiCo2hh/AMLClRrv4dAh9G952E1X2qpugIf1wS/aPUveiP8naHejvOfIgueDdS dXKeBKheBh1lUyp5PpOpVaeXSp+JGzG3e3Dp4R6YfhRvjICPXa3Ah0fDTyKzVM6UOQ hAc1wZHSMFLTSQwAS2RWF/zA=
- In-reply-to: <ZaYEb6M0HApbmBb8@login.math.berkeley.edu>
- Mail-followup-to: Pari Developers Mailing List <pari-dev@pari.math.u-bordeaux.fr>
- References: <ZaYEb6M0HApbmBb8@login.math.berkeley.edu>
On Mon, Jan 15, 2024 at 08:22:07PM -0800, Ilya Zakharevich wrote:
> First, setsearch()/vecsearch() are just three flavors of the same function
> (since setsearch() has 2 flavors ;―]). — But the documentation of neither
> of them mentions the other one.
This is an historical mistake.
setsearch should have be defined as returning
setsearch(S,x,0)-setsearch(S,x,1) (with current notation).
instead of having a flag.
We fixed the C interface but not the GP interface:
16- gen_search / vecvecsmall_search: remove flag
the result is now positive if the element is found else -i if element
should be inserted at position i.
Cheers,
Bill.