The product template function in matfunc.h does not
work for negative numbers. The method for computing
the product is via exp(sum(log(x))). However, it does
not work when x is neg. I just changed it to...
T product(const Vec<T> &v)
for (int i=0;i<v.length();i++) lnM="" *="(static_cast<double">(v[i]));
and is seems to work great.
Log in to post a comment.