==========================================================================================
> @brief Generates a random Faust.
>
> @warning if this function is imported through 'import matfaust.rand' or 'import matfaust.*' the Matlab builtin function rand will be unreachable (matfaust.rand will be called instead). So, generally, it is not advisable to import this function, rather directly call matfaust.rand without any import.
>
> @b Usage
>
> @b rand(@b M,@b N) generates a M-by-N Faust object. The numbers of rows and columns of intermediary factors are all randomly chosen between M and N (included). The number of factors is 5. The factors are sparse and real. The nnz per row of factors is 5.
>
> @b rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S) with NF and S two integers, generates a M-by-N Faust of NF factors. The factor size is S for both dimensions (except the first factor number of rows and the last factor number of columns which are respectively M and N). The factors are sparse and real.
>
> @b rand(@b M, @b N, @b 'num_factors', [@b N1, @b N2], @b 'dim_sizes', @b S) same as above except that here the number of factors is randomly chosen between N1 and N2 inclusively.
>
> @b rand(@b M, @b N, @b 'num_factors', [@b N1, N@b 2], [@b S1, @b S2]) or @b rand(@b M, N@b , @b 'num_factors', @b NF, @b 'dim_sizes', [@b S1, @b S2]) same as above except that here the intermediary factor dimension sizes are random; the number of rows and columns are both randomly chosen between S1 and S2 inclusively.
>
> @b rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S, @b 'density', @b D) or @b rand(@b M, @b N, @b 'num_factors', [@b N1, @b N2], @b 'dim_sizes', [@b S1, @b S2], @b 'density', @b D) same as above but specifying D the approximate density of each factor.
>
> @b rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S, @b 'density', @b D, @b 'per_row', @b true) or @b rand(@b M, @b N, @b 'num_factors', [@b N1, @b N2], @b 'dim_sizes', [@b S1, @b S2], @b 'density',@b D, @b 'per_row', true) same as above but specifying D, the density of each factor per row ('per_row', true) or per column ('per_row', false).
>
> @b @b rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S, @b 'density', @b D, @b 'fac_type', @b 'dense') or @b rand(@b M, @b N, @b 'num_factors', @b [@b N1, @b N2], @b 'dim_sizes', [@b S1, @b S2], @b 'density', @b D, @b 'fac_type', @b 'dense') same as above but generating only dense matrices as factors.
>
> @b rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S, @b 'density', @b D, @b 'mixed') or @b rand(@b M, @b N, @b 'num_factors', [@b N1, @b N2], @b 'dim_sizes', [@b S1, @b S2], @b 'density', @b D, @b 'fac_type', @b 'sparse') same as above but generating either sparse or dense matrices as factors.
>
> @b rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S, @b 'density', @b D, @b 'fac_type', @b 'sparse', @b 'field' , @b 'complex'), @b rand(@b M, @b N, @b 'num_factors', [@b N1, @b N2], @b 'dim_sizes', [@b S1, @b S2], @b 'density', @b D, @b 'fac_type', @b 'sparse', @b 'per_row', @b false), rand(@b M, @b N, @b 'num_factors', @b NF, @b 'dim_sizes', @b S, @b 'density', @b D, @b 'fac_type', @b 'dense', @b 'field' , @b 'complex') or @b rand(@b M, @b N, @b 'num_factors', [@b N1, @b N2], @b 'dim_sizes', [@b S1, @b S2], @b D, @b 'fac_type', @b 'dense', @b 'field', @b 'complex') same as above but generating a complex Faust, that is, matrices defined over the complex field.
>
>
>
>
>
>
>
> @param M the Faust number of rows.
> @param N the Faust number of columns.
> @param 'num_factors', NF if it's an integer it is the number of random factors to set in the Faust.
> If NF is a vector of 2 integers then the
> number of factors is set randomly between
> NF(1) and NF(2) (inclusively). Defaultly, a 5 factors long Faust is generated.
> @param 'dim_sizes',S if it's an integer all Faust factors are square matrices (except maybe the first
> and last ones, depending on M and N). The size of the intermediary square factors is S**2.
> If it's a vector of 2 integers then the number of rows and columns are both a random number between size_dims(1) and
> size_dims(2) (inclusively). Defaultly, dim_sizes is [M, N].
> @param 'density',D the approximate density of generated factors.
> D must be a floating point number greater than 0 and lower of equal to 1.
> The default value is such that each factor gets 5 non-zero
> elements per row, if per_row is true, or per column otherwise.
> A density of zero is equivalent to the default case.
> @param 'per_row',bool this argument is to specify the density per row or per column.
> By default the density is set per row and is such that the Faust's factors will have 5 non-zero elements per row.
> @param fac_type, str the storage representation of factors. str must be 'sparse', 'dense' or 'mixed'.
> The latter designates a mix of dense and sparse matrices in the generated Faust (the choice is made according
> to a uniform distribution).
> The default value is 'sparse'.
> @param 'field', str str is either 'real' or 'complex' (the Faust field).
> The default value is 'real'.
> @param 'dev', str 'gpu or 'cpu' to create the random Faust on CPU or GPU (by default on CPU).
> @param 'class', str 'double' (by default) or 'single' to select the scalar type used for the Faust generated.
>
>
> @retval F the random Faust.
>
> @b Example @b 1
> @code
> >> F = matfaust.rand(10,5)
>
> F =
>
> Faust size 10x5, density 4.32, nnz_sum 216, 5 factor(s):
> - FACTOR 0 (real) SPARSE, size 10x9, density 0.555556, nnz 50
> - FACTOR 1 (real) SPARSE, size 9x6, density 0.666667, nnz 36
> - FACTOR 2 (real) SPARSE, size 6x10, density 0.5, nnz 30
> - FACTOR 3 (real) SPARSE, size 10x10, density 0.5, nnz 50
> - FACTOR 4 (real) SPARSE, size 10x5, density 1, nnz 50
> @endcode
>
> @b Example @b 2
> @code
> % in a matlab terminal
> >> G = matfaust.rand(10, 10, 'num_factors', 2, 'dim_sizes', 10, 'density', .5, 'mixed', 'complex')
>
> G =
>
> Faust size 10x10, density 1, nnz_sum 100, 2 factor(s):
> - FACTOR 0 (complex) SPARSE, size 10x10, density 0.5, nnz 50
> - FACTOR 1 (complex) DENSE, size 10x10, density 0.5, nnz 50
> @endcode
>
> @b Example @b 3
> @code
> >> H = matfaust.rand(10, 10, 'num_factors', [2, 5], 'dim_sizes', [10, 20], 'density', .5, 'fac_type', 'dense')
>
> H =
>
> Faust size 5x10, density 4.64, nnz_sum 232, 3 factor(s):
> - FACTOR 0 (real) DENSE, size 5x14, density 0.5, nnz 35
> - FACTOR 1 (real) DENSE, size 14x17, density 0.470588, nnz 112
> - FACTOR 2 (real) DENSE, size 17x10, density 0.5, nnz 85
>
> @endcode
>
> <p>@b See @b also Faust.Faust, matfaust.rand_bsr.
==========================================================================================