Mercurial > hg > may
changeset 470:25d309d90d50
Add reals, imaginaries
author | Chris Cannam |
---|---|
date | Tue, 29 Oct 2013 11:33:10 +0000 |
parents | 11c8a8e66690 |
children | 8094afddd1c9 |
files | src/may/complex.yeti |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/may/complex.yeti Fri Oct 25 17:37:05 2013 +0100 +++ b/src/may/complex.yeti Tue Oct 29 11:33:10 2013 +0000 @@ -78,6 +78,12 @@ zeros n is number -> array<~Cplx> = array (map \(complex 0 0) [1..n]); +reals cc is list?<~Cplx> -> vector = + vec.fromList (map real cc); + +imaginaries cc is list?<~Cplx> -> vector = + vec.fromList (map imaginary cc); + magnitudes cc is list?<~Cplx> -> vector = vec.fromList (map magnitude cc); @@ -99,6 +105,8 @@ scale, zero, zeros, + reals, + imaginaries, magnitudes, angles, complexArray @@ -114,6 +122,8 @@ scale is number -> cplx -> cplx, zero is cplx, zeros is number -> array<cplx>, + reals is list?<cplx> -> vector, + imaginaries is list?<cplx> -> vector, magnitudes is list?<cplx> -> vector, angles is list?<cplx> -> vector, complexArray is vector -> vector -> array<cplx>