compare-cell

WebJar for compare-cell

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

compare-cell
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

compare-cell
WebJar for compare-cell
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/compare-cell

Download compare-cell

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/compare-cell/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>compare-cell</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/compare-cell/
implementation 'org.webjars.npm:compare-cell:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/compare-cell/
implementation ("org.webjars.npm:compare-cell:1.0.0")
'org.webjars.npm:compare-cell:jar:1.0.0'
<dependency org="org.webjars.npm" name="compare-cell" rev="1.0.0">
  <artifact name="compare-cell" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='compare-cell', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "compare-cell" % "1.0.0"
[org.webjars.npm/compare-cell "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

compare-cell

Compares two unordered integer sequences to test if they contain the same elements. This can be used to implement various algorithms for unoriented simplicial complexes.

For more information, see the following blog post:

Comparing sequences without sorting

Example

var compareCells = require('compare-cell')
var bsearch = require('binary-search-bounds')

//Create a list of triangles defined by indexed faces
var triangles = [
  [1, 0, 2],
  [2, 1, 3],
  [3, 4, 5],
  [5, 6, 7]
]

//Sort triangles
triangles.sort(compareCells)

//Now we can test if various cells are contained in the list in O(log n)
console.log(bsearch.eq(triangles, [2, 1, 0], compareCells) >= 0)
console.log(bsearch.eq(triangles, [3, 5, 7], compareCells) >= 0)

API

var d = require('compare-cell')(a, b)

Tests if two unordered lists contain the same elements.

  • a, b are arrays of integers

Returns An order function which tests if a comes before or after b. The value is 0 if they are equal.

License

(c) 2015 Mikola Lysenko. MIT License

Versions

Version
1.0.0