Skip to content

Commit

Permalink
Merge pull request #990 from Alex-Jordan/constant-vectors
Browse files Browse the repository at this point in the history
new context flag to require constant entries
  • Loading branch information
drgrice1 authored Feb 14, 2024
2 parents 8138d82 + 0a2d16f commit b3f45a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Parser/List/Matrix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ sub _check {
$self->{equation}->Error("Entries in a Matrix must be Numbers or Lists of Numbers")
unless ($x->type =~ m/Number|Matrix/);
}
$self->{equation}->Error("Entries of a Matrix must be constant")
if ($self->context->flag("requireConstantMatrices") && !($self->{isConstant}));
}

#
Expand Down
2 changes: 2 additions & 0 deletions lib/Parser/List/Point.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ sub _check {
$self->{equation}->Error([ "Coordinates of Points must be Numbers, not %s", $type ]);
}
}
$self->{equation}->Error("Coordinates of a Point must be constant")
if ($self->context->flag("requireConstantPoints") && !($self->{isConstant}));
}

#########################################################################
Expand Down
2 changes: 2 additions & 0 deletions lib/Parser/List/Vector.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ sub _check {
$self->{equation}->Error([ "Coordinates of Vectors must be Numbers, not %s", $type ]);
}
}
$self->{equation}->Error("Coordinates of a Vector must be constant")
if ($self->context->flag("requireConstantVectors") && !($self->{isConstant}));
}

sub ijk {
Expand Down

0 comments on commit b3f45a5

Please sign in to comment.