# matrix support provide matrix:* "gsl.pfo" pfo create-polyword >matrix "( thing -- matrix )\tConvert thing to matrix." doc ' list>matrix polyword >matrix ' image>matrix polyword >matrix ' matrix>list polyword >list ' list>diag polyword >diag ' matrix:* polyword * ' matrix:+ polyword + ' matrix:- polyword - ' matrix:.* polyword .* ' matrix:atan polyword atan ' matrix:cos polyword cos ' matrix:exp polyword exp ' matrix:sin polyword sin ' matrix:tan polyword tan ' matrix:transpose polyword transpose ' matrix:clip polyword clip # util : vector pack reverse 1 pack >matrix ;; # FIXME: this LU thing is crazy : matrix:inverse matrix:float>double matrix:LU matrix:LU>inverse matrix:double>float ; create-polyword inverse "( thing -- reciprocal )\tCompute the inverse of something." doc ' float:inverse polyword inverse ' matrix:inverse polyword inverse # FIXME: ugly hacks. find proper ways to do these. both should be last # try in polyword list : any:/ inverse * ; : any:swap* swap * ; ' any:/ polyword / ' any:swap* polyword * : matrix:dot matrix:transpose * matrix:1x1>float ; # FIXME # : matrix:dot matrix:transpose* matrix:1x1>float ; create-polyword dot "( vector vector -- dotproduct )\tCompute vector dot product." doc ' matrix:dot polyword dot : 1Dlist>vector 1 pack >matrix ; "( list -- matrix )\tConvert a 1D list to a single row matrix." doc