nat_vel_plus_vel_cpp {dbnR} | R Documentation |
Adds two natVelocities
Description
Adds two natVelocities represented as two numeric vectors: one with the positive part and one with the negative part. Adding them is a process that does a bitwise 'or' with both the positive and negative parts of the two velocities, adjusts the new abs_op, removes duplicated arcs in the final velocity by using a bitwise 'xor' with both parts and adjusts the final abs_op. The results are returned via modifying the original vl1 and vl1_neg by reference and returning the final abs_op normally. I can't have an integer edited by reference because it automatically gets casted and cannot be used to return values.
Usage
nat_vel_plus_vel_cpp(vl1, vl1_neg, vl2, vl2_neg, abs_op1, abs_op2)
Arguments
vl1 |
the first Velocity's positive part |
vl1_neg |
the first Velocity's negative part |
vl2 |
the second Velocity's positive part |
vl2_neg |
the first Velocity's negative part |
abs_op1 |
the number of 1,-1 operations in the first velocity |
abs_op2 |
the number of 1,-1 operations in the second velocity |
Value
the total number of resulting operations