MCPcopy Create free account

hub / github.com/ColfaxResearch/layout-categories / functions

Functions185 in github.com/ColfaxResearch/layout-categories

↓ 31 callersMethodlength
Number of integers in flattened representation. :return: Length of flattened tuple :rtype: int
tract/src/tract/categories.py:260
↓ 25 callersMethodflatten
Return flattened tuple of all integers. :return: Flattened tuple :rtype: tuple
tract/src/tract/categories.py:245
↓ 25 callersMethodsub
Substitute values into the nested structure. :param values: Values to substitute :type values: tuple :return
tract/src/tract/categories.py:349
↓ 24 callersMethodcompose
Compute the composition β ∘ α: <m>_* → <p>_*. :param beta: Second morphism to compose (must have domain = self.codomain)
tract/src/tract/categories.py:80
↓ 19 callersFunctioncompute_layout
Compute the layout associated to a nested tuple morphism. :param morphism: Input nested tuple morphism :type morphism: Nest_morphism
tract/src/tract/layout_utils.py:280
↓ 17 callersFunctioncompute_flat_layout
Compute the layout L_f associated to a tuple morphism f. :param morphism: Input tuple morphism :type morphism: Tuple_morphism :r
tract/src/tract/layout_utils.py:205
↓ 16 callersFunctionrandom_Tuple_morphism
Generate a random tuple morphism. :param domain: Domain tuple (optional) :type domain: tuple or None :param codomain: Codomain t
tract/src/tract/test_utils.py:136
↓ 15 callersMethodcoalesce
Compute coalescence of the morphism. :return: Coalesced morphism :rtype: Nest_morphism
tract/src/tract/categories.py:1413
↓ 15 callersFunctionrandom_profile
Generate a random profile (nested tuple with all zeros). :param length: Number of zeros in flattened tuple :type length: int :pa
tract/src/tract/test_utils.py:488
↓ 14 callersMethodcomplement
Compute the complement of f. :return: Complement morphism :rtype: Nest_morphism :raises ValueError: If not c
tract/src/tract/categories.py:1441
↓ 14 callersMethodrank
Number of top-level modes. :return: Rank of the nested tuple :rtype: int
tract/src/tract/categories.py:269
↓ 12 callersMethodmode
Get i-th mode as a NestedTuple (1-indexed). :param i: Mode index (1-based) :type i: int :return: i-th mode
tract/src/tract/categories.py:306
↓ 9 callersMethodsize
Product of all integers in the nested tuple. :return: Product of all entries :rtype: int
tract/src/tract/categories.py:280
↓ 8 callersFunction_is_leaf_tuple
(x)
tract/src/tract/tuple_morph_tikz.py:223
↓ 8 callersMethodrefines
Check if self refines other. S refines T if: 1. S = T, or 2. T = size(S), or 3. rank(S) = rank(T)
tract/src/tract/categories.py:433
↓ 8 callersMethodrelative_mode
Get relative mode with respect to another NestedTuple. :param i: Index (1-based) :type i: int :param other:
tract/src/tract/categories.py:472
↓ 7 callersFunctionrandom_Nest_morphism
Generate a random nested tuple morphism. :param domain: Domain nested tuple (optional) :type domain: NestedTuple or None :param
tract/src/tract/test_utils.py:506
↓ 6 callersMethodconcat
Compute concatenation (f,g) of nested tuple morphisms. :param g: Second morphism :type g: Nest_morphism :ret
tract/src/tract/categories.py:1393
↓ 5 callersMethodcosize
Product of codomain entries. :return: Cosize :rtype: int
tract/src/tract/categories.py:1330
↓ 5 callersFunctionflatten_layout
Compute the flattening of a given layout. :param layout: Input layout :type layout: cute.Layout :return: Flattened layout :r
tract/src/tract/layout_utils.py:60
↓ 5 callersFunctionrandom_complementable_Tuple_morphism
Generate a random complementable tuple morphism. Creates a morphism with 0 < length(domain) < length(codomain). :param min_leng
tract/src/tract/test_utils.py:311
↓ 5 callersFunctionrandom_ordered_subtuple
Generate a tuple of k distinct integers sampled uniformly from {1,...,m}. :param m: Upper bound of the set (inclusive) :type m: int
tract/src/tract/test_utils.py:32
↓ 4 callersMethodflatten
Flatten to a Tuple_morphism. :return: Flattened morphism :rtype: Tuple_morphism
tract/src/tract/categories.py:1307
↓ 4 callersFunctionintuple_to_tuple
(shape)
tract/src/tract/layout_utils.py:247
↓ 4 callersMethodlogical_product
Compute logical product. :param other: Second factor :type other: Nest_morphism :return: Product :rt
tract/src/tract/categories.py:1511
↓ 3 callersMethodcosize
Product of codomain entries. :return: Size of codomain :rtype: int
tract/src/tract/categories.py:620
↓ 3 callersMethodimages_are_disjoint
Check if morphisms α and β have disjoint images. :param beta: Other morphism with same codomain :type beta: Fin_morp
tract/src/tract/categories.py:124
↓ 3 callersMethodis_coalesced
Check if the morphism is coalesced. :return: True if coalesced :rtype: bool
tract/src/tract/categories.py:655
↓ 3 callersMethodlogical_divide
Compute logical division. :param other: Denominator morphism :type other: Nest_morphism :return: Quotient
tract/src/tract/categories.py:1500
↓ 3 callersFunctionmutual_refinement
Compute mutual refinement of two nested tuples. Given nested tuples T and U, computes T' and U' such that: 1. T' refines T 2. U'
tract/src/tract/layout_utils.py:360
↓ 3 callersFunctionnested_tuple_morphism_to_tikz
Build a single picture with one set of (s{i}). - If domain.depth() <= 1: skip tree half entirely. - Mode roots m<i>: * if root_y_
tract/src/tract/tuple_morph_tikz.py:118
↓ 3 callersFunctionrandom_NestedTuple
Generate a random NestedTuple containing exactly `length` integers. :param length: Number of integers in flattened tuple :type lengt
tract/src/tract/test_utils.py:441
↓ 3 callersMethodsort
Return sorted version of the morphism. :return: Sorted morphism :rtype: Tuple_morphism
tract/src/tract/categories.py:763
↓ 3 callersMethodsqueeze
Remove all ones from domain and codomain. :return: Squeezed morphism :rtype: Tuple_morphism
tract/src/tract/categories.py:823
↓ 3 callersFunctiontwo_parenthesizations_to_tikz_values
Draw two tree halves sharing a single integer leaf stack (duplicates supported). Left = P, Right = Q. Each side is resolved to GLOBAL leaf in
tract/src/tract/tuple_morph_tikz.py:385
↓ 2 callersFunction_gather_indices_idx
On an index-mapped tree, collect the (global) leaf indices under 'tree'.
tract/src/tract/tuple_morph_tikz.py:250
↓ 2 callersFunction_map_tree_to_indices
Return a new tree with leaves replaced by their GLOBAL leaf indices. Each time a value v is encountered, pop the leftmost index from value_po
tract/src/tract/tuple_morph_tikz.py:237
↓ 2 callersFunction_place_roots_and_connect_tuple_idx
Create a visible root node for EVERY top-level item in the INDEXED tree: • Leaf item: label is the leaf value (via values_by_index); draw a
tract/src/tract/tuple_morph_tikz.py:312
↓ 2 callersFunctionclone_pools
()
tract/src/tract/tuple_morph_tikz.py:417
↓ 2 callersMethodcomplement
Compute the complement of f. :return: Complement morphism :rtype: Tuple_morphism :raises ValueError: If not
tract/src/tract/categories.py:1142
↓ 2 callersMethodcompose
Compute composition g ∘ f. :param g: Second morphism :type g: Nest_morphism :return: Composition :rt
tract/src/tract/categories.py:1362
↓ 2 callersMethodconcat
Compute concatenation of morphisms with same codomain and disjoint images. :param g: Second morphism :type g: Tuple_
tract/src/tract/categories.py:799
↓ 2 callersFunctionconcatenate
Compute the nested concatenation (L_1, L_2) of layouts. :param base: First layout :type base: cute.Layout :param stack: Second l
tract/src/tract/layout_utils.py:263
↓ 2 callersMethodentry
Get i-th entry (1-indexed). :param i: Index (1-based) :type i: int :return: Value at index i :rtype:
tract/src/tract/categories.py:292
↓ 2 callersMethodfactorize
Factorize morphism through a subtuple of its codomain. :param subtuple: Codomain indices (1-based) :type subtuple: T
tract/src/tract/categories.py:741
↓ 2 callersMethodis_complementable
Check if morphism is complementable. :return: True if complementable :rtype: bool
tract/src/tract/categories.py:1133
↓ 2 callersMethodis_complementable
Check if nested tuple morphism is complementable. :return: True if complementable :rtype: bool
tract/src/tract/categories.py:1432
↓ 2 callersMethodis_complementary_to
Check if morphism is complementary to other morphism. :param other: Other morphism :type other: Nest_morphism
tract/src/tract/categories.py:1473
↓ 2 callersMethodis_isomorphism
Check if f is an isomorphism. :return: True if isomorphism :rtype: bool
tract/src/tract/categories.py:1162
↓ 2 callersMethodis_isomorphism
Check if f is an isomorphism. :return: True if isomorphism :rtype: bool
tract/src/tract/categories.py:1464
↓ 2 callersMethodis_sorted
Check if the nested tuple morphism is sorted. :return: True if sorted :rtype: bool
tract/src/tract/categories.py:1342
↓ 2 callersMethodprofile
Return profile (structure with all zeros). :return: Profile of the nested tuple :rtype: NestedTuple
tract/src/tract/categories.py:373
↓ 2 callersMethodpullback_along
Pullback morphism along a refinement. :param refinement: Refinement of codomain :type refinement: NestedTuple
tract/src/tract/categories.py:1522
↓ 2 callersMethodpushforward_along
Pushforward morphism along a refinement. :param refinement: Refinement of domain :type refinement: NestedTuple
tract/src/tract/categories.py:1552
↓ 2 callersFunctionrandom_Fin_morphism
Generate a random morphism in Fin_*. :param domain: Domain size (optional) :type domain: int or None :param codomain: Codomain s
tract/src/tract/test_utils.py:51
↓ 2 callersFunctionrandom_Tuple_morphisms_with_disjoint_images
Generate a pair of tuple morphisms with same codomain and disjoint images. :param min_length: Minimum length :type min_length: int
tract/src/tract/test_utils.py:248
↓ 2 callersFunctionrandom_complementable_Nest_morphism
Generate a random complementable nested tuple morphism. :return: Random complementable morphism :rtype: Nest_morphism
tract/src/tract/test_utils.py:608
↓ 2 callersFunctionrandom_divisible_Tuple_morphisms
Generate a pair of tuple morphisms f, g where g divides f. g is injective and codomain(g) = domain(f). :param min_length: Minim
tract/src/tract/test_utils.py:351
↓ 2 callersFunctionrandom_mutually_refinable_nested_tuples
Generate a pair of mutually refinable nested tuples. :return: Pair of mutually refinable nested tuples :rtype: Tuple[NestedTuple, N
tract/src/tract/test_utils.py:685
↓ 2 callersFunctionrandom_product_admissible_Tuple_morphisms
Generate a pair of tuple morphisms admissible for product operation. :param min_length: Minimum length :type min_length: int :pa
tract/src/tract/test_utils.py:389
↓ 2 callersMethodsize
Product of domain entries. :return: Size of domain :rtype: int
tract/src/tract/categories.py:608
↓ 2 callersFunctionsort_flat_layout
Sort a flat layout by stride values, breaking ties by shape. :param flat_layout: Input flat layout :type flat_layout: cute.Layout
tract/src/tract/layout_utils.py:76
↓ 2 callersMethodsublength
Compute sublength up to position i. :param i: Position (1-based) :type i: int :param refined: Reference Nest
tract/src/tract/categories.py:528
↓ 2 callersMethodwedge
Compute the wedge sum α ∨ β: <m+p>_* → <n>_*. Morphisms must have same codomain and disjoint images. :param
tract/src/tract/categories.py:150
↓ 1 callersFunctionNest_coalesce_agree
Check if nested morphism coalescence agrees with layout coalescence. :param f: Nest morphism to test :type f: Nest_morphism :ret
tract/tests/morphism_tests.py:373
↓ 1 callersFunctionNest_complement_agree
Check if nested tuple morphism complement agrees with layout complement. :param f: Morphism to test :type f: Nest_morphism :retu
tract/tests/morphism_tests.py:336
↓ 1 callersFunctionNest_compose_agree
Check if nested morphism composition agrees with layout composition. :param f: First morphism :type f: Nest_morphism :param g: S
tract/tests/morphism_tests.py:352
↓ 1 callersFunctionNest_concat_agree
Check if nested morphism concatenation agrees with layout concatenation. :param f: First morphism :type f: Nest_morphism :param
tract/tests/morphism_tests.py:315
↓ 1 callersFunctionNest_logical_divide_agree
(f: cutlass.Constexpr[Nest_morphism], g: cutlass.Constexpr[Nest_morphism])
tract/tests/morphism_tests.py:405
↓ 1 callersFunctionNest_logical_product_agree
(f: cutlass.Constexpr[Nest_morphism], g: cutlass.Constexpr[Nest_morphism])
tract/tests/morphism_tests.py:396
↓ 1 callersFunction_calc_layers_tuple
(tree)
tract/src/tract/tuple_morph_tikz.py:227
↓ 1 callersMethod_custom_repr
Custom representation without trailing commas for single elements. :param obj: Object to represent :return: String r
tract/src/tract/categories.py:207
↓ 1 callersMethod_flatten
Generator for flattening nested structure. :param obj: Object to flatten :yield: Integer values
tract/src/tract/categories.py:232
↓ 1 callersFunction_process_tuple_tree_idx
Build junctions for an INDEXED tree (leaves are global indices). Junction x uses uniform subdivision depth/(max_layers_root+1) from root_x →
tract/src/tract/tuple_morph_tikz.py:260
↓ 1 callersMethod_validate
Recursively validate the nested structure. :param obj: Object to validate :return: True if valid :rtype: boo
tract/src/tract/categories.py:193
↓ 1 callersMethod_validate_inputs
Validate that the input data defines a valid morphism in E_0. :raises ValueError: If the morphism is invalid
tract/src/tract/categories.py:50
↓ 1 callersMethod_validate_inputs
Verify that the input data defines a valid morphism in Tuple category. :raises ValueError: If morphism is invalid
tract/src/tract/categories.py:579
↓ 1 callersMethod_validate_inputs
Verify that the input data defines a valid morphism. :raises ValueError: If morphism is invalid
tract/src/tract/categories.py:1274
↓ 1 callersFunctioncalculate_junction_layers
(mode)
tract/src/tract/tuple_morph_tikz.py:27
↓ 1 callersFunctioncoalesce_agree
Check if morphism coalescence agrees with layout coalescence. :param f: Tuple morphism to test :type f: Tuple_morphism :return:
tract/tests/morphism_tests.py:59
↓ 1 callersFunctioncomplement_agree
Check if morphism complement agrees with layout complement. :param f: Morphism to test :type f: Tuple_morphism :return: True if
tract/tests/morphism_tests.py:132
↓ 1 callersMethodcompose
Compute composition g ∘ f. :param g: Second morphism (must have domain = self.codomain) :type g: Tuple_morphism
tract/src/tract/categories.py:688
↓ 1 callersFunctioncompose_agree
Check if morphism composition agrees with layout composition. :param f: First morphism :type f: Tuple_morphism :param g: Second
tract/tests/morphism_tests.py:111
↓ 1 callersFunctioncomposition_algorithm_agree
Check if weak composition algorithm produces correct result. :param f: First morphism :type f: Nest_morphism :param g: Second mo
tract/tests/morphism_tests.py:415
↓ 1 callersFunctioncompute_Nest_morphism
Compute a nested tuple morphism from a tractable layout. Given a tractable layout L, produces a nested tuple morphism f with L_f = L.
tract/src/tract/layout_utils.py:296
↓ 1 callersFunctioncompute_Tuple_morphism
Compute a tuple morphism from a tractable flat layout. Given a tractable flat layout L, produces the standard representation f_L of L.
tract/src/tract/layout_utils.py:139
↓ 1 callersFunctionconcat_agree
Check if morphism concatenation agrees with layout concatenation. :param f: First morphism :type f: Tuple_morphism :param g: Sec
tract/tests/morphism_tests.py:90
↓ 1 callersMethoddepth
Maximum depth of nesting in the nested tuple. An integer has depth 1, a flat tuple has depth 1, a nested tuple has depth 1 +
tract/src/tract/categories.py:330
↓ 1 callersFunctionflat_concatenate
Compute the flat concatenation concat(L_1, L_2) of flat layouts. :param base: First layout :type base: cute.Layout :param stack:
tract/src/tract/layout_utils.py:235
↓ 1 callersMethodflat_divide
Compute flat division self / other. :param other: Denominator morphism :type other: Tuple_morphism :return:
tract/src/tract/categories.py:1201
↓ 1 callersFunctionflat_divide_agree
Check if flat division of morphisms agrees with layout division. :param f: Numerator morphism :type f: Tuple_morphism :param g:
tract/tests/morphism_tests.py:148
↓ 1 callersMethodflat_product
Compute flat product self × other. :param other: Second factor :type other: Tuple_morphism :return: Product
tract/src/tract/categories.py:1218
↓ 1 callersFunctionflat_product_agree
Check if flat product of morphisms agrees with layout product. :param f: First factor morphism :type f: Tuple_morphism :param g:
tract/tests/morphism_tests.py:169
↓ 1 callersFunctiongenerate
(depth, remaining)
tract/src/tract/test_utils.py:457
↓ 1 callersFunctionget_leaf_indices
Return flat leaf indices covered by `mode` (advancing by .length()).
tract/src/tract/tuple_morph_tikz.py:38
↓ 1 callersMethodimages_are_disjoint
Check if morphisms have disjoint images. :param g: Other morphism :type g: Tuple_morphism :return: True if d
tract/src/tract/categories.py:788
↓ 1 callersMethodimages_are_disjoint
Check if morphisms have disjoint images. :param g: Second morphism :type g: Nest_morphism :return: True if d
tract/src/tract/categories.py:1379
↓ 1 callersMethodis_sorted
Check if the morphism is sorted. :return: True if sorted :rtype: bool
tract/src/tract/categories.py:632
↓ 1 callersFunctionis_tractable
Check if a given layout is tractable. A layout is tractable if each stride divides evenly into the next stride times shape product.
tract/src/tract/layout_utils.py:114
↓ 1 callersFunctionmain
Main function for testing.
tract/src/tract/layout_utils.py:489
next →1–100 of 185, ranked by callers