Table of Contents

Search

  1. Preface
  2. RulePoint
  3. RulePoint Concepts
  4. Using RulePoint
  5. RulePoint Objects
  6. Working with Topics
  7. Working with Connections
  8. Working with Sources
  9. Working with Responders
  10. Working with Responses
  11. Working with Watchlists
  12. Working with Analytics
  13. DRQL
  14. Working with Rules
  15. Working with Alerts
  16. Setting Access Controls
  17. Troubleshooting RulePoint Issues
  18. Connecting to an Ultra Messaging Application
  19. Creating an Ultra Messaging JMS Source

User Guide

User Guide

Lists as Arguments for Infix Math Operators

Lists as Arguments for Infix Math Operators

You can use list arguments for infix notations in RulePoint.
The infix math operators take two arguments, left hand side and right hand side. You cannot use a nested list as left hand side argument in a math infix operation. The left hand size is a single list that determines the number of items in each result list. The right hand side determines the structure of the result in terms of number of lists.
For example,
[1,2,3] * [3,4] = [3,6,9],[4,8,12]
means that each result list has three items, as determined by the left hand size, and there are two three-item list as determined by the right hand side.
Lists as math arguments affect the following math functions:
  • addition (a+b)
  • subtraction (a-b)
  • division (a/b)
  • multiplication (a*b)
  • power(a,b)
  • Modulo, mod(a,b)
For example, let us calculate (a*b) where a=[1,2,3] and b=[[3,4],[4,5]]. You can write the arguments as shown in the following table:
a
b
1
3, 4
2
4, 5
3
-
You can do the following basic computation of (a*b):
[[1*3,2*3, 3*3],[1*4, 2*4, 3*4]],[[1*4,2*4,3*4], [1*5,2*5, 3*5]]]
The result of the computation is as follows:
[[3,6,9],[4,8,12]],[[4,8,12],[5,10,15]]]
To compute power and modulo, power(a,b) or mod(a,b), see the following examples.
The following example describes how to use the modulo operator:
mod(2,[2,3])=[0,1])
The following example describes how to use the power operator:
power(2,[2,3])=[4,8])

0 COMMENTS

We’d like to hear from you!