Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [viatra-dev] sum "function" in pattern language

Hi,
 
for a long time, we have had plans for adding more kinds of aggregate functions beyond just count.
Ideas include min/max, sum, average.
 
None of this has been implemented yet, unfortunately.
 
Cheers
Gábor
 
 
Sent: Friday, March 25, 2016 2:09 PM
Subject: [viatra-dev] sum "function" in pattern language
 
Hi,
 
I have some questions about the pattern language and query based features.
 
1) Can I calculate the sum of given numbers (integers, floats, etc.) using only the pattern language?
 
My best idea is only working for integers in a given range, e.g.:
 
N1 = count find classWithInteger(_,1);
N2 = count find classWithInteger(_,2);
...
SUM = eval(N1+2*N2...);
 
2) My second question is that currently query based features with the kind "SUM" only supports integers. Is there a plan to make it work with other primitive types such as long and float?
 
Thanks in advance!
 
Cheers,
András


_______________________________________________
viatra-dev mailing list
viatra-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/viatra-dev
 

Back to the top