American Citizen on Fri, 03 Nov 2023 00:28:11 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
asking for a new GP-Pari command
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: asking for a new GP-Pari command
- From: American Citizen <website.reader3@gmail.com>
- Date: Thu, 2 Nov 2023 16:28:04 -0700
- Delivery-date: Fri, 03 Nov 2023 00:28:11 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698967687; x=1699572487; 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=7eyRy5ZhiYXJIZE3acWgi9m5oF9SGX6y3RL+iNtw658=; b=PetfmnvuE/HGfrni3eGexSv3z7qMsZJaVxKPuNFPto31Wp6hor1DJJLFTrp9thQoeh w5p4swCqVFYyJsui3GDc76hjTKbLOOXwvX/qw3+B8f6vAYn4y0W8aHR3jdJM3qfMyOud Nx2dYdD5bqhMkeXv0h/fIyuzx66joorYTBF8+wJCshHwM9+wW6JHmm/ylSd5hD0UBYmE ebbQ/hfbhOjbDSnDfJqdPYNF7Pu2EMsb8OH3TgqT+TS+cyM+PjdO/FSqTd1Xz810jQ9x ZyciPRhvxHiXeF7cErrYNI4nJCNkR8Eeq74PRVPVY+DIYZWz7oEktpB14VG/uUQLLN6k 8dVQ==
- User-agent: Mozilla Thunderbird
To all:
Recently I had to remove duplicate entries from a vector.
Can GP-Pari create a command which will work with both lists and vectors
to output duplicate entries?
I am aware that vecsort has flag=8 in vecsort(V,,8) and listsort has
flag = 1 in listsort(L,1) to remove duplicates, but I need to find them,
not erase them.
Suppose v = [1,2,3,4,5,3,6]
Then I would like a GP-Pari command called "duplicates(v)" to produce
the following output.
duplicates(v) = [3]
I tried the naive approach of
% u = Set(v);
%usz = matsize(u)[2];
%vsz = matsize(v)[2];
% if ( usz != vsz, {do work to find the duplicate entries in the object} );
This would be a great help since my current approach is quite cumbersome.
Randall