sparsax.set_token_cache_size

sparsax.set_token_cache_size(n)[source]

Keep at most n factor tokens per backend (default 64).

factor(), lu_factor() and umf_factor() return tokens that pin their numeric factor. Tokens are plain arrays with no destructor, so sparsax keeps only each backend’s n newest and releases the rest; a released token raises a “stale factor token” error when used. Hold a token across at most n newer factorizations of that backend, or raise n (at the cost of up to n resident factors).