doc tweaks for skin

bug fixes for is_matrix, is_vector, and new tests for same
This commit is contained in:
Adrian Mariano
2021-03-14 10:25:22 -04:00
parent 9f249d9cf3
commit 35c2d7df42
5 changed files with 44 additions and 16 deletions

View File

@@ -36,7 +36,8 @@
// is_vector([1,1,1],all_nonzero=false); // Returns true
// is_vector([],zero=false); // Returns false
function is_vector(v, length, zero, all_nonzero=false, eps=EPSILON) =
is_list(v) && is_num(v[0]) && is_num(0*(v*v))
is_list_of(v,1) // is_list(v) && is_num(v[0]) && is_num(0*(v*v))
&& len(v)>0
&& (is_undef(length) || len(v)==length)
&& (is_undef(zero) || ((norm(v) >= eps) == !zero))
&& (!all_nonzero || all_nonzero(v)) ;