userddet:=proc(a::Matrix,n::integer)::integer; local r,s,t,u,v,S0,S1; local x,y,z; if n=1 then return(a[1,1]): end if: x:=Vector(2): z:=Vector(n): x[2]:=a[1,1]: for r from 1 to n-1 do y:=Vector(r+2): z[1]:=a[r+1,r+1]: S0:=Vector(r): for t from 1 to r do S0[t]:=a[t,r+1]: end do: if rr+1 then S1:=Vector(r): for u from 1 to r do S1[u]:=0: for v from 1 to r do S1[u]:=max(S1[u],a[u,v]+S0[v]): end do: end do: S0:=S1: end if: if r0 then b1[j,k]:=d0: b2[k,j]:=d0: else b1[j,k]:=0: b2[k,j]:=0: end if: end do: end do: row0:=userddet(b1,n): colm0:=userddet(b2,n): if row0r+1 then S1:=Vector(r): for u from 1 to r do w:=userzero: for v from 1 to r do w:=w,sdmp:-Multiply(a[u,v],S0[v]): end do: S1[u]:=sdmp:-Add(w): end do: S0:=S1: end if: if rnv then d2:=nv: end if: exp0:=seq(vlist[i],i=1..nv): m9sdmp:=map(sdmp:-Import,m9,plex(exp0),pack=d2): userzero:=sdmp:-Import(0,plex(exp0),pack=d2): usermone:=sdmp:-Import(-1,plex(exp0),pack=d2): p:=userdet(m9sdmp,n9,userzero,usermone); quit: