File: MuVector.t

package info (click to toggle)
bioperl 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,768 kB
  • ctags: 12,005
  • sloc: perl: 174,299; xml: 13,923; sh: 1,941; lisp: 1,803; asm: 109; makefile: 53
file content (34 lines) | stat: -rw-r--r-- 862 bytes parent folder | download
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
# $Id: MuVector.t 15112 2008-12-08 18:12:38Z sendu $
use strict;

BEGIN {
  use lib '.';
  use Bio::Root::Test;

  test_begin(-tests => 8);

  use_ok('Bio::PhyloNetwork::muVector');
}

my $vec1=Bio::PhyloNetwork::muVector->new(4);
my $vec2=Bio::PhyloNetwork::muVector->new([1,2,3,4]);
isa_ok($vec1,'Bio::PhyloNetwork::muVector');
isa_ok($vec1,'Bio::PhyloNetwork::muVector');

my $vec3=-1*$vec2;
my $vec4=$vec3+$vec2;

is($vec4 cmp $vec1,0,'arithmetic');
ok($vec2->display() eq "(1 2 3 4)",'display');
ok($vec2->is_positive(),'is_positive');

my $vec5=Bio::PhyloNetwork::muVector->new([2,3,5,0,77]);
my $vec6=Bio::PhyloNetwork::muVector->new([2,3,4,5,-7]);

ok($vec5->geq_poset($vec6) == 0,'geq_poset');

my $vec7=Bio::PhyloNetwork::muVector->new([2,3,5,0,77]);
my $vec8=Bio::PhyloNetwork::muVector->new([2,3,4,-1,-7]);

ok($vec7->geq_poset($vec8),'geq_poset');