Transpose
Installation
$ npm install compute-transpose
For use in the browser, use browserify.
Usage
var transpose = ;
transpose( x[, opts] )
Computes the transpose of a matrix.
var matrix = ;var mat = ;/*[ 0 0 00 0 0 ]*/var t = ;/*[ 0 00 00 0 ]*/
By default, the function returns a new matrix instance. To mutate the input matrix, set the copy
option to false
.
var t =;/*[ 0 00 00 0 ]*/var bool = mat === t ;// returns true
Examples
var matrix =transpose = ;var datamatt i;data = 10 ;for i = 0; i < datalength; i++data i = i;mat = ;/*[ 0 12 34 56 78 9 ]*/t = ;/*[ 0 2 4 6 81 3 5 7 9 ]*/
To run the example code from the top-level application directory,
$ node ./examples/index.js
Tests
Unit
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
Test Coverage
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
License
Copyright
Copyright © 2015. The Compute.io Authors.