source: Sophya/trunk/SophyaExt/Blitz/globals.cc@ 3005

Last change on this file since 3005 was 221, checked in by ansari, 26 years ago

Creation module DPC/Blitz (blitz 0.4) Reza 09/04/99

File size: 1.2 KB
RevLine 
[221]1#define BZ_GENERATE_GLOBAL_INSTANCES
2
3/*
4 * This module contains instances of global variables and objects.
5 * The preprocessor symbol _bz_global normally expands to "extern",
6 * but the declaration of BZ_GENERATE_GLOBAL_INSTANCES causes it
7 * to expand to "" for this source file. This ensures that globals
8 * will have one unique instance, in libblitz.a.
9 */
10
11#include <blitz/indexexpr.h> // Tensor index objects
12#include <blitz/bzdebug.h> // Test suite globals
13#include <blitz/array.h> // Dummy array object (_dummyArray)
14
15// NEEDS_WORK: after switch from RCS to CVS, get a version identifier.
16char* _blitz_id = "@(#) Blitz++ class library";
17
18// Instatiation explicite de vecteurs et matrices
19
20using namespace blitz ;
21
22void tst_instance_arrays_forlibs()
23{
24Array<int,1> iv(3), iv2(3);
25Array<long,1> lv(3), lv2(3);
26Array<float,1> fv(3), fv2(3);
27Array<double,1> dv(3), dv2(3);
28Array<int,2> im(3,3);
29Array<long,2> lm(3,3);
30Array<float,2> fm(3,3);
31Array<double,2> dm(3,3);
32dv = 1.5, 22.66, 333.777;
33dm = 9.1, 88.22, 777.333,
34 8.2, 77.33, 666.444,
35 7.3, 66.44, 555.333;
36firstIndex i;
37secondIndex j;
38dv2 = sum(dm(i,j)*dv(j),j);
39iv = lv = fv = dv;
40im = lm = fm = dm;
41fv2 = sum(fm(i,j)*fv(j),j);
42iv2 = sum(im(i,j)*iv(j),j);
43lv2 = sum(lm(i,j)*lv(j),j);
44}
Note: See TracBrowser for help on using the repository browser.