mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Change uses of scm_is_simple_vector to scm_is_vector
* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c, libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector. * libguile/sort.c (scm_sort_x, scm_sort, scm_stable_sort_x) (scm_stable_sort): Remove scm_is_vector check; scm_is_array is sufficient. * test-suite/tests/arrays.test: Fix header. * test-suite/tests/random.test: New coverage test covering random:normal-vector!. * test-suite/Makefile.am: Include random.test in make check.
This commit is contained in:
parent
a32488ba13
commit
d747313100
9 changed files with 76 additions and 27 deletions
|
@ -504,7 +504,7 @@ static void
|
|||
vector_scale_x (SCM v, double c)
|
||||
{
|
||||
size_t n;
|
||||
if (scm_is_simple_vector (v))
|
||||
if (scm_is_vector (v))
|
||||
{
|
||||
n = SCM_SIMPLE_VECTOR_LENGTH (v);
|
||||
while (n-- > 0)
|
||||
|
@ -532,7 +532,7 @@ vector_sum_squares (SCM v)
|
|||
{
|
||||
double x, sum = 0.0;
|
||||
size_t n;
|
||||
if (scm_is_simple_vector (v))
|
||||
if (scm_is_vector (v))
|
||||
{
|
||||
n = SCM_SIMPLE_VECTOR_LENGTH (v);
|
||||
while (n-- > 0)
|
||||
|
@ -626,7 +626,7 @@ SCM_DEFINE (scm_random_normal_vector_x, "random:normal-vector!", 1, 1, 0,
|
|||
scm_generalized_vector_get_handle (v, &handle);
|
||||
dim = scm_array_handle_dims (&handle);
|
||||
|
||||
if (scm_is_vector (v))
|
||||
if (handle.element_type == SCM_ARRAY_ELEMENT_TYPE_SCM)
|
||||
{
|
||||
SCM *elts = scm_array_handle_writable_elements (&handle);
|
||||
for (i = dim->lbnd; i <= dim->ubnd; i++, elts += dim->inc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue