comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: combinatory analysis with restrictions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: combinatory analysis with restrictions [message #41749] Wed, 08 December 2004 22:41 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
fleduc@lycos.com (Francois) writes:

> Hello,
>
> Considering 3 variables (a,b,c) that can take 11 discrete values
> between 0 and 1: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
> 1.0]

Why don't you make a 2D array of (11,11) corresponding to the sum of
all possible values of A and B?

For each value of (A+B), the value of C is immediately determined as
1-(A+B), or it does not exist if (A+B)>1. Thus, for each entry in the
matrix, you can read off A and B from the column and row labels, and C
from 1-(A+B).

Good luck,
Craig

aa = lindgen(11) # (lonarr(11)+1) ;; A-only matrix
bb = (lonarr(11)+1) # lindgen(11) ;; B-only matrix
cc = 10-(AA+BB)
wh = where(cc GE 0)
a = wh MOD 11 & b = wh/11 & c = cc(wh)

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Help with Nested FOR Loop
Next Topic: iplot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:31:12 PDT 2025

Total time taken to generate the page: 0.08384 seconds