当前位置: 首页>>代码示例>>C#>>正文


C# Filter.Add方法代码示例

本文整理汇总了C#中Filter.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Filter.Add方法的具体用法?C# Filter.Add怎么用?C# Filter.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filter的用法示例。


在下文中一共展示了Filter.Add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataPoint

 public DataPoint(int h, int f, List<List<long>> halos)
 {
     hashFunctions = h;
     filterSize = f;
     sum = 0;
     haloFilters = new List<Filter<long>>();
     numIntersects = 0;
     foreach (List<long> halo in halos)
     {
         Filter<long> currentBuild = new Filter<long>(2, 0.5f, null, filterSize, hashFunctions);
         foreach (long id in halo)
         {
             currentBuild.Add(id);
         }
         haloFilters.Add(currentBuild);
     }
 }
开发者ID:dcrankshaw,项目名称:GadgetLoader,代码行数:17,代码来源:DataPoint.cs

示例2: BuildEntryDatabase

        public static void BuildEntryDatabase()
        {
            XmlDataDocument AccessoryTable = new XmlDataDocument();
            AccessoryTable.Load(GlobalSettings.Default.StartupPath + "packingslips\\accessorytable.xml");

            XmlNodeList NodeList = AccessoryTable.GetElementsByTagName("DefineAssetString");
            AccessoryFilter = new Filter<ulong>(NodeList.Count, 0.01f, delegate(ulong Input) { return 0; });

            foreach (XmlNode Node in NodeList)
            {
                ulong ID = Convert.ToUInt64(Node.Attributes["assetID"].Value, 16);
                AccessoryFilter.Add(ID);
            }

            XmlDataDocument AnimTable = new XmlDataDocument();
            AnimTable.Load(GlobalSettings.Default.StartupPath + "packingslips\\animtable.xml");

            NodeList = AnimTable.GetElementsByTagName("DefineAssetString");
            AnimFilter = new Filter<ulong>(NodeList.Count, 0.01f, delegate(ulong Input) { return 0; });

            foreach (XmlNode Node in NodeList)
            {
                ulong ID = Convert.ToUInt64(Node.Attributes["assetID"].Value, 16);
                AnimFilter.Add(ID);
            }
        }
开发者ID:Ronnrein,项目名称:Project-Dollhouse,代码行数:26,代码来源:Database.cs

示例3: ProcessIndraFofs


//.........这里部分代码省略.........
                    }
                }
                DebugOut.PrintLine("Ngroups: " + nGroups + " totNGroups: " + totNGroups + "  NIds: " + NIds + "  Ntask: " + Ntask);
                filenumber++;
                //if (filenumber > lastSnapshotFile)
                // {
                //   done = true;
                //}
                if (filenumber == Ntask)
                {
                    done = true;
                }

            }

            nGroups = 0;
            totNGroups = 0;
            NIds = 0;
            Ntask = 0;
            done = false;
            filenumber = 0;
            skip = 0;

            while (!done)
            {
                groupIDFile = GetSimDBFOFFile(this.inPath, isnap, this.groupIDFilePrefix, filenumber);

                using (BinaryReader reader = new BinaryReader(new FileStream(groupIDFile, FileMode.Open, FileAccess.Read)))
                {

                    nGroups = reader.ReadInt32();
                    NIds = reader.ReadInt32();
                    totNGroups = reader.ReadInt32();
                    Ntask = reader.ReadInt32();
                    int totNIds = 0;
                    for (int i = 0; i < GroupLen.Length; i++)
                    {
                        totNIds += GroupLen[i];
                    }

                    if (filenumber == 0)
                    {
                        IDs = new long[totNIds];

                    }
                    if (NIds > 0)
                    {
                        for (int i = skip; i < skip + NIds; i++)
                        {
                            IDs[i] = reader.ReadInt64();
                            IDs[i] &= (( ((long)1) << 34) - 1);
                        }

                        skip += NIds;
                    }
                }
                //DebugOut.PrintLine("Ngroups: " + nGroups + " totNGroups: " + totNGroups + "  NIds: " + NIds + "  Ntask: " + Ntask);
                filenumber++;
                //if (filenumber > lastSnapshotFile)
                // {
                //   done = true;
                // }
                if (filenumber == Ntask)
                {
                    done = true;
                }
            }

            string outfilepath = this.outPath + "//groups_snap" + isnap;

            using (SqlBinaryWriter binwriter = new SqlBinaryWriter(
                new FileStream(outfilepath, FileMode.Create)))
            {
                for (int i = 0; i < totNGroups; i++)
                {

                    if (GroupLen[i] > 0)
                    {
                        long[] curGroupIds = new long[GroupLen[i]];
                        Array.Copy(IDs, GroupOffset[i], curGroupIds, 0, curGroupIds.Length);
                        // Now add the ID to a bloom filter
                        BloomFilter.Filter<long> filter = new Filter<long>(LoaderConstants.expectedSize);
                        for (int j = 0; j < curGroupIds.Length; j++)
                        {
                            filter.Add(curGroupIds[j]);
                        }

                        binwriter.WriteFoFGroup(curGroupIds, (short)isnap, i, filter);
                    }
                }
            }
            summary.end = DateTime.Now;
            summary.duration = summary.end - summary.start;
            summary.numGroups = totNGroups;
            globals.summary.fofSummary = summary;

            GC.Collect();
            GC.WaitForPendingFinalizers();
            DebugOut.PrintLine("Completed writing snapshot: " + isnap);
        }
开发者ID:dcrankshaw,项目名称:pp_final_project,代码行数:101,代码来源:process_fof.cs

示例4: filterCheck

        // Verifies that filters based on unchecked dimensions or metrics are erased.
        private void filterCheck()
        {
            Filter validFilters = new Filter();

            foreach (string key in _query.Dimensions.Keys)
            {
                foreach (FilterItem filterItem in _query.Filter)
                {
                    if (filterItem.Key.Equals(key))
                    {
                        validFilters.Add(filterItem);
                    }
                }
            }

            foreach (string key in _query.Metrics.Keys)
            {
                foreach (FilterItem filterItem in _query.Filter)
                {
                    if (filterItem.Key.Equals(key))
                    {
                        validFilters.Add(filterItem);
                    }
                }
            }

            comboBoxOperator.SelectedIndex = -1;
            _query.Filter = validFilters;
        }
开发者ID:haveal,项目名称:excellent-analytics,代码行数:30,代码来源:QueryBuilder.xaml.cs

示例5: BindFilterListBox

 private void BindFilterListBox()
 {
     Filter f = new Filter();
     Binding filterBinding = new Binding();
     foreach (FilterItem item in _query.Filter)
         f.Add(item);
     if (f.Count == 1)
         f[0].LOperator = LogicalOperator.None;
     filterBinding.Source = f;
     filterBox.SetBinding(ListBox.ItemsSourceProperty, filterBinding);
 }
开发者ID:haveal,项目名称:excellent-analytics,代码行数:11,代码来源:QueryBuilder.xaml.cs

示例6: processCell

 public void processCell(Cell currentCell, List<DataPoint> datapoints)
 {
     long[] cellIds = currentCell.IdToArray();
     foreach (DataPoint current in datapoints)
     {
         Filter<long> cellFilter = new Filter<long>(2, 0.5f, null, current.filterSize, current.hashFunctions);
         for (int i = 0; i < cellIds.Length; i++)
         {
             cellFilter.Add(cellIds[i]);
         }
         current.testFilter(cellFilter);
     }
 }
开发者ID:dcrankshaw,项目名称:GadgetLoader,代码行数:13,代码来源:Driver.cs


注:本文中的Filter.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。