freealg.AlgebraicForm.decompress#
- AlgebraicForm.decompress(size, x=None, method='moc', min_n_times=10, newton_opt={'armijo': 0.0001, 'max_iter': 50, 'min_lam': 1e-06, 'sweep': True, 'tol': 1e-12, 'w_min': 1e-14}, plot=False, latex=False, save=False, verbose=False)#
Free decompression of spectral density.
- Parameters:
- sizeint or array_like
Size(s) of the decompressed matrix. This can be a scalar or an array of sizes. For each matrix size in
sizearray, a density is produced.- xnumpy.array, default=None
Positions where density to be evaluated at. If None, an interval slightly larger than the support interval will be used.
- method{
'moc','coeffs'`}, default= ``'moc' Method of decompression:
'moc': Method of characteristics with Newton iterations.'coeffs': Evolving polynomial coefficients directly.
- min_n_timesint, default=10
Minimum number of inner sizes to evolve.
- newton_optdict
A dictionary of settings to pass to Newton iteration solver.
- plotbool, default=False
If True, density is plotted.
- latexbool, default=False
If True, the plot is rendered using LaTeX. This option is relevant only if
plot=True.- savebool, default=False
If not False, the plot is saved. If a string is given, it is assumed to the save filename (with the file extension). This option is relevant only if
plot=True.- verbosebool, default=False
If True, it prints verbose be bugging information.
- Returns:
- rhonumpy.array or numpy.ndarray
Estimated spectral density at locations x.
rhocan be a 1D or 2D array output:If
sizeis a scalar,rhois a 1D array of the same size asx.If
sizeis an array of size n,rhois a 2D array with n rows, where each row corresponds to decompression to a size. Number of columns ofrhois the same as the size ofx.
- xnumpy.array
Locations where the spectral density is estimated
Examples
>>> from freealg import AlgebraicForm