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
ListTools[Classify] - 特性プロパティを使用して list、set、table、または rtable の要素を分類
使い方
Classify(p, L, b1, ..., bn)
パラメータ
p
-
クラスを定義する特性プロパティ
L
list、set、table、または rtable; 分類する要素が含まれているオブジェクト
b1, ..., bn
(オプション) p に渡される追加引数
説明
Classify(p, L, b1, ..., bn) 関数は、L の要素を特性プロパティ p に従ってグループ化します。つまり、インデックス i を持つテーブル T (T[i] は値 p(e, b1, ..., bn) = i を持つ L の要素 e の集合) を返します。
L が table または rtable (たとえば、Array、Matrix、、または Vector) の場合、結果はこの関数を convert(L,list) (引数はすべて同じ) に適用した場合と等しくなります (convert/list を参照)。
Classify(p, L, b1, ..., bn) のコールは ListTools[Categorize]((x, y) -> p(x)=p(y), L, b1, ..., bn) とほぼ等価ですが、より効率的です。出力形式も異なります。Categorize はリストのシーケンスを返しますが、Classify はテーブルを返します。一方、Categorize は、一部のプロパティ p に対して (x, y) -> p(x)=p(y) に書き込めないことがある 2 引数関係が認められているという点で、より汎用的です。
互換性
ListTools[Classify] コマンドは Maple 16 で導入されました。
Maple 16 における変更点についての詳細は、Maple 16 の新機能 を参照してください。
例
with(ListTools):
types := Classify(whattype, ["Hello", 1, 2., Pi, x, x+y, exp, "world!"]):
map(print, op(eval(types))):
number_of_distinct_prime_factors := n -> nops(ifactors(n)[2]):
npf30 := Classify(number_of_distinct_prime_factors, [$1..30]):
indices(npf30, nolist);
npf30[0];
npf30[1];
npf30[2];
npf30[3];
関連項目
Array、convert/list、list、ListTools、ListTools[Categorize]、Matrix、rtable、set、table、Vector
Download Help Document