File: pdltest.c

package info (click to toggle)
pdl 1%3A2.025-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,768 kB
  • sloc: perl: 43,919; fortran: 13,113; ansic: 9,366; makefile: 37; sh: 32; sed: 6
file content (49 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

/* A small test program for the new create / delete routines */

int main() {
	pdl *bar;
	pdl *foo = pdl_create(PDL_PERM);
	int inds[2] = {1,1};
	pdl_dump(foo);

	pdl_reallocdims(foo,2);
	foo->dims[0] = 5;
	foo->dims[1] = 6;
	pdl_reallocphysdata(foo);

	pdl_dump(foo);

	bar = pdl_createtrans(foo, pdl_affine_rectslice_transvtable);
	pdl_dump(bar);
	pdl_trans_affine_rectslice *trans =
		   ((pdl_trans_affine_rectslice *)(foo->trans));

	trans->starts[0] = 1;
	trans->ends[0] = 3;

	trans->starts[1] = 2;
	trans->ends[1] = 4;
	trans->steps[1] = 2;

	pdl_transchanged(bar);

	pdl_dump(bar);

	pdl_make_physical_affine(bar);

	pdl_dump(bar);

	pdl_make_physical(bar);

	pdl_dump(bar);

	pdl_set(bar,2.0,inds);
	pdl_changed(bar);

	pdl_dump(foo);

	pdl_make_physical_affine(foo);
}