ndarray-complex

Complex arithmetic for ndarrays

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ndarray-complex
401.0.39 years ago11 years agoMinified + gzip package size for ndarray-complex in KB

Readme

ndarray-complex
Complex arithmetic operations for ndarrays.

Example

var ndarray = require("zeros")
var cops = require("ndarray-complex")

//Generate some arrays
var a_r = zeros([10, 10])
  , a_i = zeros([10, 10])
  , b_r = zeros([10, 10])
  , b_i = zeros([10, 10])
  , c_r = zeros([10, 10])
  , c_i = zeros([10, 10])
  
//  ... do stuff ...

//Multiply a and b, storing result in c:
cops.mul(c_r, c_i, a_r, a_i, b_r, b_i)

Install

npm install ndarray-complex
API
The API follows the same conventions as ndarray-ops. The following methods are exposed:
  • adds,eq,seq - Addition
  • subs,eq,seq - Subtraction
  • negeq - Negation
  • muls,eq,seq - Multiplication
  • divs,eq,seq - Division
  • recipeq - Reciprocal
  • conjeq - Complex conjugate
  • expeq - Complex exponent
  • mag - Complex magnitude (squared length)
  • abs - Complex length
  • arg - Complex argument
Credits
(c) 2013 Mikola Lysenko. MIT License