American Citizen on Mon, 12 May 2025 05:39:44 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
question on compare functions for the vecsort command
|
- To: pari-users <pari-users@pari.math.u-bordeaux.fr>
- Subject: question on compare functions for the vecsort command
- From: American Citizen <website.reader3@gmail.com>
- Date: Sun, 11 May 2025 20:39:38 -0700
- Delivery-date: Mon, 12 May 2025 05:39:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747021180; x=1747625980; darn=pari.math.u-bordeaux.fr; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=lxrNuJQulK2krYpFuZjnAJz0AHbAyQlx5pJ+Rs9uugA=; b=njD1psfPWa1pDl3Ko1KCy2QJL+1ycTP2V3zzb3b3aik7eChoanr9bnrpyMblVyDIDt DqGUqZVAtpl6U4bHSBJn6WJj+6bS3Yle0BDNA/0BsUOX+DD0ECZGR9EVxmeXE2gUrlEP xVdiAe1sSlzGD6mC6mqo/SlSBGwvoVUuBXXgWcdwVB6AsujhBb/XmW7mbG1NFraGlfzW MtHwtNEFseg1WrRqEUFblv1YVwhGA7XIsk+r3+r9/DxNbOpPv5aWilw5blNAl3kmSoFk lS11gPUAfdJDBJXQIUCyC9BG7Wp+/lZFMc/8Z7XPqLWXSw9QZSvM9Z9o81aLFN8l41/h eGyw==
- User-agent: Mozilla Thunderbird
Hello:
Suppose we have a small vector composed of 4 component vectors, say
V = [ [1,7,5,2], [3,7,1,4], [2,0,6,9], [8,0,5,1], etc...]
What is the compare function for vecsort(V, compare_function, flag) so
that I can
1. sort the 2nd column by ascending size, then sort the 3rd column by
descending size?
2. add the 3rd column to the 4th column, if the 2nd column > 1st column?
I am trying to better understand how to compose the compare functions
for this command.
Randall