Sponsored links: Algebra eBooks
 

Related

lmax-max-solve

lmax([solve(x=2,x),so...

Calculate

lmax-makelist-max

lmax(makelist(n, n, 1...

Calculate

lmax-matrix-max

lmax([1,2,3,2]);

M : matrix([1,2],[3,2]);

M[1];

Calculate

lmax-max

lmax([1,2,3,2]);

Calculate

lmax-max

lmax([2,3]);

Calculate

lmax

Run Example
(%i1)nrm1(x) := block([ms],ms : matrix_size(x), lmax(makelist(sum(abs(x[i, j]), i, 1,ms[1]), j, 1,ms[2])));
(%o1) nrm1(x) := block([ms], ms : matrix_size(x), 
                            lmax(makelist(sum(!x    !, i, 1, ms ), j, 1, ms )))
                                              ! i, j!          1           2
(%i2) preob(m) := block([s], n : length(m),(s : 1, for i : 1 while ((i <
 n + 1) and (2*abs(m[i, i])) >
 sum(abs(m[i, j]), j, 1, n)) do s : i),if s = n then "eSTX PREOBLADANIE DIG. \L."else "nET PREOBLADANIQ DIAG. \L.");
(%o2) preob(m) := block([s], n : length(m), 
(s : 1, for i while (i < n + 1) and (2 !m    ! > sum(!m    !, j, 1, n)) 
                                       ! i, i!       ! i, j!
do s : i), if s = n then "eSTX PREOBLADANIE DIG. L."
 else "nET PREOBLADANIQ DIAG. L.")
(%i3) 
Run Example
nk : 2;
(%o1)                                  2
(%i2) nl : 2;
(%o2)                                  2
(%i3) N : 8;
(%o3)                                  8
(%i4) sp : 2;
(%o4)                                  2
(%i5) r[1] : matrix([0,1],[0,0]);
                                   [ 0  1 ]
(%o5)                              [      ]
                                   [ 0  0 ]
(%i6) r[2] : matrix([1,0],[1,1]);
                                   [ 1  0 ]
(%o6)                              [      ]
                                   [ 1  1 ]
(%i7) norm(M) := block(    n1 : length(M),    n2 : length(transpose(M)),    sqrt( sum(sum( M[i,j]^2, i,1,n1 ), j,1,n2) ));
(%o7) norm(M) := block(n1 : length(M), n2 : length(transpose(M)), 
                                                   2
                                     sqrt(sum(sum(M    , i, 1, n1), j, 1, n2)))
                                                   i, j
(%i8) minM(M) := lmin(makelist(lmin(M[i]),i,1,length(M)));
(%o8)        minM(M) := lmin(makelist(lmin(M ), i, 1, length(M)))
                                            i
(%i9) maxM(M) := lmax(makelist(lmax(M[i]),i,1,length(M)));
(%o9)        maxM(M) := lmax(makelist(lmax(M ), i, 1, length(M)))
                                            i
(%i10) f_randM : lambda([i,j], random(1.0));
(%o10)                    lambda([i, j], random(1.0))
(%i11) randM(n1,n2) := block(	M : genmatrix(f_randM,n1,n2),	M/norm(M));
                                                                  M
(%o11)  randM(n1, n2) := block(M : genmatrix(f_randM, n1, n2), -------)
                                                               norm(M)
(%i12) I : makelist(randM(nk,nl),j,1,N);
        [ 0.82322407301623  0.17583605613432 ]
(%o12) [[                                    ], 
        [ 0.43457137331563  0.32020544727451 ]
[ 0.21952812194026  0.36167186147605 ]
[                                    ], 
[ 0.53313429406549  0.73264499778892 ]
[ 0.48026238685182   0.64447503912071 ]
[                                     ], 
[ 0.034570224803372  0.59397379006384 ]
[ 0.7530697407959   0.031517169526439 ]
[                                     ], 
[ 0.47941627913502  0.44950268611319  ]
[ 0.81023067820622    0.58257038776883  ]
[                                       ], 
[ 0.064262670173717  0.0028810780119023 ]
[ 0.25255783446655  0.68837898710734 ]
[                                    ], 
[ 0.03366193469293  0.67912869510231 ]
[ 0.18056446560732  0.53563383884197 ]  [  0.137936134655   0.57827798704525 ]
[                                    ], [                                    ]]
[ 0.47397374812705  0.67516053686049 ]  [ 0.59860794175974  0.53687682434382 ]
(%i13) f_A[j,i] := sum(sum( r[i][k,l]*I[j][k,l], k,1,nk),l,1,nl);
(%o13)    f_A     := sum(sum((r )     (I )    , k, 1, nk), l, 1, nl)
             j, i              i        j
                                 k, l     k, l
(%i14) A : genmatrix( f_A, N, sp);
                   [ 0.17583605613432   1.578000893606369 ]
                   [                                      ]
                   [ 0.36167186147605   1.485307413794671 ]
                   [                                      ]
                   [ 0.64447503912071   1.108806401719027 ]
                   [                                      ]
                   [ 0.031517169526439  1.68198870604411  ]
(%o14)             [                                      ]
                   [ 0.58257038776883   0.87737442639184  ]
                   [                                      ]
                   [ 0.68837898710734   0.96534846426179  ]
                   [                                      ]
                   [ 0.53563383884197   1.329698750594861 ]
                   [                                      ]
                   [ 0.57827798704525   1.273420900758558 ]
(%i15) f_r[k,l,i] := 1/N * sum(A[j,i]*I[j][k,l],j,1,N) - 1/N^2 * sum(A[j,i],j,1,N) * sum(I[j][k,l],j,1,N);
                     1
(%o15) f_r        := - sum(A     (I )    , j, 1, N)
          k, l, i    N      j, i   j
                                     k, l
                                  1
                                - -- sum(A    , j, 1, N) sum((I )    , j, 1, N)
                                   2      j, i                 j
                                  N                              k, l
(%i16) f_r_1[k,l] := f_r[k,l,1];
(%o16)                      f_r_1     := f_r
                                 k, l       k, l, 1
(%i17) f_r_2[k,l] := f_r[k,l,2];
(%o17)                      f_r_2     := f_r
                                 k, l       k, l, 2
(%i18) r1[1] : genmatrix(f_r_1,nk,nl);
                  [ - 0.033164218778771  0.049262957284976  ]
(%o18)            [                                         ]
                  [ - 0.028209462239734  0.0080846687898183 ]
(%i19) r1[2] : genmatrix(f_r_2,nk,nl);
                  [ 0.010734172721221  - 0.053289012228687 ]
(%o19)            [                                        ]
                  [ 0.048629908178604   0.013765273691331  ]
(%i20) min1 : min(minM(r1[1]),minM(r1[2]));
(%o20)                        - 0.053289012228687
(%i21) max1 : max(maxM(r1[1]),minM(r1[2]));
(%o21)                         0.049262957284976
(%i22) r1[1] : (r1[1]-min1)/(max1-min1);
                    [ 0.19623995078158        1.0        ]
(%o22)              [                                    ]
                    [ 0.24455454252013  0.59846418659301 ]
(%i23) r1[2] : (r1[2]-min1)/(max1-min1);
                    [ 0.62429990621856        0.0        ]
(%o23)              [                                    ]
                    [ 0.99382704096884  0.65385663715687 ]
(%i24) abs(r1[1]-r[1]);
                 [ 0.19623995078158  1.1102230246251565E-16 ]
(%o24)           [                                          ]
                 [ 0.24455454252013     0.59846418659301    ]
(%i25) abs(r1[2]-r[2]);
                   [  0.37570009378144         0.0        ]
(%o25)             [                                      ]
                   [ 0.0061729590311589  0.34614336284313 ]
(%i26) 
Run Example
M : matrix([1,2],[3,2]);
                                   [ 1  2 ]
(%o1)                              [      ]
                                   [ 3  2 ]
(%i2) lmax(makelist(lmax(M[i]),i,1,length(M)));
(%o2)                                  3
(%i3) 
[abs,and,block,col,copy,create_list,fpprintprec,genmatrix,ident,invert,kill,length,lmax,makelist,matrix_size,random,submatrix,sum,while] [abs,and,block,col,copy,fpprintprec,genmatrix,ident,invert,length,lmax,makelist,matrix_size,random,submatrix,sum,while] [abs,block,genmatrix,lambda,length,lmax,lmin,makelist,matrix,random,sqrt,sum,transpose] [abs,cos,float,lmax,phi,ratprint,showtime,sin,sqrt] [abs,float,lmax,phi,ratprint,showtime,sin,sqrt] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,linsolve,lmax,lmin,load,matrix,plot2d,romberg,sqrt,submatrix] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,lmax,lmin,load,matrix,plot2d,print,romberg,sqrt,submatrix] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,lmax,lmin,load,matrix,plot2d,romberg,sqrt,submatrix] [append,atom,block,delete,do,emptyp,freeof,if,indices,lambda,length,lmax,lmin,makelist,map,member,not,parse_string,sdowncase,simplode,ssearch,string,sublist_indices,subst] [append,atom,block,delete,do,emptyp,freeof,if,indices,lambda,length,lmax,lmin,makelist,map,member,not,sublist_indices,subst] [append,disp,intersect,listify,lmax,setify] [block,first,ifactors,lambda,length,lmax,makelist,map,phi,product] [block,float,genmatrix,lambda,length,lmax,lmin,make_random_state,makelist,matrix,return,set_random_state,sqrt,sum,transpose,true] [block,genmatrix,lambda,length,lmax,lmin,make_random_state,makelist,matrix,set_random_state,sqrt,sum,transpose,true] [block,genmatrix,lambda,length,lmax,lmin,makelist,matrix,random,sqrt,sum,transpose] [debugmode,length,lmax,lmin,random,true] [ev,float,indices,lambda,lmax,makelist,matrix,simp,sublist_indices,sum] [ev,indices,lambda,lmax,makelist,matrix,simp,sublist_indices,sum] [integrate,lambda,lmax,lmin,map,plot2d,rhs,solve] [length,lmax,makelist,matrix] [lmax,lmin,lsum,makelist,random,sum] [lmax,lsum,makelist,random,sum] [lmax,max] [lmax]

Related Help

Help for Lmax