Opened 12 years ago
Closed 8 years ago
#317 closed defect (fixed)
WCPS1.5_WCPS and complex numbers
Reported by: | Piero Campalani | Owned by: | Alex Dumitru |
---|---|---|---|
Priority: | minor | Milestone: | 9.3 |
Component: | petascope | Version: | development |
Keywords: | wcps complex numbers | Cc: | |
Complexity: | Hard |
Description
WCPS does not seem to support complex operations with numbers.
Casting is not implemented yet in the RasQL (QL guide, p.53 Restrictions), and although WCPS complexConstant
can be defined (with static numbers):
complexConstant returns[String value] : LPAREN re1=FLOATCONSTANT COMMA im1=FLOATCONSTANT RPAREN { $value = new String($re1.text +"+i"+$im1.text); } ;
they don't seem to work:
for c in (mr) return (0.1, 0.1) Error: Invalid coverage Expression, next node: complexConstant
Looking at petascope.wcps.grammar.wcps.g
, complex expressions seems allowed only inside a USING clause:
03 06 2009 andreia Complex expressions introduced in the "using" clause of general condense operations
but this neither seem to work:
for c in (mr) return encode( coverage complexNumber over $x x (0:0), $y y (0:0) values condense + over $x x (0:0), $y y (0:0) using (0.1, 0.1), "csv") Error: Invalid coverage Expression, next node: condense - failed to match SubsetOperation: condense
This might deserve some effort at some point.
Change History (4)
comment:1 by , 9 years ago
Complexity: | → Very Hard |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 9 years ago
Complexity: | Very Hard → Hard |
---|---|
Summary: | WCPS and complex numbers → WCPS1.5_WCPS and complex numbers |
comment:3 by , 8 years ago
Milestone: | Future → 9.3 |
---|---|
Version: | 8.3 → development |
This query works in WCPS 1.5
for c in (mr) return encode(coverage complexNumber over $x x (0:1),$y y (0:1) values condense + over $x x (0:1),$y y (0:1) using (0.1, 0.1),"csv")&wcpsVersion=2.0
and this works also
for c in (mr) return (0.1, 0.1)
but it has error with Rasql support complex number http://rasdaman.org/ticket/794
Close ticket here as it was fixed in WCPS 1.5.
comment:4 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Piero,
Your second example works in WCPS1.5, but first example does not work. I've opened a ticket for this problem http://rasdaman.org/ticket/1261.
i.e, query will be translated to Rasql like:
to Rasql:
In WCPS1.5 grammar and WCPS1.0 document, ComplexConstant belonged to "numericScalarExpr", then it can also work like this, beside "using" clause in condenser.
but returns error
then in WCPS1.5, this ticket will need to fix this problem with Complex Numbers in Numerical Scalar Expression.