mdaquin / binary_vector_operations_js

A simple js class to represent potentially large binary vectors as integers, and realise operations such as intersection through basic binary operations for efficiency. Used in FCA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Efficient binary vector operations in Javascript

This is a simple javascript class to represent potentially large binary vectors as a set of integers, and realise operations such as intersection through basic binary operations for efficiency. This was developped based on the need of using formal concept analysis (FCA) in javascript efficiently.

Usage is relatively simple: Instanciate the class with an actual binary vector (i.e. an array of booleans) and apply operations, for example:

var bv1 = new BinaryVector([false,false,true,true,true,true]);
var bv2 = new BinaryVector([true,false,true,true,false,false]);
var bv1ibv2 = bv1.intersection(bv2);
console.log(bv1ubv2.toString());

See test.html for basic tests. This was also tested on an FCA framework (TBC).

About

A simple js class to represent potentially large binary vectors as integers, and realise operations such as intersection through basic binary operations for efficiency. Used in FCA.

License:MIT License


Languages

Language:HTML 86.2%Language:JavaScript 13.8%