chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Problems with srfi-4-comprehensions


From: Ivan Raikov
Subject: Re: [Chicken-users] Problems with srfi-4-comprehensions
Date: Mon, 26 Mar 2007 18:44:36 -0400 (EDT)

Hi Alex,

   In this particular case, I am only dealing with vectors. I want to find
the numerical solution of a system of continuous equations that are
discretized over a grid of size N. So I have to solve for each unknown
variable at N points. If there are K unknowns and their equations are
decoupled from each other, then they can be solved with one loop (of N
iterations), instead of K loops. For example (in SRFI-42 syntax):

  (let*
  ;; Constants during integration
     (P (vector ...))

  ;; solve for unknown variable X_1
  ;; X1-rhs is the function that computes the right hand side of the
  ;; equation associated with variable X_1.
     (X_1 (vector-of-length-ec N (:vector p P) (X1-rhs p)))

  .
  .
  .

  ;; solve for unknown variable X_K
  ;; XK-rhs is the function that computes the right hand side of the
  ;; equation associated with variable X_K.
     (X_K (vector-of-length-ec N (:vector p P) (XK-rhs p)))

In this particular case, instead of looping K times over the parameter
vector, I'd like to be able to solve for all variables in one loop. Is it
possible to do this in a general way with loopy-loop?


  -Ivan

On Sat, 24 Mar 2007, Alex Shinn wrote:

> Are your vectors actually rows/columns of a matrix?  If you could
> give a more concrete example of how you want to use this I may be
> able to come up with something.
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]