Hi,
Thank you for that info.  I didn't realize you can have multidimensional 
float-vectors, nor knew how to go about that.  This helps.
Jim
________________________________
From: cmdist-boun...@ccrma.stanford.edu <cmdist-boun...@ccrma.stanford.edu> on 
behalf of cmdist-requ...@ccrma.stanford.edu <cmdist-requ...@ccrma.stanford.edu>
Sent: Thursday, September 7, 2023 9:00 AM
To: cmdist@ccrma.Stanford.EDU <cmdist@ccrma.Stanford.EDU>
Subject: Cmdist Digest, Vol 184, Issue 1

Send Cmdist mailing list submissions to
        cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
        https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
        cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
        cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. cons value for float vector (James Hearon)


----------------------------------------------------------------------

Message: 1
Date: Thu, 7 Sep 2023 17:47:11 +0000
From: James Hearon <j_hea...@hotmail.com>
To: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU>
Subject: [CM] cons value for float vector
Message-ID:
        
<byapr10mb2536562c85954cf25c290386e5...@byapr10mb2536.namprd10.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"


Hi,
I'm having a difficult time trying to create two columns of data (or three or 
four etc.) in a float vector.
A list works fine, but the vector gives an error that the data is a pair but 
should
be a real.  I could use make-env for this probably, but seems like I should
be able to get the vector to cooperate.  I'm wondering what I'm 
misunderstanding or if there's
a better way to think of this such as individual vectors then zip them together?
Thanks,
Jim

;float vector XXX
(let* ((fsize 10)
       (im (make-float-vector fsize))
       (x 1)
       (y 1.0)
       )
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (im k) (cons x y)) ;XXX is a pair but should be a real?
;(float-vector-set! im k (cons x y))
(format #t "~% ~A ~A" k (im k) )
(set! x (1+ x))
(set! y (1+ y))
))

;list OK
(let* ((fsize 10)
       (mylist (make-list fsize))
       (x 1)
       (y 1.0)
       )
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (list-ref mylist k) (cons x y))
(format #t "~% ~A ~A" k (list-ref mylist k))
(set! x (1+ x))
(set! y (1+ y))
))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20230907/2168650d/attachment-0001.html>

------------------------------

_______________________________________________
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 184, Issue 1
**************************************
_______________________________________________
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Reply via email to