blob: 4701b0e8abeb7d0d993d5c66ea936610c3580a49 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/********************************
Author: Sravanthi Kota Venkata
********************************/
#include "sdvbs_common.h"
#include <math.h>
F2D* randnWrapper(int m, int n)
{
F2D *out;
float seed;
int i,j;
out = fSetArray(m, n, 0);
seed = 0.9;
for(i=0; i<m; i++)
{
for(j=0; j<n; j++)
{
if(i<j)
subsref(out,i,j) = seed * ((i+1.0)/(j+1.0));
else
subsref(out,i,j) = seed * ((j+1.0)/(i+1.0));
}
}
for(i=0; i<m ;i++)
{
for(j=0; j<n; j++)
{
float w;
w = subsref(out,i,j);
w = ((-2.0 * log(w))/w);
subsref(out,i,j) = w;
}
}
return out;
}
|