Skip to content

Commit

Permalink
let functions min/max/absmax work on empty matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
tesch1 committed Jul 22, 2018
1 parent a3c45bf commit 92bd10b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion EigenLab.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,10 @@ namespace EigenLab
template <typename Derived>
bool Parser<Derived>::evalFunction_1_lt(const std::string & name, Value<Derived> & arg, Value<Derived> & result, std::true_type)
{
if(name == "min") {
if(arg.matrix().size()==0) {
result.setLocal(Derived());
return true;
} else if(name == "min") {
result.setLocal(arg.matrix().minCoeff());
return true;
} else if(name == "max") {
Expand Down

0 comments on commit 92bd10b

Please sign in to comment.