def analyze(self):
<EOL>loop_stack = list(self.kernel.get_loop_stack())<EOL>if any([l['<STR_LIT>'] != <NUM_LIT:1> for l in loop_stack]):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>for aref in list(self.kernel.index_order()):<EOL><INDENT>while aref and len(aref[<NUM_LIT:0>]) == <NUM_LIT:0>:<EOL><INDENT>aref.pop(<NUM_LIT:0>)<EOL><DEDENT>for i, idx_names in enumerate(aref):<EOL><INDENT>if i >= len(loop_stack) orany([loop_stack[i]['<STR_LIT:index>'] != idx.name for idx in idx_names]):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>for arefs in chain(chain(*self.kernel.sources.values()),<EOL>chain(*self.kernel.destinations.values())):<EOL><INDENT>if not arefs:<EOL><INDENT>continue<EOL><DEDENT>while arefs and not arefs[<NUM_LIT:0>].free_symbols:<EOL><INDENT>arefs = arefs[<NUM_LIT:1>:]<EOL><DEDENT>for i, expr in enumerate(arefs):<EOL><INDENT>diff = sympy.diff(expr, sympy.Symbol(loop_stack[i]['<STR_LIT:index>']))<EOL>if diff != <NUM_LIT:0> and diff != <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>self.results = self.calculate_cache_access()<EOL>
Run complete analysis.