Nathann Cohen wrote: > I have a function named "a" which takes an integer as input. > Unfortunately when 'n' is a prime power, a(n) returns a very large > matrix (but quick to compute). Thus, I would love to cache only the > answers of a(n) when n is NOT a prime power, which are smaller and > take more time to compute. [...] > 1) Is there a way to obtain this behaviour with @cached_function ?
Perhaps not the most elegant solution ;-), but I guess you could use an auxiliary cached function that throws its result instead of returning it in cases where you don't want to cache it... -- Marc -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.