Mercurial > hg > may
changeset 468:38a35e4b41c5
Row/column vector construction
author | Chris Cannam |
---|---|
date | Fri, 25 Oct 2013 16:56:03 +0100 |
parents | a9376197529d |
children | 11c8a8e66690 |
files | src/may/matrix/complex.yeti |
diffstat | 1 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/may/matrix/complex.yeti Fri Oct 25 16:55:48 2013 +0100 +++ b/src/may/matrix/complex.yeti Fri Oct 25 16:56:03 2013 +0100 @@ -208,10 +208,18 @@ esac; newComplexMatrix type data = - (newPart f type d = + (newPart f = mat.newMatrix type (map do cc: vec.fromList (map f cc) done data); - complex (newPart cpx.real type data) (newPart cpx.imaginary type data)); + complex (newPart cpx.real) (newPart cpx.imaginary)); + +newComplexRowVector data = + (newPart f = mat.newRowVector (vec.fromList (map f data)); + complex (newPart cpx.real) (newPart cpx.imaginary)); + +newComplexColumnVector data = + (newPart f = mat.newColumnVector (vec.fromList (map f data)); + complex (newPart cpx.real) (newPart cpx.imaginary)); enumerate cm = (enhash h p proto ix = @@ -260,6 +268,8 @@ rowSlice, columnSlice, newComplexMatrix, + newComplexRowVector, + newComplexColumnVector, enumerate, } as { size is complexmatrix -> { .rows is number, .columns is number }, @@ -291,6 +301,8 @@ rowSlice is complexmatrix -> number -> number -> complexmatrix, columnSlice is complexmatrix -> number -> number -> complexmatrix, newComplexMatrix is (ColumnMajor () | RowMajor ()) -> list?<list?<cplx>> -> complexmatrix, + newComplexRowVector is list?<cplx> -> complexmatrix, + newComplexColumnVector is list?<cplx> -> complexmatrix, enumerate is complexmatrix -> list<{ .i is number, .j is number, .v is cplx }>, }