Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
LinearAlgebra[Zip] - 行列またはベクトルの組を 2 引数の手続きでまとめる
使い方
Zip(f, A, B, ex, ip, outopts)
パラメータ
f - 手続きか名前; 適用する手続き
A - 行列またはベクトル
B - 行列またはベクトル
ex - (オプション) 任意の型; A と B が同じサイズでないとき、割り当てられていない成分に用いられる値
ip - (オプション) BooleanOpt(inplace); 出力が入力を上書きするかどうかを指定
outopts - (オプション) outputoptions=list の形をした等式; 結果として得られるオブジェクトのコンストラクタオプション
説明
Zip(f, A, B) 関数は、2 変数関数 f を行列 (またはベクトル) A と B の成分の組に適用します。
パラメータ A と B は両方行列かまたは両方ベクトルのどちらかでないといけません。もしそれらがベクトルのとき、それらの方向は一致しなくてもかまいません。結果として得られる方向は A と同じ方向を持ちます。
A と B が同じ大きさでないなら、結果の大きさはオプション ex パラメータが有るか無いかによって決定されます。このパラメータが呼び出し手順で省略されていると、得られるオブジェクトのサイズは、A と B の対応するサイズの最小値をとることによって決定されます。
したがって、A と B がベクトルなら得られるオブジェクトは、次元が min(dim(A), dim(B)) のベクトルです。もし A と B が行列なら得られるオブジェクトは、サイズが min(rowdim(A),rowdim(B)) X min(coldim(A),coldim(B)) の行列です。
ex が呼び出し手順で与えられていれば、得られるオブジェクトのサイズは A と B の対応するサイズの最大値をとることで決定されます。この場合 A あるいは B が結果に特定の位置の成分に対する値を含んでいないとき、値 ex が欠測値の代わりに使われます。
inplace オプション (ip) は結果が返される場所を決めます。 inplace=true が与えられれば、結果は最初の引数に上書きされます。 inplace=false が与えられるか、または呼び出し手順に含まれていないときは、結果は新しい行列(あるいはベクトル)として返されます。
inplace=true という条件は、inplace と略記することができます。
inplace オプションは、注意して使わなければいけません。なぜなら、演算が失敗すれば元の行列 (あるいはベクトル) の引数は壊れてしまうかもしれないからです。
inplace オプションは、結果のオブジェクトのサイズと A のサイズがちょうど同じである場合に限り有効です。
outputoptions オプション (outopts) は、結果を作成する Matrix (あるいは Vector) コンストラクタに付加情報 (readonly, shape, storage, order, datatype, attributes) を与えます。
inplace と outputoptions オプションは両立しません。
この関数は LinearAlgebra パッケージの一部ですから、with(LinearAlgebra) を実行した後にのみ Zip(..) の形で使うことができます。ただし、長い形の名前 LinearAlgebra[Zip](..) を使えばいつでもアクセスすることができます。
例
with(LinearAlgebra): Zip( `+`, <1,2>, <3,4> );
A := <<1,2,3>|<4,5,6>>;
B := <<1,2>|<3,4>|<5,6>>;
Zip( `+`, A, B );
Zip( `+`, A, B, Pi );
次の例は、要素ごとに (点ごとに) 乗法を行うために Zip を使います。これは、 "アダマール積" や "シュア積" としても知られています。
Zip( `*`, A, B );
参照
Matrix, Vector, type[BooleanOpt]
Download Help Document