Consider the following association:
WhatToDo[y_, condition1_, condition2_] :=
Association[{{y, "True", "False"} ->
NIntegrate[
Exp[-x^y]*Cos[(z + x)^y], {x, 0.1, 5}, {z, 0.2, 7}], {y, "True",
"True"} ->
Max[Table[
RegionDistance[
Ball[{0.5, 12, 0.1}, y^i], {y^0.3, y, y^-0.8}], {i, 0.1, 1,
0.1}]], {y, "False", "True"} ->
ArcTan[1/y], {y, "False", "False"} ->
Table[{i,
NIntegrate[
Exp[-x^(y*i)]*Cos[(z + x)^(y*i)], {x, 0.1, 5}, {z, 0.2,
7}]}, {i, 0.1, 1, 0.1}]}][{y, condition1, condition2}]
It is stupid since even if fixing any of the arguments it still evaluates for all possible combinations. An ugly alternative would be using If
, but the code would be very bulky. Could you please tell me what is the analog of Association
that is compact and simultaneously does not call evaluations for all the possible combinations here?