ASPL Manual v 1.00
© 2024 by SetSphere.COM


13. 6
   # gets the cardinality of a set variable

 

logo

# [a1 .. aN]       where [a1 .. aN] are set variables

#

When specified by itself then display the cardinality of the dataset on the top of stack

cardinality  text  01*  notcommu        ins:H_H_H  ret:text

●  Operator # gets the cardinality of a set variable

Use the operator # to display the cardinality of a set variable. When followed by multiple set variables then show the cardinality of all set variables. To show the cardinality of the dataset resulting from the last operation, just issue # and that will show the cardinality of the last operation pushed on the top of stack.
See also the density operator see SECTION 13.18.1 [density determines the elements density of one or more set variables] .

 

# EXAMPLE
In this example we start ASPL loading the sample workspace WS1 then we issue the operator # to show how to get the cardinality of groups respresented by set variables.

 

# OPERATION

aspl WS1
    (start ASPL loading the sample workspace WS1)

①  aspl> v
    (print the symbol table)

②  aspl> # a1
    (display the cardinality of a1)

③  aspl> # a1 a2 a3
    (display the cardinality of a1 a2 a3)

④  aspl> u123 = fU a1 a2 a3
    (get the elements union of a1 a2 a3 and assign it to u123)

⑤  aspl> # u123
    (display the cardinality of u123)

⑥  aspl> ans
    (display the answer stack)

⑦  aspl> #
    (display the cardinality of the dataset on the top of stack)

⑧  aspl> U123 = gU a1 a2 a3
    (get the group union of a1 a2 a3 and assign it to U123)

⑨  aspl> # u123 U123
    (display the cardinality of u123 and U123)

⑩  aspl> density u123
    (display the density of u123)

⑪  aspl> sim u123
    (display the similarity of u123)