You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On left side: bool,int,double, Logical, Integer or Numeric
On right side: bool,int,double, Logical, Integer,Numeric or an expression.
Ignore self assignment e.g. a = a. Throw an error in R.
Define c code for a scalar on left side:
vm -> scalarNum[idx] = ...
define c code for a Vector on left side:
vm -> numerics[vecIdx] -> data[i] = ...
Check whether the variable to which the result get assigned is found on the rhs. In case it is found use the temp vectors I.e. the c code from the last bullet point. Otherwise define c code where the result of an expression is directly stored in the variable at lhs.
Throw error in R if expression is on left side.
Deduce types of expressions on rhs. Check each type of the variables directly involved in the calculation of the result. Thus, ignore for example variables passed to cmr or subsetting. Take the most flexible type which is found. Double > int> bool. If at least one double is found than the type of the expression is double. If no double but at least one integer is found than the type is integer. If only boils are found than the type is bool
Check types of lhs and rhs. Add required casts. Each element of the rhs directly involved in calculating the result which has a different type than the lhs has to be casted. Thus,for the term a = b*c[d] where a is of type Numeric, b is of type Integer, c is of type Numeric and d is of type Integer, b has to be casted but not d.
The text was updated successfully, but these errors were encountered:
On left side: bool,int,double, Logical, Integer or Numeric
On right side: bool,int,double, Logical, Integer,Numeric or an expression.
vm -> scalarNum[idx] = ...
vm -> numerics[vecIdx] -> data[i] = ...
The text was updated successfully, but these errors were encountered: