hadamard-matrix

1.0.3 • Public • Published

Hadamard matrix

A Hadamard matrix generator of order n using memoization.

Install

$ npm install hadamard-matrix --save

## Usage

var hadamard = require('hadamard-matrix')
 
hadamard(1)
//=> return [1]
 
hadamard(2)
//=> return [
//           [ 1,  1 ],  
//           [ 1, -1 ]
//          ]
 
hadamard(4)
//=> return [
//           [ 1,  1,  1,  1 ],  
//           [ 1, -1,  1, -1 ],
//           [ 1,  1, -1, -1 ],  
//           [ 1, -1, -1,  1 ],
//          ]

API

hadamard(order)

order

Required
Type: number

Order of the Hadamard matrix it will return. It could´t be a odd number.

result

Type: object

Result will be a matrix with entries ± 1.

Information

You can read information about Hadamard matrix in https://en.wikipedia.org/wiki/Hadamard_matrix

License

MIT © tommytrg.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    2
  • 1.0.2
    1
  • 1.0.1
    0
  • 1.0.0
    1

Package Sidebar

Install

npm i hadamard-matrix

Weekly Downloads

4

Version

1.0.3

License

ISC

Last publish

Collaborators

  • tommytrg