[PHP] matrix functions

2002-06-10 Thread johannes reichardt

hi list, 

i have a question regarding a class for matrix modifications so i dont
have to re-invent the wheel ;)

i would like to do things like this:

matrix with 5*5 colums/rows

x x x x x 
0 0 0 0 0
x x x x x
x x x x x
x x x x x


x x x x x 
x x x x x
0 0 0 0 0
x x x x x
x x x x x


maybe that is incredebly stupid and simple but
my brain doesnt tell me anything right now - 
how can i transform colums/rows quickly and efficient?

Any help appreciated!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] matrix functions

2002-06-10 Thread Lazor, Ed

I think this will work.  You'll have to test it to confirm:

$A[0][0] = x;
$A[0][1] = x;
$A[0][2] = x;
$A[0][3] = x;
$A[0][4] = x;
$A[1][0] = 0;
$A[1][1] = 0;
$A[1][2] = 0;
$A[1][3] = 0;
$A[1][4] = 0;

$B = $C = array();

$B = $A[0];
$C = $A[1];

$A[0] = $C;
$A[1] = $B;

-Original Message-
From: johannes reichardt [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 8:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] matrix functions


hi list, 

i have a question regarding a class for matrix modifications so i dont
have to re-invent the wheel ;)

i would like to do things like this:

matrix with 5*5 colums/rows

x x x x x 
0 0 0 0 0
x x x x x
x x x x x
x x x x x


x x x x x 
x x x x x
0 0 0 0 0
x x x x x
x x x x x


maybe that is incredebly stupid and simple but
my brain doesnt tell me anything right now - 
how can i transform colums/rows quickly and efficient?

Any help appreciated!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] matrix functions

2002-06-10 Thread Pushkar Pradhan

If there isn't one, (have you tried phpclasses.org etc.), I think the
string functions are powerful enough.
What kind of manipulations you need? Is it simple column/row transforms or
doing all kinds of maptrix operations?
 hi list,

 i have a question regarding a class for matrix modifications so i dont
 have to re-invent the wheel ;)

 i would like to do things like this:

 matrix with 5*5 colums/rows

 x x x x x
 0 0 0 0 0
 x x x x x
 x x x x x
 x x x x x


 x x x x x
 x x x x x
 0 0 0 0 0
 x x x x x
 x x x x x


 maybe that is incredebly stupid and simple but
 my brain doesnt tell me anything right now -
 how can i transform colums/rows quickly and efficient?

 Any help appreciated!


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-Pushkar S. Pradhan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] matrix functions

2002-06-10 Thread Jason Wong

On Tuesday 11 June 2002 11:32, johannes reichardt wrote:
 hi list,

 i have a question regarding a class for matrix modifications so i dont
 have to re-invent the wheel ;)

 i would like to do things like this:

 matrix with 5*5 colums/rows

 x x x x x
 0 0 0 0 0
 x x x x x
 x x x x x
 x x x x x


 x x x x x
 x x x x x
 0 0 0 0 0
 x x x x x
 x x x x x


 maybe that is incredebly stupid and simple but
 my brain doesnt tell me anything right now -
 how can i transform colums/rows quickly and efficient?

If all you want to do is move one row of a matrix to another then stuff your 
matrix into an array and use array_slice(), array_splice().

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Absurdity, n.:
A statement or belief manifestly inconsistent with one's own opinion.
-- Ambrose Bierce, The Devil's Dictionary
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php