{VERSION 4 0 "SUN SPARC SOLARIS" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 97 "These two functions allow \+ us to take a Vector and produce a Matrix with entries from the vector. " }}{PARA 0 "" 0 "" {TEXT -1 100 "The first v_dim entries of the vect or become the first column of the matrix, the next v_dim entries " }} {PARA 0 "" 0 "" {TEXT -1 179 "become the second column of the matrix a nd so on. First we make a copy of the plaintext vector which has le ngth a multiple of v_dim (just to simplify the coding of the Matrix). " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 82 "The r everse function is Decompose_mat(). It takes a matrix and produces a \+ Vector." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 326 "Parse_mat := pr oc(p_vec, v_dim)\nlocal i, j, h_dim, p_vec_copy,p_mat;\n\nh_dim := cei l(LinearAlgebra[Dimension](p_vec)/v_dim);\np_vec_copy := Vector(h_dim* v_dim, p_vec);\n\np_mat :=Matrix(v_dim,h_dim);\nfor j from 1 to h_dim \+ do\n for i from 1 to v_dim do\n p_mat[i,j] := p_vec_copy[i+v_dim *(j-1)];\n od;\nod;\nRETURN(p_mat);\nend;\n" }{XPPMATH 20 "6#>%*Pars e_matGR6$%&p_vecG%&v_dimG6'%\"iG%\"jG%&h_dimG%+p_vec_copyG%&p_matG6\"F /C&>8&-%%ceilG6#*&-&%.LinearAlgebraG6#%*DimensionG6#9$\"\"\"9%!\"\">8' -%'VectorG6$*&F2F>F?F>F=?(8%F>F>F2%%trueG?(8$F>F>F?FI>&8(6$FKFH&FB6#,& FKF>*&F?F>,&FHF>F>F@F>F>-%'RETURNG6#FNF/F/F/" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%*Parse_matGR6$%&p_vecG%&v_dimG6'%\"iG%\"jG%&h_dimG%+p _vec_copyG%&p_matG6\"F/C'>8&-%%ceilG6#*&-&%.LinearAlgebraG6#%*Dimensio nG6#9$\"\"\"9%!\"\">8'-%'VectorG6$*&F2F>F?F>F=>8(-%'MatrixG6$F?F2?(8%F >F>F2%%trueG?(8$F>F>F?FN>&FH6$FPFM&FB6#,&FPF>*&F?F>,&FMF>F>F@F>F>-%'RE TURNG6#FHF/F/F/" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "h := Vec tor([1,2,3,4,5,6,7,8,9,0]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"hG- %'RTABLEG6$\"(WR?%-%'MATRIXG6#7,7#\"\"\"7#\"\"#7#\"\"$7#\"\"%7#\"\"&7# \"\"'7#\"\"(7#\"\")7#\"\"*7#\"\"!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "type (h,Vector);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#% %trueG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "H :=Parse_mat(h,3 );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"HG-%'RTABLEG6$\"(#*ow&-%'MAT RIXG6#7%7&\"\"\"\"\"%\"\"(\"\"!7&\"\"#\"\"&\"\")F17&\"\"$\"\"'\"\"*F1 " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "type (H,Matrix);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%%trueG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 299 "Decompose_mat := proc(p_mat,v_dim)\nlocal i,j, h_dim , count, p_vec;\n\nh_dim :=LinearAlgebra[ColumnDimension](p_mat); \np_ vec :=Vector((v_dim*h_dim));\ncount :=1;\nfor j from 1 to h_dim do\n \+ for i from 1 to v_dim do\n p_vec[count] := p_mat[i,j];\n cou nt := count +1;\n od;\nod;\nRETURN(p_vec);\nend;" }}{PARA 12 "" 1 " " {XPPMATH 20 "6#>%.Decompose_matGR6$%&p_matG%&v_dimG6'%\"iG%\"jG%&h_d imG%&countG%&p_vecG6\"F/C'>8&-&%.LinearAlgebraG6#%0ColumnDimensionG6#9 $>8(-%'VectorG6#*&F2\"\"\"9%F@>8'F@?(8%F@F@F2%%trueG?(8$F@F@FAFFC$>&F; 6#FC&F96$FHFE>FC,&FCF@F@F@-%'RETURNG6#F;F/F/F/" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 "Decompose_mat(H,2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\"([8t&-%'MATRIXG6#7*7#\"\"\"7#\"\"#7#\"\"% 7#\"\"&7#\"\"(7#\"\")7#\"\"!F7" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "9 0 " 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 } {RTABLE_HANDLES 4203944 5766892 5731348 }{RTABLE M6R0 I4RTABLE_SAVE/4203944X*%)anythingG6"6"\[[[[[t+"+"""""#""$""%""&""'""("")""*""!F & } {RTABLE M6R0 I4RTABLE_SAVE/5766892X,%)anythingG6"6"][[[[[p-"$"%"""""#""$""%""&""'""("")""*"" !F0F0F& } {RTABLE M6R0 I4RTABLE_SAVE/5731348X*%)anythingG6"6"\[[[[[t)")"""""#""%""&""("")""!F-F& }