Re: [U2] matrix dimension

2012-05-24 Thread Brian Leach
One of the things I've asked for in the past has been alternate language
runtimes, for example embedding JavaScript (e.g. Google V8 engine) into U2.
Then you *could* have unlimited nesting ..

Brian

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Martin Phillips
Sent: 24 May 2012 13:05
To: U2 Users List
Subject: Re: [U2] matrix dimension

Hi,

Multiple dimensions in DIM implies that all elements in each dimension would
exist, around 25000 in your example. Using dynamic arrays, even as part of a
dimensioned array is much more flexible as unused elements may not need to
exist. And UV allows seven dimensional dynamic arrays - more than enough for
most users!!

Of course, indexing into a dimensioned array would be faster.

Your request is close to something we were asked for in QM, arrays of
arrays. Although technically easy we have not done it as the user requesting
it withdrew the request. The hardest part is how to fit it into the language
syntax.

Martin Phillips




___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] matrix dimension

2012-05-24 Thread Martin Phillips
Hi,

Multiple dimensions in DIM implies that all elements in each dimension would 
exist, around 25000 in your example. Using dynamic arrays, even as part of a 
dimensioned array is much more flexible as unused elements may not need to 
exist. And UV allows seven dimensional dynamic arrays - more than enough for 
most users!!

Of course, indexing into a dimensioned array would be faster.

Your request is close to something we were asked for in QM, arrays of arrays. 
Although technically easy we have not done it as the user requesting it 
withdrew the request. The hardest part is how to fit it into the language 
syntax.

Martin Phillips

On 24 May 2012, at 12:46, Charles Stevenson  wrote:

> So LARGE.ARRAY is 2-dimensional & SMALL.ARRAY is 1 dimensional.
> 
> The real value of INMAT is telling the SIZE of (each) dimension.
> 
> Yes, I'm deliberately being picky.  I've found it very frustrating to be 
> hard-limited to 1- or 2-dimnsional arrays.
> What would be so wrong to allow:
> 
>  DIM BETTER.ARRAY( 23, 14, 10, 2, 3 )
> 
> Seems like it would be an easy enough feature to add, completely backward 
> compatible.
> 
> Why isn't dimension arbitrary?
> 
> 
> 
> On 5/23/2012 3:01 PM, Wally Terhune wrote:
>> Extracted from the UniBasic Commands Reference for INMAT()
>> 
>> In the next example, the program segment dimensions two arrays and then 
>> prints the
>> dimensions using the PRINT statement and INMAT function:
>> DIM LARGE.ARRAY(23,14)
>> DIM SMALL.ARRAY(9)
>> PRINT INMAT(LARGE.ARRAY)
>> PRINT INMAT(SMALL.ARRAY)
>> This results in the following:
>> 23}14
>> 9
>> -Original Message-
>> From: Jeffrey Butera
>> ... is there a function to determine it's dimensions?...
> ..
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] matrix dimension

2012-05-24 Thread Charles Stevenson

So LARGE.ARRAY is 2-dimensional & SMALL.ARRAY is 1 dimensional.

The real value of INMAT is telling the SIZE of (each) dimension.

Yes, I'm deliberately being picky.  I've found it very frustrating to be 
hard-limited to 1- or 2-dimnsional arrays.

What would be so wrong to allow:

  DIM BETTER.ARRAY( 23, 14, 10, 2, 3 )

Seems like it would be an easy enough feature to add, completely 
backward compatible.


Why isn't dimension arbitrary?



On 5/23/2012 3:01 PM, Wally Terhune wrote:

Extracted from the UniBasic Commands Reference for INMAT()

In the next example, the program segment dimensions two arrays and then prints 
the
dimensions using the PRINT statement and INMAT function:
DIM LARGE.ARRAY(23,14)
DIM SMALL.ARRAY(9)
PRINT INMAT(LARGE.ARRAY)
PRINT INMAT(SMALL.ARRAY)
This results in the following:
23}14
9
-Original Message-
From: Jeffrey Butera
... is there a function to determine it's dimensions?...

..
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] matrix dimension

2012-05-23 Thread Martin Phillips
Hi Jeffrey,

Take a look at the INMAT() function.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200



-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jeffrey Butera
Sent: 23 May 2012 20:59
To: U2 Users List
Subject: [U2] matrix dimension

I don't work with MATrices much in Unidata.

If I have my hands on a matrix setup from another program is there a 
function to determine it's dimensions?  My reading of DIM doesn't 
indicate it can do this and I don't see anything in the various MAT... 
commands that looks promising.


-- 
Jeffrey Butera
Manager of ERP Systems
Hampshire College
413-559-5556

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] matrix dimension

2012-05-23 Thread Wally Terhune
Extracted from the UniBasic Commands Reference for INMAT()

In the next example, the program segment dimensions two arrays and then prints 
the
dimensions using the PRINT statement and INMAT function:
DIM LARGE.ARRAY(23,14)
DIM SMALL.ARRAY(9)
PRINT INMAT(LARGE.ARRAY)
PRINT INMAT(SMALL.ARRAY)
This results in the following:
23}14
9

Wally Terhune
Technical Support Architect
Rocket Software
4600 South Ulster Street, Suite 1100 **Denver, CO 80237 **USA
t: +1 720 475 8055 **e: wterh...@rocketsoftware.com **w: rocketsoftware.com/u2




-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jeffrey Butera
Sent: Wednesday, May 23, 2012 1:59 PM
To: U2 Users List
Subject: [U2] matrix dimension

I don't work with MATrices much in Unidata.

If I have my hands on a matrix setup from another program is there a function 
to determine it's dimensions?  My reading of DIM doesn't indicate it can do 
this and I don't see anything in the various MAT... 
commands that looks promising.


--
Jeffrey Butera
Manager of ERP Systems
Hampshire College
413-559-5556

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users