Jacques Gélinas on Fri, 15 Nov 2019 18:55:20 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: List of polynomial coefficients in GP
|
- To: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Subject: Re: List of polynomial coefficients in GP
- From: Jacques Gélinas <jacquesg00@hotmail.com>
- Date: Fri, 15 Nov 2019 17:55:15 +0000
- Accept-language: fr-CA, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iPL53Igw3lvCTgpu9IEUTVE/blBP/k7BYjMFg5Jjh8Y=; b=KWi2lXBRoGA8TqvTgpbzHU40uoxSJ8EYcGUqZUxyGaIwYW4TNmYE/RoXjP/nXfQTPF0QeRB4OlL++xIGnz4Egk/sTLULoFal94BjAURx8j3Mn0y1kmgylTDD8Iz9E1spVrriowGd5+ETz8hMLU9rbTs2x6RaTcbdhM9YdW9X9BU1yGZdMZdrIm5INEUXUETSIyYR8BjEHjAo3tkP8LOQBlWJMokecXyAaMsPh8Ks31Y/vZJoMBRaAhL08BjZkTAsHW6EYNiDWaYj5VfHXNa8qYxobZjf42w6tQ6NevG/H7CXw77otwGhgYv+jaPMj8Vr79ydDvlGNhsDnBmVzRaZpQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LO8RNJhdjIfxflYuDe4J9G0x5h1+ssiXtF0yS2aEKOE8o2p7foPyG1F9dlYkxKHc2zIOoDhMLjAtRm4ZpEDYysDWFpJkgULjXUfWNUNzrCcwLxQ24iV9dkqgQ9fPGqzTrQMA6ES1J6KlHSedXiWoPqMUOveRMo7vE9cSW7feKXoet8a+cV1oUh9L4VZXi4g2QNYw3SjPNXw9oWyzALekXSqPN6//lMWBo4NBHQbcB/5IrnHEBLslfeMMdqrJgfx/nUlbO6sUIQ3/EDgir7ql4fH0tGHQTMJbvj2iUrUofbp99H5n0S6DyKnQp3WlwvXfzNfwXSmuq9Vi0GNM4JRaSw==
- Delivery-date: Fri, 15 Nov 2019 18:55:20 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iPL53Igw3lvCTgpu9IEUTVE/blBP/k7BYjMFg5Jjh8Y=; b=i9KUGR9E6+uA9ESxjwdh4abcefz1WUStR/VvL9XsHL9rQt17L7uk7G2XPQeetnWCsWpMZMKJ1F6LDVs5gmKGG8vVKZAFBcK844pGLZBJZR8QfNeCQnf41RQK+ecXPQe1Pwiz0tMnFM9IlsemhzWh6d0cuIr+kg6DZgmdbpmIP38qcH0T0hTI8uKGmXKRW5lwtc30xxkALi4LG6z+EmqlE+wD885OGiqN/P/G28OxC+jSy8icVJqlpe0Gq5zPJDey2A1FZLzcqPMDiJ/vHgDpTJYNWgW6l61G36PZh+DdyFt8kU9jQqyRUt5oNDw2B8HdfCGdcFhYh3QZ2025YBhl5Q==
- In-reply-to: <20191115171328.m7z2d5u6sgyqjgv4@yellowpig>
- References: <YQXPR0101MB08851FBAEE6A1C27CF5DAD1BD2700@YQXPR0101MB0885.CANPRD01.PROD.OUTLOOK.COM>,<20191115171328.m7z2d5u6sgyqjgv4@yellowpig>
- Thread-index: AQHVm8u+qiX69QQSuE63t/GJ8PuW76eMeGcAgAAGvto=
- Thread-topic: List of polynomial coefficients in GP
>(Bill Allombert) Fundamentally this is a bug in subst:
Looks like a feature of Vec, which simplifies its input, and I would not want to change that.
Vec(Pol(subst(1*u+2*P-6,u,x+3))) == [1, 2*P - 3]
Vec(Pol(subst(0*u+2*P-6,u,x+3))) == [2, -6]
I need a "cofs" function accessing directly the internal polynomial structure.
How easy is it to modify polcoef to return a vector instead of an error message ?
polcoef(Pol(subst(0*u+2*P-6,u,x+3),x),,x)
*** missing mandatory argument: ...ubst(0*u+2*P-6,u,x+3),x),,x)
What about "polcoef(...,oo,x)" as a request for the vector of all coefficients ?
Jacques Gélinas
De : Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
Envoyé : 15 novembre 2019 12:13
À : pari-users@pari.math.u-bordeaux.fr <pari-users@pari.math.u-bordeaux.fr>
Objet : Re: List of polynomial coefficients in GP
On Fri, Nov 15, 2019 at 03:51:54PM +0000, Jacques Gélinas wrote:
> Is there a direct way to get the list of coefficients of a polynomial in GP ?
> Consider for example a polynomial with parameter P (representing Pi) in its coefficients:
> Vec(subst(1*u+2*P-6,u,x+3)) == [1, 2*P - 3]
> is what I want, but this fails in
> Vec(subst(0*u+2*P-6,u,x+3)) == [2, -6]
Fundamentally this is a bug in subst:
? type(subst('u^0,u,x))
%1 = "t_INT"
it would be better to return a t_POL.
I do not know whether this is easy to fix.
Cheers,
Bill