Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
LinearAlgebra[RandomMatrix] - ランダム行列の作成
LinearAlgebra[RandomVector] - ランダムベクトルの作成
使い方
RandomMatrix(r, c, den, gen, outopts)
RandomVector[o](d, den, gen, outopts)
パラメータ
r - (オプション) 非負整数; 結果として生じる行列の行次元
c - (オプション) 非負整数; 結果として生じる行列の列次元
d - (オプション) 非負整数; 結果として生じるベクトルの次元
den - (オプション) p は 0 <= p <= 1 である数値として、 density = p の形をした等式; 生成された値が結果として生じる行列またはベクトルの成分に割り当てられる確率
gen - (オプション) generator = f の形をした等式、ただし f は成分の値の生成系
[o] - (オプション) 結果として生じるベクトルの向きを指定するために [row] (行)かまたは [column] (列)のどちらか一方を用いる
outopts - (オプション) outputoptions=list の形をした等式; 結果として得られるオブジェクトのコンストラクタオプション
説明
RandomMatrix(r, c) 関数は、成分のすべてが範囲 -99..99 の整数値をとるような r x c 行列を返します。
行次元が与えられなければ、デフォルトで 0 になります。列次元が与えられなければ、デフォルトで行次元になります。
RandomVector(d) 関数は、成分のすべてが範囲 -99..99 の整数値をとるような d 次元ベクトルを返します。
RandomVector[row](d) 関数は行ベクトルが返されることを除いて、RandomVector(d) と同じように働きます。 向きオプションが省略されるか、 RandomVector[column](d) が使われると、列ベクトルが返されます。
次元が与えられなければ、デフォルトで 0 になります。
オプションパラメータ gen は代わりの数の生成系を定義するのに用いることができます。生成系が整数または浮動小数点の範囲で与えられると、適切な rtable ランダム・イニシャライザが成分を生成します。生成系のこの形はとても大きい行列やベクトルを作るのに用いるべきです。 オプションパラメータ gen が範囲ではない形で与えられる場合、コンストラクトされるMatrix または Vector のある要素(成分)値を返す引数をとらない手続きでなければなりません。
結果として生じる行列またはベクトルの成分がある値を割り当てられる確率は呼び出し手順に含まれる density = p、 ただし 0 <= p <= 1、 によって決定されます。 ランダムな値の配置は行列またはベクトルの shape (indexing function) に関係なく決定されますが (shape によって決められた) 可変でない位置にランダムな値を書き込む失敗した試みは無視されます。 言い換えれば、 p は実際に設定される可変な位置の個数というよりむしろ、フル長方行列またはベクトルの成分の中でルーチンがあるランダムな値に設定しようとする割合を決定します。
呼び出し手順の中で density = p が与えられなければ、p の値はデフォルトで 1 になります。
outputoptions オプション (outopts) は結果を作成する Matrix (または Vector) コンストラクタに追加情報 (readonly, shape, storage, order, datatype, attributes) を与えます。
この関数は LinearAlgebra パッケージの一部ですから、コマンド with(LinearAlgebra) を実行した後にのみ RandomMatrix(..) の形で使うことができます。ただし、長い形の名前 LinearAlgebra[RandomMatrix](..) を使えばいつでもアクセスすることができます。
例
with(LinearAlgebra): RandomVector(2);
RandomVector[row](6,generator=rand(1..5)/10);
RandomMatrix(3,density=0.75,generator=0..0.5);
RandomMatrix(4,4,generator=1..9,outputoptions=[shape=triangular[lower]]);
参照
Matrix, rand, RandomTools, type[numeric], Vector
Download Help Document