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

« back to all changes in this revision

Viewing changes to doc/examples/cast.texi

  • 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
#include <blitz/array.h>
 
2
#include <blitz/funcs.h>
 
3
 
 
4
using namespace blitz;
 
5
 
 
6
int main()
 
7
@{
 
8
    Array<int,1> A(4), B(4);
 
9
    Array<float,1> C(4);
 
10
 
 
11
    A = 1, 2, 3, 5;
 
12
    B = 2, 2, 2, 7;
 
13
 
 
14
    C = A / B;
 
15
    cout << C << endl;
 
16
 
 
17
#ifdef BZ_NEW_EXPRESSION_TEMPLATES
 
18
    C = A / cast<float>(B);
 
19
#else
 
20
    C = A / cast(B, float());
 
21
#endif
 
22
    cout << C << endl;
 
23
 
 
24
    return 0;
 
25
@}
 
26