__optimize_diagonal_matrix__
- :
val =__optimize_diagonal_matrix__()¶ - :
old_val =__optimize_diagonal_matrix__(new_val)¶ - :
old_val =__optimize_diagonal_matrix__(new_val, "local")¶ Read or change whether diagonal matrices are kept in a compact internal form.
With no argument the current setting is returned; supplying new_val changes it and returns the previous value. While the setting is on—its default—a result that is diagonal (such as that of
eye) is held in a compact representation that stores only the diagonal, saving both memory and work. Turning it off forces such results to be stored as ordinary full matrices instead.Invoked inside a function with a trailing
"local"argument, the new setting applies only to that function and anything it calls, and the previous setting is restored automatically when the function returns.