Beispiel #1
0
/* initialize global vectors V1,V2 for subsequent use */
void setupvectors(int len)
{
    int i;
    V1 = new_vec(len);
    V2 = new_vec(len);
    for (i = 0; i < len; i++)
    {
	set_vec_element(V1, i, i+1);   /* arbitrary values */
	set_vec_element(V2, i, len-i);
    }
}
Beispiel #2
0
static void setup(int cnt)
{
    int i;
    data = new_vec(cnt);
    /* Initialize array  */
    for (i = 0; i < cnt; i++) 
#if 0
	/* This runs into overflow inefficiencies with FLOAT PROD */
	set_vec_element(data, i, (data_t) (i+1));
#else
    set_vec_element(data, i, (data_t) (random() & 0x1) ? -1 : 1);
#endif
    sink = (data_t) 0;
}