Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.2 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Elementary Functions > Discrete mathematics > gcd

gcd

最大公約数を計算

呼び出し手順

[pgcd,U]=gcd(p)

引数

p

多項式行ベクトル p=[p1,..,pn] または整数行ベクトル (8型)

説明

[pgcd, U] = gcd(p)は, pの要素の最大公約数(pgcd) および以下のような最小次数の (多項式の逆を有する)ユニモジュラ行列 U を計算します.

p*U=[0 ... 0 pgcd]

数学的には,ユニモジュラ 行列 U は, 行列式 +1 or -1を有する 正方整数行列です.

実数配列pの最大公約数は, gcdをコールする前に, p = inv_coeff(p, 0)により 多項式に変換することにより得られます.

//多項式の場合
s=poly(0,'s');
p=[s,s*(s+1)^2,2*s^2+s^3];
[pgcd,u]=gcd(p);
p*u
//整数の場合
V=int32([2^2*3^5, 2^3*3^2,2^2*3^4*5]);
[thegcd,U]=gcd(V)
V*U
gcd([15 20])
gcd(uint8([15 20]))
gcd([iconvert(15,4) iconvert(20,4)])
gcd(iconvert([15 20],4))

参照

  • bezout — 多項式またh整数のべズー方程式
  • lcm — 最小公倍数
  • hermit — エルミート形式
Report an issue
<< factorial Discrete mathematics lcm >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Apr 01 10:24:59 CEST 2015