# solutionsWithMultiplicity -- replaces clusters of approximately equal points by single points with multiplicity

## Synopsis

• Usage:
M = solutionsWithMultiplicity S
• Inputs:
• Optional inputs:
• Tolerance => ..., default value .000001, the tolerance of a numerical computation
• Outputs:
• M, points with a multiplicity field

## Description

Clusters the points and outputs a list with one point p per cluster with p.Multiplicity equal to the size of the cluster. If the multiplicity is not 1, then p.SolutionStatus is set to Singular; otherwise, it is inherited from one of the points in the cluster.

Whether two points are approximately equal is decided by the function areEqual that depends on Tolerance.

 i1 : a = point {{0,1}} o1 = a o1 : Point i2 : b = point {{0.000000001,1+0.00000000001*ii}} o2 = b o2 : Point i3 : c = point {{0.001*ii,1}} o3 = c o3 : Point i4 : M = solutionsWithMultiplicity {a,b,c} o4 = {a, c} o4 : List i5 : peek M o5 = {Point{Coordinates => {0, 1}}, Point{Coordinates => {.001*ii, 1}}} Multiplicity => 2 Multiplicity => 1

## Caveat

A point in a cluster may be farther than Tolerance from another point in the cluster. (In that case there has to be another point in the cluster that is within the Tolerance.)

## Ways to use solutionsWithMultiplicity :

• "solutionsWithMultiplicity(List)"

## For the programmer

The object solutionsWithMultiplicity is .