Atelier des rouesLab FR
Objects/Documentation

cache21.py

I provide the code for this study. Limiting memory for eight rank queries

Download ↓
"""Conditional rank queries under a fixed LRU cap. Count coefficient evaluations."""
from functools import lru_cache
import json
from stables19 import graph,unrank,count


def study(vertex):
    adjacency=graph();mask=((1<<34)-1)&~(1<<vertex)&~adjacency[vertex]
    size=count(mask,7);ranks=[(2*j+1)*size//16 for j in range(8)]
    assert not set(ranks)&{i*(size-1)//7 for i in range(8)}
    controls=[unrank(vertex,8,r) for r in ranks]
    rows=[]
    for capacity in (16,64,256):
        @lru_cache(maxsize=capacity)
        def poly(rem):
            if not rem:return (1,)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.