| Author |
Message |
EMebane
Joined: Apr 15, 2019 Posts: 124
|
Posted: Apr 17, 2026 4:31 AM Post subject: Object ExpressionEvaluator inputs |
|
Can the Object ExpressionEvaluator take floats? In a stripped down sample I'm getting a compile error: float in = (float) In1;
If it can, do all inputs to an Object ExpressionEvaluator have to be the same type?
i.e., I want to send an array as In1 and a couple scalars as In2 and In3. I get a compilation error when I try to pass the scalars after the array, but no compilation error when I pass the same type. float[] in = (float[])In1; float[] in2 = (float[])In2;
Will I have to add the scalars to an array before passing to the ExpressionEvaluator as In2 after I pass a float[] as In1? |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1087
|
Posted: Apr 17, 2026 2:19 PM Post subject: |
|
Yes, but you need to operate on java Object structures, not numbers directly. So you should be able to do this:
float in = (Float) In1;
The "Float" is object, "float" is number. In that case once the In1 is cast to Float object it will unbox automatically to float. You could also do ((Float) In1).floatValue()
Yes, you can mix different types, but they all need to be objects, not numbers directly.
Arrays of numbers are OK. In case of BioEra number vectors, the input must be cast to float[] (or int[] or double[])
|
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1087
|
Posted: Apr 17, 2026 2:27 PM Post subject: |
|
ObjectExpressionEvaluator is maybe the most powerful element in BioEra. Once you figure out the types and casting you can process everything there and create full programs this way.
If you prefer to test an algoritm outsite of bioera - do it in external IDE. Then package it as extlibs.jar and access directly in BioEra expression. |
|