Skip to content

Commit 9093018

Browse files
committed
cleanup from PR#1216 review
1 parent 2c51a87 commit 9093018

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

lib/Value/Matrix.pm

+7-19
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,7 @@ sub isOne {
417417
}
418418
} else {
419419
for my $row (@{ $self->{data} }) {
420-
if (!$row->isOne) {
421-
return 0;
422-
}
420+
return 0 unless $row->isOne;
423421
}
424422
}
425423
return 1;
@@ -469,9 +467,7 @@ sub isUpperTriangular {
469467
}
470468
} else {
471469
for my $row (@{ $self->{data} }) {
472-
if (!$row->isUpperTriangular) {
473-
return 0;
474-
}
470+
return 0 unless $row->isUpperTriangular;
475471
}
476472
}
477473
return 1;
@@ -498,9 +494,7 @@ sub isLowerTriangular {
498494
}
499495
} else {
500496
for my $row (@{ $self->{data} }) {
501-
if (!$row->isLowerTriangular) {
502-
return 0;
503-
}
497+
return 0 unless $row->isLowerTriangular;
504498
}
505499
}
506500
return 1;
@@ -536,9 +530,7 @@ sub isSymmetric {
536530
}
537531
} else {
538532
for my $row (@{ $self->{data} }) {
539-
if (!$row->isSymmetric) {
540-
return 0;
541-
}
533+
return 0 unless $row->isSymmetric;
542534
}
543535
}
544536
return 1;
@@ -587,15 +579,13 @@ sub isREF {
587579
}
588580
} else {
589581
for my $row (@{ $self->{data} }) {
590-
if (!$row->isREF) {
591-
return 0;
592-
}
582+
return 0 unless $row->isREF;
593583
}
594584
}
595585
return 1;
596586
}
597587

598-
=head3 C<isREF>
588+
=head3 C<isRREF>
599589
600590
Check if a Matrix is in reduced row echelon form (for degree > 2, applies to frontal slice matrices)
601591
@@ -630,9 +620,7 @@ sub isRREF {
630620
}
631621
} else {
632622
for my $row (@{ $self->{data} }) {
633-
if (!$row->isRREF) {
634-
return 0;
635-
}
623+
return 0 unless $row->isREF;
636624
}
637625
}
638626
return 1;

0 commit comments

Comments
 (0)