per page, with , order by , clip by
Results of 1 - 8 of about 8 for heap (0.008 sec.)
heapq --- ヒープキューアルゴリズム 13754
heapq --- ヒープキューアルゴリズム ソースコード: Lib/heapq.py このモジュールではヒープキューアルゴリズムの一実装を提供しています。優先度キューアルゴリズムとしても知られています。 最小ヒープは、各親ノードの値がそのどの子ノードの値以下でもある ... 木です。 この条件をヒープ不変式と呼びます。 この実装では最小ヒープをリストで表し、比較する要素が存在するすべての k について heap[k] <= heap[2*k+1] および heap[k] <= heap[2*k+2] が成り立ちます。 要素は 0 から数えます。 最小ヒープの興味深い性質は、最小の ... 要素が常に根の heap[0] にあることです。 Max-heaps satisfy the reverse invariant: every parent node has a value greater than any of its childre ... n. These are implemented as lists for which maxheap[2*k+1] <= maxheap[k] and maxheap[2*k+2] <= maxheap[k] for all k for which the compared elements exist. The root, maxheap[0 ...
https://man.mtool.work/python/3.14/library/heapq.html
What's New in Python 2.3 9019
What's New in Python 2.3 著者 : A.M. Kuchling この文書は Python 2.3 の新機能について解説します。Python 2.3 は 2003 年 7 月 29 日にリリースされました。 Python 2.3 の主要なテーマは、2.2 で追加されたいくつかの機能を磨くこと、言語中核に小さいな ... ングの検索に使えるようになりました (例えば "ab" in "abc" は True を返します)。 たくさんのライブラリ新機能…、Boolean、 set、 heap、 日付/時刻データ型、ZIP 形式アーカイブからのモジュールインポート、待ち望まれていた Python カタログのためのメタデータサポー ... k' ) >>> g . gr_name , g . gr_gid ('amk', 500) gzip モジュールが 2 GiB を超えるファイルを扱えるようになっています。 新しい heapq モジュールには、ヒープキューアルゴリズムの実装が含まれています。 ヒープは配列のようなデータ構造で、すべてのインデックス k ... について heap[k] <= heap[2*k+1] および heap[k] <= heap[2*k+2] が成り立つよう、要素を部分的に整列して保持します。 これによって最小の要素を ...
https://man.mtool.work/python/3.14/whatsnew/2.3.html
メモリ管理 8476
メモリ管理 概要 Python におけるメモリ管理には、全ての Python オブジェクトとデータ構造が入ったプライベートヒープ (private heap) が必須です。プライベートヒープの管理は、内部的には Python メモリマネージャ (Python memory manager) が確実に行いま ... オブジェクトを確保する時にだけ必要です。 In most situations, however, it is recommended to allocate memory from the Python heap specifically because the latter is under control of the Python memory manager. For example, this is required when the inte ... rpreter is extended with new object types written in C. Another reason for using the Python heap is the desire to inform the Python memory manager about the memory needs of the extension module. Even when the requested ...
https://man.mtool.work/python/3.14/c-api/memory.html
型オブジェクトの構造体 8404
型オブジェクトの構造体 新しい型を定義する PyTypeObject 構造体は、Python のオブジェクトシステムで特に重要な構造体の 1 つです。 型オブジェクトは PyObject_* 関数や PyType_* 関数で扱えますが、ほとんどの Python アプリケーションにとって関心のある ... ません。 tp_clear はすでに呼び出されている可能性がある点に注意してください。 型がヒープに割り当てられている場合 ( Py_TPFLAGS_HEAPTYPE )、解放関数は型の解放関数を呼び出した後、型オブジェクトへの所有する参照を Py_DECREF() で解放するべきです。 以下のコード ... tp_free ( self ); self = NULL ; // 後で PyErr_WriteUnraisable() が呼ばれる場合に備える。 if ( tp -> tp_flags & Py_TPFLAGS_HEAPTYPE ) { Py_CLEAR ( tp ); } done : // 例外を送出する可能性のある処理を呼び出した場合に、 // 必要に応じて行う。 if ( PyErr_O ... す。 PyType_HasFeature() マクロは型とフラグ値、 tp および f をとり、 tp->tp_flags & f が非ゼロかどうか調べます。 Py_TPFLAGS_HEAPTYPE 型オブジェクト自体がヒープに割り当てられた場合に設定されるビットです。 例えば PyType_FromSpec() で動的に作成された型が ...
https://man.mtool.work/python/3.14/c-api/typeobj.html
Pythonモジュール索引 8260
Pythonモジュール索引 _ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | z _ __future__ Future statement definitions __main__ The environment where top-level code is run. Covers command-line i ... Interfaces for gzip compression and decompression using file objects. h hashlib Secure hash and message digest algorithms. heapq Heap queue algorithm (a.k.a. priority queue). hmac Keyed-Hashing for Message Authentication (HMAC) implementation html He ...
https://man.mtool.work/python/3.14/py-modindex.html
型オブジェクト 8133
型オブジェクト type PyTypeObject 次に属します: Limited API (不透明な構造体として). 組み込み型を記述する際に用いられる、オブジェクトを表す C 構造体です。 PyTypeObject PyType_Type 次に属します: Stable ABI . 型オブジェクト自身の型オブジェクトで ... せん。 参考 弱参照オブジェクト weakref ヒープに割り当てられる型の作成 The following functions and structs are used to create heap types . PyObject * PyType_FromMetaclass ( PyTypeObject * metaclass , PyObject * module , PyType_Spec * spec , PyObject * b ... ases ) 次に属します: Stable ABI (バージョン 3.12 より). spec から ヒープ型 を作成して返します ( Py_TPFLAGS_HEAPTYPE を参照)。 The metaclass metaclass is used to construct the resulting type object. When metaclass is NULL , the metacla ... FLAGS_ITEMS_AT_END フラグがある場合。 unsigned int flags Type flags, used to set PyTypeObject.tp_flags . If the Py_TPFLAGS_HEAPTYPE flag is not set, PyType_FromSpecWithBases() sets it automatically. PyType_Slot * slots Array of PyType_Slot structures ...
https://man.mtool.work/python/3.14/c-api/type.html
What's New in Python 2.6 8133
What's New in Python 2.6 著者 : A.M. Kuchling (amk at amk.ca) この記事では、2008 年 10 月 1 日にリリースされた Python 2.6 の新機能を説明します。 リリース日程は PEP 361 に記載されています。 Python 2.6 の主要なテーマは、言語を大幅に再設計する ... パスが使われるかディレクトリ内に Unicode ファイル名がマッチすると Unicode ファイル名を返すようになりました。 ( bpo-1001604 ) heapq モジュールの新しい関数 merge(iter1, iter2, ...) は、任意の数のソートされたデータを返すイテラブルを取り、全てのイテラブルの ... ートされていなくても並べ替えられるわけではありません。リファレンスにはここはきちんと書かれています。---)。例えば: >>> list ( heapq . merge ([ 1 , 3 , 5 , 9 ], [ 2 , 8 , 16 ])) [1, 2, 3, 5, 8, 9, 16] もう一つの新しい関数 heappushpop(heap, item) は、 hea ... p に item を追加してから、最小の要素を取り除いて返します。 heappush() と heappop() を順に呼ぶより効率的です。 heapq は以前使っていた「以下( <= )」比較ではなく「より小さい( < )」比較だけを ...
https://man.mtool.work/python/3.14/whatsnew/2.6.html
1. Extending Python with C or C++ 8061
1. Extending Python with C or C++ It is quite easy to add new built-in modules to Python, if you know how to program in C. Such extension modules can do two things that can't be done directly in Python: they can implement new built-in objec ... ) . return PyLong_FromLong ( sts ); In this case, it will return an integer object. (Yes, even integers are objects on the heap in Python!) If you have a C function that returns no useful argument (a function returning void ), the corresponding Pytho ...
https://man.mtool.work/python/3.14/extending/extending.html
PREV 1 NEXT