请高效存储范围值列表 [英] HOw to store efficiently a list of Range value

查看:86
本文介绍了请高效存储范围值列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,


从ListOfmeasure中存储的包含1500个度量的一组样本值中,我需要在此列表中创建一个直方图表示。


要构建该历史图并根据它的计算方式,我需要定义类以及定义我的数据类的值范围。类的数量将由SquareRoot(1500)确定


然后类别范围将通过以下公式计算:MeasureMax-MeasureMin /类数


例如范围:


范围0将从0到1000之间的度量计算。
范围1将来自1001到2000之间的度量


因此,对于每个课程,我将获取落在该范围内的测量数量


存储此范围集合的最佳方法是什么才能获取产生新直方图数据系列的度量数量?


问候

解决方案

为什么你不能选择List< T>自定义对象,列表<度量>


https://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396


http://www.tutorialsteacher.com/csharp/csharp-list


Measure类可以使用自动属性。


https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and -structs / auto-implemented-properties


您可以使用Skip()和Take()等Linq函数访问集合中给定范围内的Measures。


https://code.msdn.microsoft.com/101-LINQ -Samples-3fb9811b


Dear all,

From a set of sample values stored in ListOfmeasure which contains 1500 measure, I need to create out of this list an Histogram representation.

To build that historgram and based on the way it should be calculated , I need to define classes and also the range of values that will define my classes of data . The number of classes will be determine by SquareRoot(1500)

Then the classes range will be calculated by following formula : MeasureMax-MeasureMin / number of classes

For exemple range :

Range 0 will be from measure between 0 - to 1000
Range 1 will be from measure between 1001 to 2000

So for each class I will then fetch number of measurement falling in that range

What is the best way to store this range collection in order to be able to fetch number of measure falling within that range to produce the new histogram data series?

regards

解决方案

Why can't you se a List<T> of custom objects, a List<Measure >

https://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

http://www.tutorialsteacher.com/csharp/csharp-list

The Measure class can be using auto properties.

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties

You can use Linq functions like Skip() and Take() to access the Measures in a given range in the collection.

https://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b


这篇关于请高效存储范围值列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆