Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
tutorial:perl_continued [2017/07/11 08:56] – removed typos oroehrig | tutorial:perl_continued [2017/07/11 09:04] – oroehrig | ||
---|---|---|---|
Line 110: | Line 110: | ||
===" | ===" | ||
+ | A big object is an instance of a data type which represents a mathematical concept with clear semantics. They may have template parameters. Big objects have properties which come with a type, which is either built-in or a small object type or a big object type, and which can be accessed using the '' | ||
< | < | ||
> $p=new Polytope< | > $p=new Polytope< | ||
> $lp=new LinearProgram< | > $lp=new LinearProgram< | ||
+ | > # access the property named '' | ||
> $p-> | > $p-> | ||
+ | > # properties can have properties themselves. | ||
> print $p-> | > print $p-> | ||
</ | </ | ||
Line 119: | Line 122: | ||
{{: | {{: | ||
< | < | ||
- | > open(INPUT, "< $HOME/ | + | open(INPUT, "< $HOME/ |
- | > $matrix=new Matrix< | + | $matrix=new Matrix< |
- | > close(INPUT); | + | close(INPUT); |
- | > print $matrix; | + | print $matrix; |
- | > | + | |
- | > $p=new Polytope< | + | $p=new Polytope< |
- | > print $p-> | + | print $p-> |
- | > print $p-> | + | print $p-> |
- | > print $p-> | + | print $p-> |
- | > ### choose " | + | ### choose " |
- | > for(my $i=0; | + | for(my $i=0; |
- | > if($p-> | + | if($p-> |
- | > print $i.": " | + | print $i.": " |
- | > } | + | } |
- | > } | + | } |
- | > $s=new Set< | + | $s=new Set< |
- | > for(my $i=0; | + | for(my $i=0; |
- | > if($p-> | + | if($p-> |
- | > $s+=$i; | + | $s+=$i; |
- | > } | + | } |
- | > } | + | } |
- | > $special_points=$p-> | + | $special_points=$p-> |
- | > | + | |
- | > foreach(@{$s}){ | + | foreach(@{$s}){ |
- | > print $p-> | + | print $p-> |
- | > } | + | } |
- | > foreach my $index(@{$s}){ | + | foreach my $index(@{$s}){ |
- | > print $p-> | + | print $p-> |
- | > } | + | } |
</ | </ | ||
- | ===Scripts=== | + | ===Scripts=== |
[[scripting: | [[scripting: |