0 Vote(s) - 0 Average 1 2 3 4 5 Release Matrix Functions Yamato OMA Joined: Dec 2010 Posts: 2,309 Reputation: 106 07-28-2013, 21:41 (This post was last modified: 07-29-2013, 11:35 by Yamato.) Hello I was recommended to release this functions, they are part of a math gsc stuff I made sometime ago, I havent made all the stuff I wanted about these, but I got tired and stopped the project, if anyone wants to work with these just go on or if you need help you can ask me Code: ```CreateMatrix( matrix ) {     files = StrTok( matrix, ";" );     m = [];     wait ( 0.05 );     for( i = 0; i < files.size; i ++ )     {         columns = StrTok( files[i], "," );         for( j = 0; j < columns.size; j ++ )             m[i][j] = int( columns[j] );     }     return m; } getMatrixRows( matrix ) {     rows = 0;     for( j = 0; j <= 1000; j ++ )     {         if( ! isDefined( matrix[j][0] ) )         {             rows = ( j );             break;         }     }     return rows; } getMatrixColumns( matrix ) {     columns = 0;     for( i = 0; i <= 1000; i ++ )     {         if( ! isDefined( matrix[0][i] ) )         {             columns = ( i );             break;         }     }     return columns; } isSquaredMatrix( matrix ) {     if( getMatrixRows( matrix ) == getMatrixColumns( matrix ) )         return true;     return false; } getMatrixOrder( matrix ) {     if( isSquaredMatrix( matrix ) )         return ( getMatrixRows( matrix ) ); } CreateOnes( m, n ) {     ones = [];     wait ( 0.05 );     for( i = 0; i < m; i ++ )         for( j = 0; j < n; j ++ )             ones[i][j] = 1;     return ones; } TransposeMatrix( matrix ) {     string = "";     rows = getMatrixRows( matrix );     columns = getMatrixColumns( matrix );     wait ( 0.1 );     for( u = 0; u < rows; u ++ )     {         for( k = 0; k < columns; k ++ )         {             string += matrix[k][u];             string += ",";         }         string = FixString( string );     }     wait ( 0.05 );     newstring = "";     for( w = 0; w < ( string.size - 1 ); w ++ )         newstring += string[w];     return ( CreateMatrix( newstring ) ); } FixString( string ) {     new = "";     for( i = 0; i < ( string.size - 1 ); i ++ )         new += string[i];     new += ";";     return new; } MultiplyMatrixes( matrix1, matrix2 ) {     newm = [];     sum = 0;     m = getMatrixRows( matrix1 );     n = getMatrixColumns( matrix1 );     p = getMatrixRows( matrix2 );     q = getMatrixColumns( matrix2 );     if( n != p )         return;     wait ( 0.1 );     for ( i = 0 ; i < m ; i ++ )     {         for ( j = 0 ; j < q ; j ++ )         {             for ( k = 0 ; k < p ; k++ )                 sum += ( matrix1[i][k] * matrix2[k][j] );             newm[i][j] = sum;             sum = 0;         }     }     return newm; } AddMatrixes( matrix1, matrix2 ) {         m = getMatrixRows( matrix1 );     n = getMatrixColumns( matrix1 );     p = getMatrixRows( matrix2 );     q = getMatrixColumns( matrix2 );     newm = [];     if( m != p || n != q )         return;     wait (  0.05 );     for( i = 0; i < m; i ++ )         for( j = 0; j < n; j ++ )             newm[i][j] = ( matrix1[i][j] + matrix2[i][j] );     return newm; } Determinant( matrix ) {     if( ! isSquaredMatrix( matrix ) )         return;     n = getMatrixOrder( matrix );     m1 = [];     m2 = [];     det = 0;     if( n == 1 )         return matrix[0][0];     wait ( 0.05 );     for( i = 0; i < n; i ++ )     {         if( i % 2 == 0 )         {             for( y = 0; y < n; y ++ )                 for( x = 0; x < n; x ++ )                     if(x

 Possibly Related Threads... Thread Author Replies Views Last Post [Release] nCr and Factorial Functions Yamato 2 1,141 06-18-2013, 17:24 Last Post: Nekochan [Release] Random Functions 1.1 Yamato 22 5,542 04-20-2013, 10:13 Last Post: Dominator56 Matrix House 2 807 12-13-2012, 23:28 Last Post: House Functions surtek 14 5,899 09-19-2012, 07:57 Last Post: Pozzuh [Solved] Info about functions, events and etc. Nerus 2 1,140 09-09-2012, 20:57 Last Post: surtek Seldom required functions Phl3x_ 3 1,453 06-03-2012, 10:53 Last Post: RaZ Help I find This functions and i need your help. Bloodfocus 5 1,850 04-23-2012, 01:43 Last Post: House Help Functions iPrintLnBold() [Z00MBY] Alex 7 3,027 04-16-2012, 08:44 Last Post: [Z00MBY] Alex [Release] Array functions master131 4 1,654 09-17-2011, 14:23 Last Post: AZUMIKKEL [Release] Random Functions Yamato 12 3,384 08-17-2011, 13:07 Last Post: Nekochan

Forum Jump:

Users browsing this thread: 1 Guest(s)