
(* ::Package:: *)

Print["Loading helper.m.."];

(*
 *  Convert a list of expressions into equations.
 *)
toEqs[c_] := Table[c[[i]] == 0, {i, 1, Length[c]}]


(*
 *  Display expression list with numbers
 *)
show[eqs_] := Module[
  {tt, i, j},
  
  tt = Table[j, {i, 1, 3}, {j, 1, Length[eqs]}];
  
  For[i = 1, i <= Length[eqs], i++,
   tt[[2]][[i]] = ":";
   tt[[3]][[i]] = eqs[[i]];
   ];
  
  Transpose[tt] // MatrixForm
  
]


(*
 *  Sort expression list according to length.
 *)
emSort[arr_] := Sort[Union[arr], emSize[#1] <= emSize[#2] &]


(*
 *  Simplify and sort expression list 
 *)
simp[f_] := emSort[FullSimplify[f]]


(* 
 *   print notebook 
 *)
printNotebook[name_]:= NotebookPrint[ SelectedNotebook[], "/u/64/fdahl/unix/Factorisation/notebooks/" <> name]