# HG changeset patch # User Chris Cannam # Date 1382716563 -3600 # Node ID 38a35e4b41c5b8ed897591f808e2d57b4f061ec6 # Parent a9376197529db4b594aa7a2d4526c9ee9daaa2d5 Row/column vector construction diff -r a9376197529d -r 38a35e4b41c5 src/may/matrix/complex.yeti --- 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?> -> complexmatrix, + newComplexRowVector is list? -> complexmatrix, + newComplexColumnVector is list? -> complexmatrix, enumerate is complexmatrix -> list<{ .i is number, .j is number, .v is cplx }>, }