~ubuntu-branches/ubuntu/lucid/pdl/lucid

« back to all changes in this revision

Viewing changes to t/foo.t

  • Committer: Bazaar Package Importer
  • Author(s): Ben Gertzfield
  • Date: 2002-04-08 18:47:16 UTC
  • Revision ID: james.westby@ubuntu.com-20020408184716-0hf64dc96kin3htp
Tags: upstream-2.3.2
ImportĀ upstreamĀ versionĀ 2.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
use PDL::LiteF;
 
4
 
 
5
kill INT,$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging.
 
6
 
 
7
sub ok {
 
8
        my $no = shift ;
 
9
        my $result = shift ;
 
10
        if($ENV{PDL_T}) {
 
11
                if($result) { print "ok $no\n";return }
 
12
                my ($p,$f,$l) = caller;
 
13
                print "FAILED TEST $no AT $p $f $l\n";
 
14
        } else {
 
15
                print "not " unless $result ;
 
16
                print "ok $no\n" ;
 
17
        }
 
18
}
 
19
 
 
20
print "1..9\n";
 
21
 
 
22
# PDL::Core::set_debugging(1);
 
23
 
 
24
# Test basic use of foomethod.
 
25
 
 
26
$a = zvals zeroes 2,2,50;
 
27
 
 
28
$b = $a->oneslice(2,10,2,5);
 
29
 
 
30
ok(1,$b->at(0,0,0) == 10);
 
31
ok(2,$b->at(0,0,1) == 12);
 
32
ok(3,$b->at(0,0,4) == 18);
 
33
 
 
34
$t = $b->get_trans;
 
35
 
 
36
$t->call_trans_foomethod(11,3,6);
 
37
 
 
38
$b->make_physical();
 
39
 
 
40
ok(4,$b->at(0,0,0) == 11);
 
41
ok(5,$b->at(0,0,1) == 14);
 
42
ok(6,$b->at(0,0,2) == 17);
 
43
ok(7,$b->at(0,0,3) == 20);
 
44
ok(8,$b->at(0,0,4) == 23);
 
45
ok(9,$b->at(0,0,5) == 26);
 
46
 
 
47
# Now, start making affine stuffs...
 
48
# not yet.
 
49
exit(0);
 
50
 
 
51
print $a->slice("(0),(0)"),"\n";
 
52
$a0 = $a->slice("(0),(0)")->copy;
 
53
 
 
54
print $b;
 
55
$b->dump;
 
56
$b += 1;
 
57
$b->dump;
 
58
print $b;
 
59
 
 
60
print $a->slice("(0),(0)"),"\n";
 
61
$a1 = $a->slice("(0),(0)")->copy;
 
62
 
 
63
print $a1-$a0,"\n";
 
64
 
 
65
$t->call_trans_foomethod(11,6,6);
 
66
 
 
67
print $b->slice("(0),(0)"),"\n";
 
68
print $a->slice("(0),(0)"),"\n";