protocol
numberlistp¶
List of numbers protocol.
static(no dependencies on other entities)
Public interface¶
max/2¶
Determines the list maximum value using arithmetic order. Fails if the list is empty.
staticmax(List,Maximum)max(+list(number),-number) - zero_or_onemin/2¶
Determines the minimum value in a list using arithmetic order. Fails if the list is empty.
staticmin(List,Minimum)min(+list(number),-number) - zero_or_oneproduct/2¶
Calculates the product of all list numbers. Fails if the list is empty.
staticproduct(List,Product)product(+list(number),-number) - zero_or_onesum/2¶
Calculates the sum of all list numbers. Returns the integer zero if the list is empty.
staticsum(List,Sum)sum(+list(number),-number) - oneaverage/2¶
Calculates the average (i.e. arithmetic mean) of a list of numbers. Fails if the list is empty.
staticaverage(List,Average)average(+list(number),-float) - zero_or_oneeuclidean_norm/2¶
Calculates the Euclidean norm of a list of numbers. Fails if the list is empty.
staticeuclidean_norm(List,Norm)euclidean_norm(+list(number),-float) - zero_or_onechebyshev_norm/2¶
Calculates the Chebyshev norm of a list of numbers. Fails if the list is empty.
staticchebyshev_norm(List,Norm)chebyshev_norm(+list(integer),-integer) - zero_or_onechebyshev_norm(+list(float),-float) - zero_or_onemanhattan_norm/2¶
Calculates the Manhattan norm of a list of numbers. Fails if the list is empty.
staticmanhattan_norm(List,Norm)manhattan_norm(+list(integer),-integer) - zero_or_onemanhattan_norm(+list(float),-float) - zero_or_oneeuclidean_distance/3¶
Calculates the Euclidean distance between two lists of numbers. Fails if the two lists are empty or not of the same length.
staticeuclidean_distance(List1,List2,Distance)euclidean_distance(+list(number),+list(number),-float) - zero_or_onechebyshev_distance/3¶
Calculates the Chebyshev distance between two lists of numbers. Fails if the two lists are empty or not of the same length.
staticchebyshev_distance(List1,List2,Distance)chebyshev_distance(+list(integer),+list(integer),-integer) - zero_or_onechebyshev_distance(+list(float),+list(float),-float) - zero_or_onemanhattan_distance/3¶
Calculates the Manhattan distance between two lists of numbers. Fails if the two lists are empty or not of the same length.
staticmanhattan_distance(List1,List2,Distance)manhattan_distance(+list(integer),+list(integer),-integer) - zero_or_onemanhattan_distance(+list(float),+list(float),-float) - zero_or_onescalar_product/3¶
Calculates the scalar product of two lists of numbers. Fails if the two lists are empty or not of the same length.
staticscalar_product(List1,List2,Product)scalar_product(+list(integer),+list(integer),-integer) - zero_or_onescalar_product(+list(float),+list(float),-float) - zero_or_onenormalize_range/2¶
Normalizes a list of numbers into the 0.0-1.0 range. Caller must handle arithmetic exceptions if the input list if not normalizable.
staticnormalize_range(List,NormalizedList)normalize_range(+list(number),-list(float)) - onenormalize_range/4¶
Normalizes a list of numbers into the given range. Caller must handle arithmetic exceptions if the input list if not normalizable.
staticnormalize_range(List,Minimum,Maximum,NormalizedList)normalize_range(+list(number),+number,+number,-list(float)) - onenormalize_unit/2¶
Normalizes a list of numbers returning its unit vector (i.e. a list with Euclidean norm equal to one). Caller must handle arithmetic exceptions if the input list if not normalizable.
staticnormalize_unit(List,NormalizedList)normalize_unit(+list(number),-list(float)) - onenormalize_scalar/2¶
Normalizes a list of numbers such that the sum of all numbers is equal to one. Caller must handle arithmetic exceptions if the input list if not normalizable.
staticnormalize_scalar(List,NormalizedList)normalize_scalar(+list(number),-list(float)) - onerescale/3¶
Rescales all numbers in a list by the given factor.
staticrescale(List,Factor,RescaledList)rescale(+list(integer),+integer,-list(integer)) - onerescale(+list(number),+float,-list(float)) - oneProtected interface¶
(none)
Private predicates¶
(none)
Operators¶
(none)