Fixed calls to vmul() with heteerogenous vector sizes.

This commit is contained in:
Garth Minette
2020-08-02 23:23:50 -07:00
parent 59aebd33ce
commit e56f953c1c
8 changed files with 26 additions and 24 deletions

View File

@@ -64,13 +64,10 @@ function vang(v) =
// Example:
// vmul([3,4,5], [8,7,6]); // Returns [24, 28, 30]
function vmul(v1, v2) =
// this thighter check can be done yet because it would break other codes in the library
// assert( is_vector(v1) && is_vector(v2,len(v1)), "Incompatible vectors")
assert( is_vector(v1) && is_vector(v2), "Invalid vector(s)")
assert( is_vector(v1) && is_vector(v2,len(v1)), "Incompatible vectors")
[for (i = [0:1:len(v1)-1]) v1[i]*v2[i]];
// Function: vdiv()
// Description:
// Element-wise vector division. Divides each element of vector `v1` by