bbsvdmem

Estimate memory usage for computing an SVD.

Syntax

mem=bbsvdmem(bb)
mem=bbsvdmem(bb,opt)
mem=bbsvdmem(bb,l)
mem=bbsvdmem(bb,l,opt)
mem=bbsvdmem(bb,l,trip)
mem=bbsvdmem(bb,l,trip,opt)

Description

bbsvdmem estimates the memory (in megabytes) used internally by bbsvds and bbsvdf. It follows the same syntax as bbsvdopt.

While bbsvdopt normally generates a good set of options, there are situations where some tuning is necessary to even complete a calculation.

The problem is (usually) that a limited amount of memory is available. This function takes the arguments intended for the computation and estimates the amount of memory needed.

NOTE: the memory does not include the memory needed to store the result itself. In the case of bbsvds, this should be taken into account if singular triplets are returned. In the future bbsvds may be able to save the resulting SVD in a file to eliminate this problem.

Input Arguments

bb Black-box operator or matrix
opt Structure with options for the SVD
l Number of singular values or triplets to compute
trip true if singular triplets are required
false if only singular values are needed.

For a list of parameters that can be passed in opt, please refer to bbsvdopt.

Result

The output is an estimate of the required memory, in megabytes, needed to complete the computation. There is also some overhead that is disregarded, but this tends to be unimportant in large-scale problems.

Examples

The following code creates a 25000×50000 black-box operator and estimates the memory required to compute either 200 singular values or full triplets:
bb=bbkron(randn(100),randn(250,500));
opt=bbsvdopt(bb,200,false);
mem0=bbsvdmem(bb,opt),
mem1=bbsvdmem(bb,200,true)

See Also

bbsvdopt, bbsvds, bbsvdf.