Jacques Gélinas on Fri, 15 Nov 2019 16:52:00 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
List of polynomial coefficients in GP
|
- To: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Subject: List of polynomial coefficients in GP
- From: Jacques Gélinas <jacquesg00@hotmail.com>
- Date: Fri, 15 Nov 2019 15:51:54 +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=nASipxSboP1aNC0JDTmQ/I0P3bJhUyy5LdajZETZZRc=; b=h+DqxJG5edi3/tJRfbJ9mde3332uLOrXPf1t0RmcrjQtXOjeOAMsBlIZXF72BaFff7Y+RGrzDg2m5t3OemaAuLEvw8NoJ6VL9iVji7mR9dNJwN03h2cjKDIUPE6xXBNNYEd6884cG2iLhLoltbMdFon20XwoED48/zVc/Hr/3SFV9SyCQSukKc7/1Xuqq4I7ZL/B0a5QRUYUCK+2dLLaEwx+hA14x1WpOOv6e7M3+qNFwAyTEuBGQiCIDUaZ7V+eEwmtEQpsdH2SAfc4VUot8hY39gsKdDr7AzCj9N40IKjKkoMNNnfMo9cOgelArAXSqsK6jmV7N4rLLp12LxiW0Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jsFTTmkIM1VBAT0FVpqlzcbItoo7QIzbc65Lyg0aKkgML2rjtEIbwwr0a+QEBSpRr4m8TAjbh6FPEpY2vHo2CFZNWNmAjHe7UF+i2R6zG2WGkZPjhtcBuFAzqprmX/zr5hcc1mPpcZlFDTCba+wLFxGNyHp/WQtY45zFBR/CgfV32nYo0EhwVcfX18YPQxXlITfG3uRN4kPemMDk+4+aUxEqPFHys3Vw28vMrXqSdZQQYoGWJ5n6Ou9W+sGeJ4I+eHhXBCNvJRxKDcFG2WuA2NVC2umamvJyDjRxho8C3MnJtufJN+Lf/d0unXmlHzre+dFRpbWjdf6o0Ts/ECLTkg==
- Delivery-date: Fri, 15 Nov 2019 16:52:00 +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=nASipxSboP1aNC0JDTmQ/I0P3bJhUyy5LdajZETZZRc=; b=LLnmE0RLoctDIihEXfdb8ggB1G8c9UJnl40g0Hvq8nk0L/g/OqKqMkW30+mWXMeESWRH3hyuKO/QFhmyE+Ggkd6c1NFJm6QboJ1a1VTfAAPDkPKBa48NIJ1ns9pNw4g320SMo6uI0pERLYo1EXirF7lxSXKhAcmfLPfBNytbrXnKnA7LazZjhYraYgId4EOf4cujUjEXdt2yu0up0VNMU1NvUD4sr8I9rOS9HpRuRO0KEGgTYNJFKXDAvFKLhFVdrH+XDBg5EibhOMefJL2T+xp4KHQGe7KT2OsKaYzy42u9oW7D5zRwa/rdOKE2pFPkkI/mGjQkVPFg3VcBOGRiZQ==
- Thread-index: AQHVm8u+qiX69QQSuE63t/GJ8PuW7w==
- Thread-topic: List of polynomial coefficients in GP
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]
so I must use
cofs(p,v='x) = vector(1+max(0,poldegree(p,v)),k,polcoeff(p,k-1,v));
to get
cofs(subst(0*u+2*P-6,u,x+3),u) == [2*P - 6]
Any suggestions for a simpler solution ?
Jacques Gélinas