Mercurial > hg > octave-lojdl
changeset 286:9c74d7d76f3d
[project @ 1994-01-12 22:14:18 by jwe]
author | jwe |
---|---|
date | Wed, 12 Jan 1994 22:14:18 +0000 |
parents | 79a1403b8b6e |
children | 6027a905fc06 |
files | liboctave/RowVector.cc |
diffstat | 1 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/RowVector.cc +++ b/liboctave/RowVector.cc @@ -895,9 +895,20 @@ Complex operator * (const ComplexRowVector& v, const ComplexColumnVector& a) { -// XXX FIXME XXX -- need function body - assert (0); - return Complex (); + int len = v.length (); + if (len != a.length ()) + { + (*current_liboctave_error_handler) + ("nonconformant vector multiplication attempted"); + return 0.0; + } + + Complex retval (0.0, 0.0); + + for (int i = 0; i < len; i++) + retval += v.elem (i) * a.elem (i); + + return retval; } // row vector by matrix -> row vector