bsexton

10 Reputation

One Badge

9 years, 69 days

MaplePrimes Activity


These are questions asked by bsexton

I would like to add threads to this code that compiles cleanly:

RECTmatrixSEQ :=  (FD,m, n, xw, yw, tr, k, rho, dmax) ->
 
   [seq
     (seq
        # A return of 0 means there is no choice - no digit possible
        # result of a 4 means there is a choice of (-1 or 0)
        (add(RECTpred(m, n, i, j, iter1, k, rho)*(2*abs(iter1)+1), iter1 = -dmax .. dmax)
        + (2*dmax+1)*(RECTpredR(m, n, i, j, dmax, k, rho)+
        RECTpredL(m, n, i, j, -dmax, k, rho))+
        .5*RECTpredOR(m, n, i, j, dmax, k, rho)+
        .5*RECTpredOL(m, n, i, j, -dmax, k, rho),
      i = -ceil(2*dmax+2*rho)*2^m .. ceil(2*dmax+2*rho)*2^m-1),
    j = 0 .. 2^(n-yw)-1)]:

I've added thead calls like this, still no syntax errors:

RECTmatrixSEQ :=  (FD,m, n, xw, yw, tr, k, rho, dmax) ->

   CodeTools:-Usage( Threads:-Wait(
   [seq (Threads:-Create
     (seq
        # A return of 0 means there is no choice - no digit possible
        # result of a 4 means there is a choice of (-1 or 0)
        (add(RECTpred(m, n, i, j, iter1, k, rho)*(2*abs(iter1)+1), iter1 = -dmax .. dmax)
        + (2*dmax+1)*(RECTpredR(m, n, i, j, dmax, k, rho) +
        RECTpredL(m, n, i, j, -dmax, k, rho))+
        .5*RECTpredOR(m, n, i, j, dmax, k, rho)+
        .5*RECTpredOL(m, n, i, j, -dmax, k, rho),
      i = -ceil(2*dmax+2*rho)*2^m .. ceil(2*dmax+2*rho)*2^m-1),
    j = 0 .. 2^(n-yw)-1)) ] )
    ):

 

I do get a runtime error:

                 "PROC:feasibilitycheckproONCE

                   "
Error, (in CodeTools:-Usage) invalid input: too many and/or wrong type of arguments passed to Threads:-Create; first unused argument is j = 0 .. 3

Any help spotting this problem would be appreciated. Thanks in advance.

Bonnie

 

I am a new user. I have a worksheet and need to see how the the procs are being accessed as it does not look like they are being called and executed as I would expect. What is the most efficient way to debug and see the calling order of my Procs?

 

Thanks in advance,

Bonnie

Page 1 of 1