#matrix #half #group

half_matrix

A Half Matrix implementation. Used mostly to represent many to many boolean representations. For example, if you have A, B, C. You can say (B, A) = true and the rest = false. See the docs.rs page or the github repository for more information

4 releases

0.2.1 Jan 1, 2019
0.2.0 Dec 18, 2018
0.1.1 Dec 18, 2018
0.1.0 Dec 18, 2018

#13 in #half

Apache-2.0

7KB
92 lines

Half Matrix

A Half Matrix implementation. Like a normal matrix, but you only store half of it. Also it only contains bools.

Half Matrix: Storage

The matrix is row major. Here's how it looks like:

 ABCD
A-
B--
C---
D----

In memory representation:

-|--|---|----

Indexing starts at 0.

ABCD
0123

Row Major means that the first parameter of the methods is the Y axis in the matrix, and the second is the X axis.

As shown by the matrix, the row value is required to be bigger or equal to the column value.

Example

Parameters: (3, 0) = (D, A)

 ABCD
A-
B--
C---
DX---

Contributing

If you see a missing method or a bug, open a pull request and I'll be more than happy to merge it!


lib.rs:

Half matrix storage, Row major

 ABCD
A-
B--
C---
D----

In memory representation:

-|--|---|----

Indexing starts at 0.

ABCD
0123

Row Major means that the first parameter of the methods is the Y axis in the matrix, and the second is the X axis.

As shown by the matrix, the row value is required to be bigger or equal to the column value.

Example

Parameters: (3, 0) = (D, A)

 ABCD
A-
B--
C---
DX---

Dependencies

~175KB