include(`../prg/matrix.txt'): `Apply a matrix to a vector': func(axb,{ smooth(< for(, { dotprod(elem([x],[i]), [y]),})>)}): `Matrix multiplication': func(mmult,{ sub({let(a,[x]):let(b,[y]):print_ smooth(,{ smooth(,{ dotprod(elem([a],[j]),column([b],[k])), })>),})>)})}): func(determinant,{sub({ let(a,len([x])): if_[a]=1 @ one: if_[a]=2 @ two: goto_more: anchor_one: print_[x]: goto_done: anchor_two: print_melem([x],1,1)*melem([x],2,2) - melem([x],1,2)*melem([x],2,1): goto_done: anchor_more: let(k,1): [a]:do: let(s,submatrix([x],1,[k])): let(m,determinant([s])): iff((int([k])%2)=0,{let(m,-1*[m])},{}): print_(melem([x],1,[k])*[m])+: let(k,[k]+1):loop:print_0: anchor_done})}): func(minverse,{smooth(),:let(k,[k]+1): loop})>)}): func(mtest,{mmult([x],minverse([x]))}): mtest(<<1,2,-1>,<2,1,2>,<-1,2,1>>),: mtest(<<-4,5,2>,<8,-2,1>,<3,7,0>>),: print_`linalg.txt',: