<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I'm having a difficult time trying to create two columns of data (or three or four etc.) in a float vector.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
A list works fine, but the vector gives an error that the data is a pair but should</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
be a real. I could use make-env for this probably, but seems like I should <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
be able to get the vector to cooperate. I'm wondering what I'm misunderstanding or if there's</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
a better way to think of this such as individual vectors then zip them together?<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Jim<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
;float vector XXX
<div class="ContentPasted0">(let* ((fsize 10)</div>
<div class="ContentPasted0"> (im (make-float-vector fsize))</div>
<div class="ContentPasted0"> (x 1)</div>
<div class="ContentPasted0"> (y 1.0)</div>
<div class="ContentPasted0"> ) </div>
<div class="ContentPasted0">(do ((k 0 (+ k 1)))</div>
<div class="ContentPasted0">((>= k fsize)) </div>
<div class="ContentPasted0">(set! (im k) (cons x y)) ;XXX is a pair but should be a real?<br>
</div>
<div class="ContentPasted0">;(float-vector-set! im k (cons x y))</div>
<div class="ContentPasted0">(format #t "~% ~A ~A" k (im k) )</div>
<div class="ContentPasted0">(set! x (1+ x))</div>
<div class="ContentPasted0">(set! y (1+ y))</div>
<div class="ContentPasted0">))</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">;list OK<br>
</div>
<div class="ContentPasted0">(let* ((fsize 10)</div>
<div class="ContentPasted0"> (mylist (make-list fsize))</div>
<div class="ContentPasted0"> (x 1)</div>
<div class="ContentPasted0"> (y 1.0)</div>
<div class="ContentPasted0"> ) </div>
<div class="ContentPasted0">(do ((k 0 (+ k 1)))</div>
<div class="ContentPasted0">((>= k fsize)) </div>
<div class="ContentPasted0">(set! (list-ref mylist k) (cons x y)) </div>
<div class="ContentPasted0">(format #t "~% ~A ~A" k (list-ref mylist k))</div>
<div class="ContentPasted0">(set! x (1+ x))</div>
<div class="ContentPasted0">(set! y (1+ y))</div>
))<br>
</div>
</body>
</html>