summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/randWrapper.c
blob: cadcc32135528be67bdd4a2e87d381086071ba3d (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
/********************************
Author: Sravanthi Kota Venkata
********************************/

#include "sdvbs_common.h"

F2D* randWrapper(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));
        }
    }

    return out;
}