1 |
/* srfi-4.c --- Homogeneous numeric vector datatypes. |
/* srfi-4.c --- Homogeneous numeric vector datatypes. |
2 |
* |
* |
3 |
* Copyright (C) 2001 Free Software Foundation, Inc. |
* Copyright (C) 2001 Free Software Foundation, Inc. |
4 |
* |
* |
5 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
6 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
7 |
* published by the Free Software Foundation; either version 2, or (at |
* published by the Free Software Foundation; either version 2, or (at |
8 |
* your option) any later version. |
* your option) any later version. |
9 |
* |
* |
10 |
* This program is distributed in the hope that it will be useful, but |
* This program is distributed in the hope that it will be useful, but |
11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 |
* General Public License for more details. |
* General Public License for more details. |
14 |
* |
* |
15 |
* You should have received a copy of the GNU General Public License |
* You should have received a copy of the GNU General Public License |
16 |
* along with this software; see the file COPYING. If not, write to |
* along with this software; see the file COPYING. If not, write to |
17 |
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
362 |
make_uvec (const char * func_name, int type, int len) |
make_uvec (const char * func_name, int type, int len) |
363 |
{ |
{ |
364 |
void * p; |
void * p; |
365 |
|
|
366 |
p = scm_must_malloc (len * uvec_sizes[type], func_name); |
p = scm_must_malloc (len * uvec_sizes[type], func_name); |
367 |
SCM_RETURN_NEWSMOB3 (scm_tc16_uvec, type, len, p); |
SCM_RETURN_NEWSMOB3 (scm_tc16_uvec, type, len, p); |
368 |
} |
} |
373 |
/* ================================================================ */ |
/* ================================================================ */ |
374 |
|
|
375 |
|
|
376 |
SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0, |
SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0, |
377 |
(SCM obj), |
(SCM obj), |
378 |
"Return @code{#t} if @var{obj} is a vector of type u8,\n" |
"Return @code{#t} if @var{obj} is a vector of type u8,\n" |
379 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
385 |
#undef FUNC_NAME |
#undef FUNC_NAME |
386 |
|
|
387 |
|
|
388 |
SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0, |
SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0, |
389 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
390 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
391 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
418 |
#undef FUNC_NAME |
#undef FUNC_NAME |
419 |
|
|
420 |
|
|
421 |
SCM_DEFINE (scm_u8vector, "u8vector", 0, 0, 1, |
SCM_DEFINE (scm_u8vector, "u8vector", 0, 0, 1, |
422 |
(SCM l), |
(SCM l), |
423 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
424 |
"all argument values.") |
"all argument values.") |
430 |
#undef FUNC_NAME |
#undef FUNC_NAME |
431 |
|
|
432 |
|
|
433 |
SCM_DEFINE (scm_u8vector_length, "u8vector-length", 1, 0, 0, |
SCM_DEFINE (scm_u8vector_length, "u8vector-length", 1, 0, 0, |
434 |
(SCM uvec), |
(SCM uvec), |
435 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
436 |
"@var{uvec}.") |
"@var{uvec}.") |
444 |
#undef FUNC_NAME |
#undef FUNC_NAME |
445 |
|
|
446 |
|
|
447 |
SCM_DEFINE (scm_u8vector_ref, "u8vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_u8vector_ref, "u8vector-ref", 2, 0, 0, |
448 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
449 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
450 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
465 |
#undef FUNC_NAME |
#undef FUNC_NAME |
466 |
|
|
467 |
|
|
468 |
SCM_DEFINE (scm_u8vector_set_x, "u8vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_u8vector_set_x, "u8vector-set!", 3, 0, 0, |
469 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
470 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
471 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
495 |
#undef FUNC_NAME |
#undef FUNC_NAME |
496 |
|
|
497 |
|
|
498 |
SCM_DEFINE (scm_u8vector_to_list, "u8vector->list", 1, 0, 0, |
SCM_DEFINE (scm_u8vector_to_list, "u8vector->list", 1, 0, 0, |
499 |
(SCM uvec), |
(SCM uvec), |
500 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
501 |
#define FUNC_NAME s_scm_u8vector_to_list |
#define FUNC_NAME s_scm_u8vector_to_list |
559 |
/* ================================================================ */ |
/* ================================================================ */ |
560 |
|
|
561 |
|
|
562 |
SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0, |
SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0, |
563 |
(SCM obj), |
(SCM obj), |
564 |
"Return @code{#t} if @var{obj} is a vector of type s8,\n" |
"Return @code{#t} if @var{obj} is a vector of type s8,\n" |
565 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
571 |
#undef FUNC_NAME |
#undef FUNC_NAME |
572 |
|
|
573 |
|
|
574 |
SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0, |
SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0, |
575 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
576 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
577 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
604 |
#undef FUNC_NAME |
#undef FUNC_NAME |
605 |
|
|
606 |
|
|
607 |
SCM_DEFINE (scm_s8vector, "s8vector", 0, 0, 1, |
SCM_DEFINE (scm_s8vector, "s8vector", 0, 0, 1, |
608 |
(SCM l), |
(SCM l), |
609 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
610 |
"all argument values.") |
"all argument values.") |
616 |
#undef FUNC_NAME |
#undef FUNC_NAME |
617 |
|
|
618 |
|
|
619 |
SCM_DEFINE (scm_s8vector_length, "s8vector-length", 1, 0, 0, |
SCM_DEFINE (scm_s8vector_length, "s8vector-length", 1, 0, 0, |
620 |
(SCM uvec), |
(SCM uvec), |
621 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
622 |
"@var{uvec}.") |
"@var{uvec}.") |
630 |
#undef FUNC_NAME |
#undef FUNC_NAME |
631 |
|
|
632 |
|
|
633 |
SCM_DEFINE (scm_s8vector_ref, "s8vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_s8vector_ref, "s8vector-ref", 2, 0, 0, |
634 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
635 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
636 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
651 |
#undef FUNC_NAME |
#undef FUNC_NAME |
652 |
|
|
653 |
|
|
654 |
SCM_DEFINE (scm_s8vector_set_x, "s8vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_s8vector_set_x, "s8vector-set!", 3, 0, 0, |
655 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
656 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
657 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
681 |
#undef FUNC_NAME |
#undef FUNC_NAME |
682 |
|
|
683 |
|
|
684 |
SCM_DEFINE (scm_s8vector_to_list, "s8vector->list", 1, 0, 0, |
SCM_DEFINE (scm_s8vector_to_list, "s8vector->list", 1, 0, 0, |
685 |
(SCM uvec), |
(SCM uvec), |
686 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
687 |
#define FUNC_NAME s_scm_s8vector_to_list |
#define FUNC_NAME s_scm_s8vector_to_list |
747 |
/* ================================================================ */ |
/* ================================================================ */ |
748 |
|
|
749 |
|
|
750 |
SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0, |
SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0, |
751 |
(SCM obj), |
(SCM obj), |
752 |
"Return @code{#t} if @var{obj} is a vector of type u16,\n" |
"Return @code{#t} if @var{obj} is a vector of type u16,\n" |
753 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
759 |
#undef FUNC_NAME |
#undef FUNC_NAME |
760 |
|
|
761 |
|
|
762 |
SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0, |
SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0, |
763 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
764 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
765 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
787 |
#undef FUNC_NAME |
#undef FUNC_NAME |
788 |
|
|
789 |
|
|
790 |
SCM_DEFINE (scm_u16vector, "u16vector", 0, 0, 1, |
SCM_DEFINE (scm_u16vector, "u16vector", 0, 0, 1, |
791 |
(SCM l), |
(SCM l), |
792 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
793 |
"all argument values.") |
"all argument values.") |
799 |
#undef FUNC_NAME |
#undef FUNC_NAME |
800 |
|
|
801 |
|
|
802 |
SCM_DEFINE (scm_u16vector_length, "u16vector-length", 1, 0, 0, |
SCM_DEFINE (scm_u16vector_length, "u16vector-length", 1, 0, 0, |
803 |
(SCM uvec), |
(SCM uvec), |
804 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
805 |
"@var{uvec}.") |
"@var{uvec}.") |
813 |
#undef FUNC_NAME |
#undef FUNC_NAME |
814 |
|
|
815 |
|
|
816 |
SCM_DEFINE (scm_u16vector_ref, "u16vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_u16vector_ref, "u16vector-ref", 2, 0, 0, |
817 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
818 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
819 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
834 |
#undef FUNC_NAME |
#undef FUNC_NAME |
835 |
|
|
836 |
|
|
837 |
SCM_DEFINE (scm_u16vector_set_x, "u16vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_u16vector_set_x, "u16vector-set!", 3, 0, 0, |
838 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
839 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
840 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
860 |
#undef FUNC_NAME |
#undef FUNC_NAME |
861 |
|
|
862 |
|
|
863 |
SCM_DEFINE (scm_u16vector_to_list, "u16vector->list", 1, 0, 0, |
SCM_DEFINE (scm_u16vector_to_list, "u16vector->list", 1, 0, 0, |
864 |
(SCM uvec), |
(SCM uvec), |
865 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
866 |
#define FUNC_NAME s_scm_u16vector_to_list |
#define FUNC_NAME s_scm_u16vector_to_list |
917 |
/* ================================================================ */ |
/* ================================================================ */ |
918 |
|
|
919 |
|
|
920 |
SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0, |
SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0, |
921 |
(SCM obj), |
(SCM obj), |
922 |
"Return @code{#t} if @var{obj} is a vector of type s16,\n" |
"Return @code{#t} if @var{obj} is a vector of type s16,\n" |
923 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
929 |
#undef FUNC_NAME |
#undef FUNC_NAME |
930 |
|
|
931 |
|
|
932 |
SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0, |
SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0, |
933 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
934 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
935 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
957 |
#undef FUNC_NAME |
#undef FUNC_NAME |
958 |
|
|
959 |
|
|
960 |
SCM_DEFINE (scm_s16vector, "s16vector", 0, 0, 1, |
SCM_DEFINE (scm_s16vector, "s16vector", 0, 0, 1, |
961 |
(SCM l), |
(SCM l), |
962 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
963 |
"all argument values.") |
"all argument values.") |
969 |
#undef FUNC_NAME |
#undef FUNC_NAME |
970 |
|
|
971 |
|
|
972 |
SCM_DEFINE (scm_s16vector_length, "s16vector-length", 1, 0, 0, |
SCM_DEFINE (scm_s16vector_length, "s16vector-length", 1, 0, 0, |
973 |
(SCM uvec), |
(SCM uvec), |
974 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
975 |
"@var{uvec}.") |
"@var{uvec}.") |
983 |
#undef FUNC_NAME |
#undef FUNC_NAME |
984 |
|
|
985 |
|
|
986 |
SCM_DEFINE (scm_s16vector_ref, "s16vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_s16vector_ref, "s16vector-ref", 2, 0, 0, |
987 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
988 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
989 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
1004 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1005 |
|
|
1006 |
|
|
1007 |
SCM_DEFINE (scm_s16vector_set_x, "s16vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_s16vector_set_x, "s16vector-set!", 3, 0, 0, |
1008 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
1009 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
1010 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
1030 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1031 |
|
|
1032 |
|
|
1033 |
SCM_DEFINE (scm_s16vector_to_list, "s16vector->list", 1, 0, 0, |
SCM_DEFINE (scm_s16vector_to_list, "s16vector->list", 1, 0, 0, |
1034 |
(SCM uvec), |
(SCM uvec), |
1035 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
1036 |
#define FUNC_NAME s_scm_s16vector_to_list |
#define FUNC_NAME s_scm_s16vector_to_list |
1090 |
/* ================================================================ */ |
/* ================================================================ */ |
1091 |
|
|
1092 |
|
|
1093 |
SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0, |
SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0, |
1094 |
(SCM obj), |
(SCM obj), |
1095 |
"Return @code{#t} if @var{obj} is a vector of type u32,\n" |
"Return @code{#t} if @var{obj} is a vector of type u32,\n" |
1096 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
1102 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1103 |
|
|
1104 |
|
|
1105 |
SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0, |
SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0, |
1106 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
1107 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
1108 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
1130 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1131 |
|
|
1132 |
|
|
1133 |
SCM_DEFINE (scm_u32vector, "u32vector", 0, 0, 1, |
SCM_DEFINE (scm_u32vector, "u32vector", 0, 0, 1, |
1134 |
(SCM l), |
(SCM l), |
1135 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
1136 |
"all argument values.") |
"all argument values.") |
1142 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1143 |
|
|
1144 |
|
|
1145 |
SCM_DEFINE (scm_u32vector_length, "u32vector-length", 1, 0, 0, |
SCM_DEFINE (scm_u32vector_length, "u32vector-length", 1, 0, 0, |
1146 |
(SCM uvec), |
(SCM uvec), |
1147 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
1148 |
"@var{uvec}.") |
"@var{uvec}.") |
1156 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1157 |
|
|
1158 |
|
|
1159 |
SCM_DEFINE (scm_u32vector_ref, "u32vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_u32vector_ref, "u32vector-ref", 2, 0, 0, |
1160 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
1161 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
1162 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
1177 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1178 |
|
|
1179 |
|
|
1180 |
SCM_DEFINE (scm_u32vector_set_x, "u32vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_u32vector_set_x, "u32vector-set!", 3, 0, 0, |
1181 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
1182 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
1183 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
1203 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1204 |
|
|
1205 |
|
|
1206 |
SCM_DEFINE (scm_u32vector_to_list, "u32vector->list", 1, 0, 0, |
SCM_DEFINE (scm_u32vector_to_list, "u32vector->list", 1, 0, 0, |
1207 |
(SCM uvec), |
(SCM uvec), |
1208 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
1209 |
#define FUNC_NAME s_scm_u32vector_to_list |
#define FUNC_NAME s_scm_u32vector_to_list |
1261 |
/* ================================================================ */ |
/* ================================================================ */ |
1262 |
|
|
1263 |
|
|
1264 |
SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0, |
SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0, |
1265 |
(SCM obj), |
(SCM obj), |
1266 |
"Return @code{#t} if @var{obj} is a vector of type s32,\n" |
"Return @code{#t} if @var{obj} is a vector of type s32,\n" |
1267 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
1273 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1274 |
|
|
1275 |
|
|
1276 |
SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0, |
SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0, |
1277 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
1278 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
1279 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
1301 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1302 |
|
|
1303 |
|
|
1304 |
SCM_DEFINE (scm_s32vector, "s32vector", 0, 0, 1, |
SCM_DEFINE (scm_s32vector, "s32vector", 0, 0, 1, |
1305 |
(SCM l), |
(SCM l), |
1306 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
1307 |
"all argument values.") |
"all argument values.") |
1313 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1314 |
|
|
1315 |
|
|
1316 |
SCM_DEFINE (scm_s32vector_length, "s32vector-length", 1, 0, 0, |
SCM_DEFINE (scm_s32vector_length, "s32vector-length", 1, 0, 0, |
1317 |
(SCM uvec), |
(SCM uvec), |
1318 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
1319 |
"@var{uvec}.") |
"@var{uvec}.") |
1327 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1328 |
|
|
1329 |
|
|
1330 |
SCM_DEFINE (scm_s32vector_ref, "s32vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_s32vector_ref, "s32vector-ref", 2, 0, 0, |
1331 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
1332 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
1333 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
1348 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1349 |
|
|
1350 |
|
|
1351 |
SCM_DEFINE (scm_s32vector_set_x, "s32vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_s32vector_set_x, "s32vector-set!", 3, 0, 0, |
1352 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
1353 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
1354 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
1374 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1375 |
|
|
1376 |
|
|
1377 |
SCM_DEFINE (scm_s32vector_to_list, "s32vector->list", 1, 0, 0, |
SCM_DEFINE (scm_s32vector_to_list, "s32vector->list", 1, 0, 0, |
1378 |
(SCM uvec), |
(SCM uvec), |
1379 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
1380 |
#define FUNC_NAME s_scm_s32vector_to_list |
#define FUNC_NAME s_scm_s32vector_to_list |
1434 |
/* ================================================================ */ |
/* ================================================================ */ |
1435 |
|
|
1436 |
|
|
1437 |
SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0, |
SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0, |
1438 |
(SCM obj), |
(SCM obj), |
1439 |
"Return @code{#t} if @var{obj} is a vector of type u64,\n" |
"Return @code{#t} if @var{obj} is a vector of type u64,\n" |
1440 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
1446 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1447 |
|
|
1448 |
|
|
1449 |
SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0, |
SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0, |
1450 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
1451 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
1452 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
1474 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1475 |
|
|
1476 |
|
|
1477 |
SCM_DEFINE (scm_u64vector, "u64vector", 0, 0, 1, |
SCM_DEFINE (scm_u64vector, "u64vector", 0, 0, 1, |
1478 |
(SCM l), |
(SCM l), |
1479 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
1480 |
"all argument values.") |
"all argument values.") |
1486 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1487 |
|
|
1488 |
|
|
1489 |
SCM_DEFINE (scm_u64vector_length, "u64vector-length", 1, 0, 0, |
SCM_DEFINE (scm_u64vector_length, "u64vector-length", 1, 0, 0, |
1490 |
(SCM uvec), |
(SCM uvec), |
1491 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
1492 |
"@var{uvec}.") |
"@var{uvec}.") |
1500 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1501 |
|
|
1502 |
|
|
1503 |
SCM_DEFINE (scm_u64vector_ref, "u64vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_u64vector_ref, "u64vector-ref", 2, 0, 0, |
1504 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
1505 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
1506 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
1521 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1522 |
|
|
1523 |
|
|
1524 |
SCM_DEFINE (scm_u64vector_set_x, "u64vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_u64vector_set_x, "u64vector-set!", 3, 0, 0, |
1525 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
1526 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
1527 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
1547 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1548 |
|
|
1549 |
|
|
1550 |
SCM_DEFINE (scm_u64vector_to_list, "u64vector->list", 1, 0, 0, |
SCM_DEFINE (scm_u64vector_to_list, "u64vector->list", 1, 0, 0, |
1551 |
(SCM uvec), |
(SCM uvec), |
1552 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
1553 |
#define FUNC_NAME s_scm_u64vector_to_list |
#define FUNC_NAME s_scm_u64vector_to_list |
1605 |
/* ================================================================ */ |
/* ================================================================ */ |
1606 |
|
|
1607 |
|
|
1608 |
SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0, |
SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0, |
1609 |
(SCM obj), |
(SCM obj), |
1610 |
"Return @code{#t} if @var{obj} is a vector of type s64,\n" |
"Return @code{#t} if @var{obj} is a vector of type s64,\n" |
1611 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
1617 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1618 |
|
|
1619 |
|
|
1620 |
SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0, |
SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0, |
1621 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
1622 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
1623 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
1645 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1646 |
|
|
1647 |
|
|
1648 |
SCM_DEFINE (scm_s64vector, "s64vector", 0, 0, 1, |
SCM_DEFINE (scm_s64vector, "s64vector", 0, 0, 1, |
1649 |
(SCM l), |
(SCM l), |
1650 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
1651 |
"all argument values.") |
"all argument values.") |
1657 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1658 |
|
|
1659 |
|
|
1660 |
SCM_DEFINE (scm_s64vector_length, "s64vector-length", 1, 0, 0, |
SCM_DEFINE (scm_s64vector_length, "s64vector-length", 1, 0, 0, |
1661 |
(SCM uvec), |
(SCM uvec), |
1662 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
1663 |
"@var{uvec}.") |
"@var{uvec}.") |
1671 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1672 |
|
|
1673 |
|
|
1674 |
SCM_DEFINE (scm_s64vector_ref, "s64vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_s64vector_ref, "s64vector-ref", 2, 0, 0, |
1675 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
1676 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
1677 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
1692 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1693 |
|
|
1694 |
|
|
1695 |
SCM_DEFINE (scm_s64vector_set_x, "s64vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_s64vector_set_x, "s64vector-set!", 3, 0, 0, |
1696 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
1697 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
1698 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
1718 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1719 |
|
|
1720 |
|
|
1721 |
SCM_DEFINE (scm_s64vector_to_list, "s64vector->list", 1, 0, 0, |
SCM_DEFINE (scm_s64vector_to_list, "s64vector->list", 1, 0, 0, |
1722 |
(SCM uvec), |
(SCM uvec), |
1723 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
1724 |
#define FUNC_NAME s_scm_s64vector_to_list |
#define FUNC_NAME s_scm_s64vector_to_list |
1778 |
/* ================================================================ */ |
/* ================================================================ */ |
1779 |
|
|
1780 |
|
|
1781 |
SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0, |
SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0, |
1782 |
(SCM obj), |
(SCM obj), |
1783 |
"Return @code{#t} if @var{obj} is a vector of type f32,\n" |
"Return @code{#t} if @var{obj} is a vector of type f32,\n" |
1784 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
1790 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1791 |
|
|
1792 |
|
|
1793 |
SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0, |
SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0, |
1794 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
1795 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
1796 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
1827 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1828 |
|
|
1829 |
|
|
1830 |
SCM_DEFINE (scm_f32vector, "f32vector", 0, 0, 1, |
SCM_DEFINE (scm_f32vector, "f32vector", 0, 0, 1, |
1831 |
(SCM l), |
(SCM l), |
1832 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
1833 |
"all argument values.") |
"all argument values.") |
1839 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1840 |
|
|
1841 |
|
|
1842 |
SCM_DEFINE (scm_f32vector_length, "f32vector-length", 1, 0, 0, |
SCM_DEFINE (scm_f32vector_length, "f32vector-length", 1, 0, 0, |
1843 |
(SCM uvec), |
(SCM uvec), |
1844 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
1845 |
"@var{uvec}.") |
"@var{uvec}.") |
1853 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1854 |
|
|
1855 |
|
|
1856 |
SCM_DEFINE (scm_f32vector_ref, "f32vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_f32vector_ref, "f32vector-ref", 2, 0, 0, |
1857 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
1858 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
1859 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
1874 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1875 |
|
|
1876 |
|
|
1877 |
SCM_DEFINE (scm_f32vector_set_x, "f32vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_f32vector_set_x, "f32vector-set!", 3, 0, 0, |
1878 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
1879 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
1880 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
1908 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1909 |
|
|
1910 |
|
|
1911 |
SCM_DEFINE (scm_f32vector_to_list, "f32vector->list", 1, 0, 0, |
SCM_DEFINE (scm_f32vector_to_list, "f32vector->list", 1, 0, 0, |
1912 |
(SCM uvec), |
(SCM uvec), |
1913 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
1914 |
#define FUNC_NAME s_scm_f32vector_to_list |
#define FUNC_NAME s_scm_f32vector_to_list |
1974 |
/* ================================================================ */ |
/* ================================================================ */ |
1975 |
|
|
1976 |
|
|
1977 |
SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0, |
SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0, |
1978 |
(SCM obj), |
(SCM obj), |
1979 |
"Return @code{#t} if @var{obj} is a vector of type f64,\n" |
"Return @code{#t} if @var{obj} is a vector of type f64,\n" |
1980 |
"@code{#f} otherwise.") |
"@code{#f} otherwise.") |
1986 |
#undef FUNC_NAME |
#undef FUNC_NAME |
1987 |
|
|
1988 |
|
|
1989 |
SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0, |
SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0, |
1990 |
(SCM n, SCM fill), |
(SCM n, SCM fill), |
1991 |
"Create a newly allocated homogeneous numeric vector which can\n" |
"Create a newly allocated homogeneous numeric vector which can\n" |
1992 |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
"hold @var{len} elements. If @var{fill} is given, it is used to\n" |
2014 |
#undef FUNC_NAME |
#undef FUNC_NAME |
2015 |
|
|
2016 |
|
|
2017 |
SCM_DEFINE (scm_f64vector, "f64vector", 0, 0, 1, |
SCM_DEFINE (scm_f64vector, "f64vector", 0, 0, 1, |
2018 |
(SCM l), |
(SCM l), |
2019 |
"Create a newly allocated homogeneous numeric vector containing\n" |
"Create a newly allocated homogeneous numeric vector containing\n" |
2020 |
"all argument values.") |
"all argument values.") |
2026 |
#undef FUNC_NAME |
#undef FUNC_NAME |
2027 |
|
|
2028 |
|
|
2029 |
SCM_DEFINE (scm_f64vector_length, "f64vector-length", 1, 0, 0, |
SCM_DEFINE (scm_f64vector_length, "f64vector-length", 1, 0, 0, |
2030 |
(SCM uvec), |
(SCM uvec), |
2031 |
"Return the number of elements in the homogeneous numeric vector\n" |
"Return the number of elements in the homogeneous numeric vector\n" |
2032 |
"@var{uvec}.") |
"@var{uvec}.") |
2040 |
#undef FUNC_NAME |
#undef FUNC_NAME |
2041 |
|
|
2042 |
|
|
2043 |
SCM_DEFINE (scm_f64vector_ref, "f64vector-ref", 2, 0, 0, |
SCM_DEFINE (scm_f64vector_ref, "f64vector-ref", 2, 0, 0, |
2044 |
(SCM uvec, SCM index), |
(SCM uvec, SCM index), |
2045 |
"Return the element at @var{index} in the homogeneous numeric\n" |
"Return the element at @var{index} in the homogeneous numeric\n" |
2046 |
"vector @var{uvec}.") |
"vector @var{uvec}.") |
2061 |
#undef FUNC_NAME |
#undef FUNC_NAME |
2062 |
|
|
2063 |
|
|
2064 |
SCM_DEFINE (scm_f64vector_set_x, "f64vector-set!", 3, 0, 0, |
SCM_DEFINE (scm_f64vector_set_x, "f64vector-set!", 3, 0, 0, |
2065 |
(SCM uvec, SCM index, SCM value), |
(SCM uvec, SCM index, SCM value), |
2066 |
"Set the element at @var{index} in the homogeneous numeric\n" |
"Set the element at @var{index} in the homogeneous numeric\n" |
2067 |
"vector @var{uvec} to @var{value}. The return value is not\n" |
"vector @var{uvec} to @var{value}. The return value is not\n" |
2087 |
#undef FUNC_NAME |
#undef FUNC_NAME |
2088 |
|
|
2089 |
|
|
2090 |
SCM_DEFINE (scm_f64vector_to_list, "f64vector->list", 1, 0, 0, |
SCM_DEFINE (scm_f64vector_to_list, "f64vector->list", 1, 0, 0, |
2091 |
(SCM uvec), |
(SCM uvec), |
2092 |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
"Convert the homogeneous numeric vector @var{uvec} to a list.") |
2093 |
#define FUNC_NAME s_scm_f64vector_to_list |
#define FUNC_NAME s_scm_f64vector_to_list |
2147 |
scm_tc16_uvec = scm_make_smob_type ("uvec", 0); |
scm_tc16_uvec = scm_make_smob_type ("uvec", 0); |
2148 |
scm_set_smob_free (scm_tc16_uvec, uvec_free); |
scm_set_smob_free (scm_tc16_uvec, uvec_free); |
2149 |
scm_set_smob_print (scm_tc16_uvec, uvec_print); |
scm_set_smob_print (scm_tc16_uvec, uvec_print); |
|
#ifndef SCM_MAGIC_SNARFER |
|
2150 |
#include "srfi/srfi-4.x" |
#include "srfi/srfi-4.x" |
|
#endif |
|
2151 |
} |
} |
2152 |
|
|
2153 |
/* End of srfi-4.c. */ |
/* End of srfi-4.c. */ |