是否有与C#中的F#序列等效的窗口? [英] Is there an equivalent to the F# Seq.windowed in C#?

查看:120
本文介绍了是否有与C#中的F#序列等效的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一些C#代码,以解决诸如移动平均值之类的问题,在这些代码中,我经常需要使用List/IEnumerable并处理大块连续数据. F#Seq模块具有强大的窗口函数,该函数接受一个Sequence并返回一系列连续元素的序列.

I am working on some C# code dealing with problems like moving averages, where I often need to take a List / IEnumerable and work on chunks of consecutive data. The F# Seq module has a great function, windowed, which taking in a Sequence, returns a sequence of chunks of consecutive elements.

C#是否具有与LINQ开箱即用的等效功能?

Does C# have an equivalent function out-of-the-box with LINQ?

推荐答案

您总是可以从C#调用SeqModule.Windowed,只需要引用FSharp.Core.Dll.函数名称也略有修饰,因此您调用Windowed而不是windowed,以使其符合C#大写约定

You can always just call SeqModule.Windowed from C#, you just need to reference FSharp.Core.Dll. The function names are also slightly mangled, so you call Windowed rather than windowed, so that it fits with the C# capitalisation conventions

这篇关于是否有与C#中的F#序列等效的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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