Sponsored links: Algebra eBooks
 

Related

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

Calculate

block-genmatrix-if-random-return-while

vecteur_activation(n)...

vecteur_initialisatio...

matrice_poid(n):=bloc...

Calculate

block-genmatrix-if-random-return-while

vecteur_activation(n)...

vecteur_initialisatio...

matrice_poid(n):=bloc...

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

test(1);

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

test(3);

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

test(2);

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

test(4);

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

test(2);

Calculate

block-genmatrix-if-random-return

vecteur_activation(n)...

test(n):=block([compt...

test(3);

Calculate

[block,genmatrix,if,random,return]

Run Example
(%i1)vecteur_activation(n):=block([], for j:1 thru n do b[j,1]:random(2),return(genmatrix(b,n,1)));
(%o1) vecteur_activation(n) := block([], for j thru n do b     : random(2), 
                                                          j, 1
                                                    return(genmatrix(b, n, 1)))
(%i2) test(n):=block([compt,a],compt:1,w[1,1]:vecteur_activation(n),for i:2 thru 2^n do (while compt>
0 do(a:vecteur_activation(n),compt:0, for j:1 thru i-1 do (if (w[1,j]=a) then compt:compt+1)),if compt:0 then w[1,i]:a),return(genmatrix(w,1,2^n)));
(%o2) test(n) := block([compt, a], compt : 1, w     : vecteur_activation(n), 
                                               1, 1
                   n
for i from 2 thru 2  do (while compt > 0 do (a : vecteur_activation(n), 
compt : 0, for j thru i - 1 do if w     = a then compt : compt + 1), 
                                   1, j
                                                      n
if compt : 0 then w     : a), return(genmatrix(w, 1, 2 )))
                   1, i
(%i3) test(2);
                        [ [ 0 ]                      ]
(%o3)                   [ [   ]  w      w      w     ]
                        [ [ 0 ]   1, 2   1, 3   1, 4 ]
(%i4) 
Run Example
vecteur_activation(n):=block([], for j:1 thru n do b[j,1]:random(2),return(genmatrix(b,n,1)));
(%o1) vecteur_activation(n) := block([], for j thru n do b     : random(2), 
                                                          j, 1
                                                    return(genmatrix(b, n, 1)))
(%i2) test(n):=block([compt:1],w[1,1]:vecteur_activation(n),for i:2 thru n do (while compt>
0 do(a:vecteur_activation(n),compt:0, for j:1 thru i-1 do (if (w[1,j]:a) then compt:compt+1)),if compt:0 then w[1,i]:a),return(genmatrix(w,1,n)));
(%o2) test(n) := block([compt : 1], w     : vecteur_activation(n), 
                                     1, 1
for i from 2 thru n do (while compt > 0 do (a : vecteur_activation(n), 
compt : 0, for j thru i - 1 do if w     : a then compt : compt + 1), 
                                   1, j
if compt : 0 then w     : a), return(genmatrix(w, 1, n)))
                   1, i
(%i3) 
Run Example
vecteur_activation(n):=block([], for j:1 thru n do b[j,1]:random(2),return(genmatrix(b,n,1)));
(%o1) vecteur_activation(n) := block([], for j thru n do b     : random(2), 
                                                          j, 1
                                                    return(genmatrix(b, n, 1)))
(%i2) test(n):=block([compt],compt:1,w[1,1]:vecteur_activation(n),for i:2 thru 2^n do (while compt>
0 do(a:vecteur_activation(n),compt:0, for j:1 thru i-1 do (if (w[1,j]:a) then compt:compt+1)),if compt:0 then w[1,i]:a),return(genmatrix(w,1,2^n)));
(%o2) test(n) := block([compt], compt : 1, w     : vecteur_activation(n), 
                                            1, 1
                   n
for i from 2 thru 2  do (while compt > 0 do (a : vecteur_activation(n), 
compt : 0, for j thru i - 1 do if w     : a then compt : compt + 1), 
                                   1, j
                                                      n
if compt : 0 then w     : a), return(genmatrix(w, 1, 2 )))
                   1, i
(%i3) test(4);
               [ [ 0 ] ]
               [ [   ] ]
               [ [ 1 ] ]
(%o3)  Col 1 = [ [   ] ] Col 2 = [ w     ] Col 3 = [ w     ] Col 4 = [ w     ]
               [ [ 1 ] ]         [  1, 2 ]         [  1, 3 ]         [  1, 4 ]
               [ [   ] ]
               [ [ 1 ] ]
 Col 5 = [ w     ] Col 6 = [ w     ] Col 7 = [ w     ] Col 8 = [ w     ]
         [  1, 5 ]         [  1, 6 ]         [  1, 7 ]         [  1, 8 ]
 Col 9 = [ w     ] Col 10 = [ w      ] Col 11 = [ w      ] Col 12 = [ w      ]
         [  1, 9 ]          [  1, 10 ]          [  1, 11 ]          [  1, 12 ]
 Col 13 = [ w      ] Col 14 = [ w      ] Col 15 = [ w      ]
          [  1, 13 ]          [  1, 14 ]          [  1, 15 ]
 Col 16 = [ w      ]
          [  1, 16 ]
(%i4) 
[addrow,block,concat,display,false,if,log,matrix,numer,print,return,round,true,while] [addrow,block,concat,false,if,log,matrix,numer,print,return,round,true,while] [append,ascii,block,concat,copylist,delete,divsum,first,if,make_random_state,next_prime,second,set_random_state,slength,substring,true] [append,ascii,block,concat,delete,divsum,first,if,make_random_state,next_prime,second,set_random_state,slength,substring,true] [append,atom,block,delete,flatten,if,lambda,load,map,return] [append,block,buildq,first,return,show,simp] [append,block,col,do,genmatrix,if,matrixmap,mod,quotient,transpose] [append,block,debugmode,print,return,rhs,true] [append,block,declare,do,factor,if,lsum] [append,block,delete,do,emptyp,if,lambda,length,makelist,map,not,subst] [append,block,do,flatten,load,makelist,return] [append,block,listify,makelist,primep,return,setify] [apply,args,block,col,copymatrix,do,genmatrix,map,mod,quotient,return,transpose] [bern,bfloat,block,fpprec,makelist,numer,return,sum] [bfloat,bftorat,block,emptyp,equal,first,fpprec,if,is,mod,not,numer,ratepsilon,ratprint,return,round] [bfloat,bftorat,block,emptyp,first,fpprec,if,mod,not,numer,ratepsilon,ratprint,return] [bfloat,bftorat,block,ev,float2bf,makelist,mod,ratepsilon,ratprint,return] [bfloat,bftorat,block,float2bf,makelist,mod,ratepsilon,ratprint,return] [bftorat,block,cons,delete,emptyp,false,first,float2bf,fpprec,if,integerp,kill,lambda,listp,map,mod,ratdenom,ratepsilon,ratprint,rest,return] [bftorat,block,delete,ev,false,float,if,integerp,mod,ratdenom,ratepsilon,ratprint] [bftorat,block,delete,float,if,integerp,mod,rat,ratdenom,ratepsilon,ratprint] [bftorat,block,emptyp,equal,first,float,fpprec,if,is,mod,not,numer,ratepsilon,ratprint,return,round] [bftorat,block,emptyp,first,float,fpprec,if,integerp,mod,not,numer,ratepsilon,ratprint,return] [bftorat,block,ev,false,float2bf,fpprec,if,integerp,kill,mod,ratdenom,ratepsilon,ratprint,return] [bftorat,block,false,float2bf,fpprec,if,integerp,kill,mod,ratdenom,ratepsilon,ratprint,return] [bftorat,block,float2bf,fpprec,if,integerp,mod,ratdenom,ratepsilon,ratprint,return] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return,subst] [binomial,block,delta,determinant,do,expand,genmatrix,kron_delta,return] [binomial,block,genmatrix,return] [block,concat,do,kill,makelist,obase,return,stringdisp,true,while] [block,cons,if,sort,xreduce] [block,cons,if,sort] [block,copymatrix,genmatrix,if,print,random,return,while] [block,cos,flatten,if,li,load,makelist,map,numer,outermap,plot2d,sin,sort,unique] [block,display,fpprec,fpprintprec,jacobi,printf,return] [block,display,fpprec,fpprintprec,return] [block,do,genmatrix,mod,quotient,return] [block,do,if,length,while] [block,do,mod,return,while] [block,genmatrix,if,print,random,return,while] [block,genmatrix,if,random,return,while] [block,genmatrix,if,random,return] [block,genmatrix,print,random,return] [block,genmatrix,random,return] [block,if,load,primep] [block,if] [block,return] [ceiling,do,float,genmatrix,kill,permanent,print,random,row,sqrt] [do,float,if,print,return] [genmatrix,random]

Related Help

Help for Block

Help for Genmatrix

Help for If

Help for Random

Help for Return