summaryrefslogtreecommitdiff
path: root/packages/base/src/C/vector-aux.c
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-05-21 20:47:59 +0200
committerAlberto Ruiz <aruiz@um.es>2015-05-21 20:47:59 +0200
commit46178222d272a85220bc86b221aa3166edd5bd4a (patch)
treefbdbb92ef35930cf42913b0c5192ff53f2383f29 /packages/base/src/C/vector-aux.c
parent7d439ac1d5f49ead00f44c5c1eef5747623d4823 (diff)
CInt elements, wip
Diffstat (limited to 'packages/base/src/C/vector-aux.c')
-rw-r--r--packages/base/src/C/vector-aux.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/base/src/C/vector-aux.c b/packages/base/src/C/vector-aux.c
index abeba76..58afc49 100644
--- a/packages/base/src/C/vector-aux.c
+++ b/packages/base/src/C/vector-aux.c
@@ -894,3 +894,30 @@ int round_vector(KDVEC(v),DVEC(r)) {
894 OK 894 OK
895} 895}
896 896
897////////////////////////////////////////////////////////////////////////////////
898
899int round_vector_i(KDVEC(v),IVEC(r)) {
900 int k;
901 for(k=0; k<vn; k++) {
902 rp[k] = round(vp[k]);
903 }
904 OK
905}
906
907
908int mod_vector(int m, KIVEC(v), IVEC(r)) {
909 int k;
910 for(k=0; k<vn; k++) {
911 rp[k] = vp[k] % m;
912 }
913 OK
914}
915
916int div_vector(int m, KIVEC(v), IVEC(r)) {
917 int k;
918 for(k=0; k<vn; k++) {
919 rp[k] = vp[k] / m;
920 }
921 OK
922}
923