Re: [BLACKBOX] Matrix slices - syntax

From: Douglas G. Danforth <"Douglas>
Date: Fri, 2 Apr 2010 17:50:59 -0700

----boundary-LibPST-iamunique-1418940299_-_-
Content-type: text/plain

Robert,

You're right. I just threw that together without using the compiler.
Here is code that does work.

    TYPE
        Value = POINTER TO RECORD x: REAL END;
        AA = POINTER TO ARRAY OF ARRAY OF Value;
        Matrix = POINTER TO RECORD
                row: AA;
                col: AA;
            END;

    PROCEDURE NewMatrix (m, n: INTEGER): Matrix;
    VAR M: Matrix; VAR i, j: INTEGER;
    BEGIN
        NEW(M);
        NEW(M.row, m, n);
        NEW(M.col, n, m);
        FOR i := 0 TO m-1 DO
            FOR j := 0 TO n-1 DO
            NEW(M.row[i,j]);
            M.col[j,i] := M.row[i,j]
            END
        END;
    RETURN M
    END NewMatrix;

Robert wrote:
> Doug
>
> Have you actually tried this - it does not look
> like it will work to me?
>
> Cheers
> Robert
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1418940299_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFJvYmVydCxccGFyDQpccGFyDQpZb3UncmUgcmln
aHQuICBJIGp1c3QgdGhyZXcgdGhhdCB0b2dldGhlciB3aXRob3V0IHVzaW5nIHRoZSBjb21waWxl
ci5ccGFyDQpIZXJlIGlzIGNvZGUgdGhhdCBkb2VzIHdvcmsuXHBhcg0KXHBhcg0KICAgIFRZUEVc
cGFyDQogICAgICAgIFZhbHVlID0gICAgIFBPSU5URVIgVE8gUkVDT1JEIHg6IFJFQUwgRU5EO1xw
YXINCiAgICAgICAgQUEgPSAgICBQT0lOVEVSIFRPIEFSUkFZIE9GIEFSUkFZIE9GIFZhbHVlO1xw
YXINCiAgICAgICAgTWF0cml4ID0gICAgIFBPSU5URVIgVE8gUkVDT1JEXHBhcg0KICAgICAgICAg
ICAgICAgIHJvdzogICAgQUE7XHBhcg0KICAgICAgICAgICAgICAgIGNvbDogICAgQUE7XHBhcg0K
ICAgICAgICAgICAgRU5EO1xwYXINClxwYXINCiAgICBQUk9DRURVUkUgTmV3TWF0cml4IChtLCBu
OiBJTlRFR0VSKTogTWF0cml4O1xwYXINCiAgICBWQVIgTTogTWF0cml4OyBWQVIgaSwgajogSU5U
RUdFUjtccGFyDQogICAgQkVHSU5ccGFyDQogICAgICAgIE5FVyhNKTtccGFyDQogICAgICAgIE5F
VyhNLnJvdywgbSwgbik7XHBhcg0KICAgICAgICBORVcoTS5jb2wsIG4sIG0pO1xwYXINCiAgICAg
ICAgRk9SIGkgOj0gMCBUTyBtLTEgRE9ccGFyDQogICAgICAgICAgICBGT1IgaiA6PSAwIFRPIG4t
MSBET1xwYXINCiAgICAgICAgICAgIE5FVyhNLnJvd1tpLGpdKTtccGFyDQogICAgICAgICAgICBN
LmNvbFtqLGldIDo9IE0ucm93W2ksal1ccGFyDQogICAgICAgICAgICBFTkRccGFyDQogICAgICAg
IEVORDtccGFyDQogICAgUkVUVVJOIE1ccGFyDQogICAgRU5EIE5ld01hdHJpeDtccGFyDQpccGFy
DQpSb2JlcnQgd3JvdGU6XHBhcg0KPiBEb3VnXHBhcg0KPlxwYXINCj4gSGF2ZSB5b3UgYWN0dWFs
bHkgdHJpZWQgdGhpcyAtIGl0IGRvZXMgbm90IGxvb2tccGFyDQo+IGxpa2UgaXQgd2lsbCB3b3Jr
IHRvIG1lP1xwYXINCj5ccGFyDQo+IENoZWVyc1xwYXINCj4gUm9iZXJ0XHBhcg0KPlxwYXINClxw
YXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0aCBi
b2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9fQC3OXnt
----boundary-LibPST-iamunique-1418940299_-_---
Received on Sat Apr 03 2010 - 02:50:59 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:33 UTC