(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
SetDirectory@"C:\\drorbn\\AcademicPensieve\\Projects\\OU";
<< "OU-Programs.m"


(* ::Input::Initialization:: *)
CVD[vd_VD]:=((CVD@@vd)/.{_EOS->Sequence[],Subscript[X, s_][i_,j_]:>Sequence[s i,j]});
AllVPBs[n_,m_]:=DeleteDuplicatesBy[CVD@*\!\(\*OverscriptBox[\(\[CapitalGamma]\), \(_\)]\)]@Flatten@Table[b, {k,0,m},{b,ProudVPBs[n,k]}]


(* ::Input::Initialization:: *)
SaveList[n_,m_]:=Module[{fname, VPBs,t, c},
fname="Data/VPB_"<>ToString[n]<>"_"<>ToString[m]<>".m";
If[FileType[fname]===File, VPBs=Get[fname]; t="Cached",
t=First@Timing[VPBs=Select[AllVPBs[n,m] /. Subscript[\!\(\*OverscriptBox[\(\[Sigma]\), \(_\)]\), i_,j_]:>xm[i,j] /. Subscript[\[Sigma], i_,j_]->xp[i,j], (Length[#]==m+1)&]];
Echo@"Saving...";
Put[VPBs, fname]
];
c=Length[VPBs];
Echo[{n,m}->{t,c}];
c
];



