~ubuntu-branches/ubuntu/raring/blitz++/raring

« back to all changes in this revision

Viewing changes to compiler/restric2.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-02-28 20:25:01 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050228202501-3i4f2sknnprsqfhz
Tags: 1:0.8-4
Added missing build-depends (Closes: #297323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// egcs support for restrict, but as "__restrict__"
2
 
// BZ_NCEG_RESTRIC2
3
 
 
4
 
void add(int length, double * __restrict__ a, const double * __restrict__ b,
5
 
    const double * __restrict__ c)
6
 
{
7
 
    for (int i=0; i < length; ++i)
8
 
        a[i] = b[i] + c[i];
9
 
}
10
 
 
11
 
int main()
12
 
{
13
 
    double a[10], b[10], c[10];
14
 
    for (int i=0; i < 10; ++i)
15
 
    {
16
 
        a[i] = 0.;
17
 
        b[i] = 0.;
18
 
        c[i] = 0.;
19
 
    }
20
 
 
21
 
    add(10,a,b,c);
22
 
    return 0;
23
 
}
24