~ubuntu-branches/ubuntu/utopic/blitz++/utopic

« back to all changes in this revision

Viewing changes to testsuite/arrayinitialize.cpp

  • Committer: Package Import Robot
  • Author(s): Christophe Trophime
  • Date: 2012-07-06 09:15:30 UTC
  • mfrom: (11.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120706091530-vzrb8zf0vpbf8tp9
Tags: 1:0.10-1
* New upstream release
  Closes: #679407
* debian/rules:
  - update for new release
  - add override_dh_auto_test target
  - regenerate configure and Makefile.am
* debian/control:
  - add libtool, automake to BuildDepends
* debian/libblitz-doc.install
  - modify path for html files
* remove uneeded patches
* add examples.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "testsuite.h"
 
2
#include <blitz/array.h>
 
3
 
 
4
BZ_USING_NAMESPACE(blitz)
 
5
 
 
6
int main()
 
7
{
 
8
    Array<int,1> d(5);
 
9
    d=1,-1,2,-2,0;
 
10
    BZTEST(d(0) == 1);
 
11
    BZTEST(d(1) == -1);
 
12
    BZTEST(d(2) == 2);
 
13
    BZTEST(d(3) == -2);
 
14
    BZTEST(d(4) == 0);
 
15
 
 
16
    Array<double,1> c(5);
 
17
    c=1.0,-1.0,2.0,-2.0,0.0;
 
18
    BZTEST(c(0) == 1);
 
19
    BZTEST(c(1) == -1);
 
20
    BZTEST(c(2) == 2);
 
21
    BZTEST(c(3) == -2);
 
22
    BZTEST(c(4) == 0);
 
23
    
 
24
    // and finally test initializations where implicit conversions to
 
25
    // T_numtype are necessary
 
26
 
 
27
    Array<double,1> b(5);
 
28
    b=1,-1,2,-2,0;
 
29
    BZTEST(b(0) == 1);
 
30
    BZTEST(b(1) == -1);
 
31
    BZTEST(b(2) == 2);
 
32
    BZTEST(b(3) == -2);
 
33
    BZTEST(b(4) == 0);
 
34
 
 
35
    return 0;
 
36
}
 
37