📜  pari - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:57.400000             🧑  作者: Mango

代码示例1
#include 
GEN test(void);

GEN
test(void)
{
  GEN A = cgetg(4, t_MAT);
  gel(A, 1) = cgetg(4, t_COL);
  gel(A, 2) = cgetg(4, t_COL);
  gel(A, 3) = cgetg(4, t_COL);
  /* Create matrix A */

  gcoeff(A, 1, 1) = gen_1;
  gcoeff(A, 1, 2) = gen_2;
  gcoeff(A, 1, 3) = stoi(3);
  gcoeff(A, 2, 1) = stoi(4);
  gcoeff(A, 2, 2) = stoi(5);
  gcoeff(A, 2, 3) = stoi(6);
  gcoeff(A, 3, 1) = stoi(7);
  gcoeff(A, 3, 2) = stoi(8);
  gcoeff(A, 3, 3) = stoi(9);
  /* Fill matrix A with values */

  return gpowgs(A, 1000); /* Return A^1000 */
}