public CATItems AddItem_D(CATItems parItem, int[] items) { CATItems newItem = this.FIndItem_D(items); CATItems res_item = new CATItems(parItem.a.Length + 1); for (int i = 0; i < parItem.a.Length; i++) { res_item.a[i] = parItem.a[i]; res_item.b[i] = parItem.b[i]; res_item.c[i] = parItem.c[i]; res_item.d[i] = parItem.d[i]; } int new_index = res_item.a.Length - items.Length; for (int j = 0; j < newItem.a.Length; j++) { res_item.a[new_index] = newItem.a[j]; res_item.b[new_index] = newItem.b[j]; res_item.c[new_index] = newItem.c[j]; res_item.d[new_index] = newItem.d[j]; new_index++; } return(res_item); }
// Find multiple items with Item Index public CATItems FindItem(int[] items) { CATItems result = null; ModelNames.Models tempModel = this.model; if (tempModel == ModelNames.Models.NoModel) { result = new CATItems(items.Length, this.IsGroupExist); } else { result = new CATItems(items.Length, this.model.EnumToString(), this.nrCat); } Tuple <CATItems.ColumnNames, int>[] cols = this.GetKeys(); for (int i = 0; i < cols.Length; i++) { double[] itemsTemp = this.CATItemColumns[cols[i]]; List <double> ItemValues = new List <double>(); for (int k = 0; k < items.Length; k++) { ItemValues.Add(itemsTemp[items[k] - 1]); } result.CATItemColumns[cols[i]] = ItemValues.ToArray(); } return(result); }
// Find single item with Item Index public CATItems FindItem(int item) { CATItems result = null; ModelNames.Models tempModel = this.model; if (tempModel == ModelNames.Models.NoModel) { result = new CATItems(1); } else { result = new CATItems(1, this.model.EnumToString(), this.nrCat); } Tuple <CATItems.ColumnNames, int>[] cols = this.GetKeys(); for (int i = 0; i < cols.Length; i++) { double[] itemsTemp = this.CATItemColumns[cols[i]]; double[] singleItemValue = new double[] { itemsTemp[item - 1] }; result.CATItemColumns[cols[i]] = singleItemValue; } return(result); }
public StartItemsModel(int[] items, CATItems par, double[] thStart, int startSelect) { this.items = items; this.par = par; this.thStart = thStart; this.startSelect = startSelect; }
public NextItemModel(int item, CATItems par, double info, int criterion, int randomesque) { this.item = item; this.par = par; this.info = info; this.criterion = criterion; this.randomesque = randomesque; }
public NextItemModel(int item, CATItems par, double info, int criterion, int randomesque, double[] prior_prop, double[] post_prop, double[] cb_prop) { this.item = item; this.par = par; this.info = info; this.criterion = criterion; this.randomesque = randomesque; this.prior_prop = prior_prop; this.post_prop = post_prop; this.cb_prop = cb_prop; }
// Usage:: Find Single item from itembank (Single row) and Add with the invoked list public void AddItem(CATItems parItem, int item) { CATItems result = this.FindItem(item); Tuple <CATItems.ColumnNames, int>[] cols = parItem.GetKeys(); for (int i = 0; i < cols.Length; i++) { List <double> tempValues = parItem.CATItemColumns[cols[i]].ToList(); tempValues.Add(result.CATItemColumns[cols[i]][0]); parItem.CATItemColumns[cols[i]] = tempValues.ToArray(); } parItem.NumOfItems++; }
public CATItems FIndItem_D(int[] items) { CATItems res_items = null; if (items.Length > 0) { res_items = new CATItems(items.Length); for (int i = 0; i < items.Length; i++) { res_items.a[i] = this.a[items[i] - 1]; res_items.b[i] = this.b[items[i] - 1]; res_items.c[i] = this.c[items[i] - 1]; res_items.d[i] = this.d[items[i] - 1]; } } return(res_items); }