Grapute 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Grapute --version 1.0.0
NuGet\Install-Package Grapute -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Grapute" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Grapute --version 1.0.0
#r "nuget: Grapute, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Grapute as a Cake Addin
#addin nuget:?package=Grapute&version=1.0.0

// Install Grapute as a Cake Tool
#tool nuget:?package=Grapute&version=1.0.0

Grapute

license

The library helps to define a graph of computations or a pipeline by connecting computation Nodes to eachother, where an output of one node becomes an input for the next Node.

Node always returns an array of results. Later these results can be either consumed one by one by another Node or all together by a SinkNode.

You can define your processing Node by inheriting from Node class and implementing process method. Another option is to provide your own process Func to FuncNode.

You can find a sample code that demonstrates how to implement a simple MapReduce algorithm using Grapute.

Example

var produceThreeOutputsNode = new FuncNode<int, int>(x =>
    {
        //
        return new[] { x , x + 1, x + 2 };
    });

var pipeline = produceThreeOutputsNode
    .ForEachOutput(x =>
        {
            // As an output we have a doubled input
            return new []{x, x};
        })
    .ForEachOutput(x =>
        {
            // Increase the input
            return new []{x + 1};
        })
    .CollectAllOutputsToOneArray()
    .ForArray(all =>
        {
            // Split the input array and convert to a String
            var p1 = all
                .Take(all.Length / 2)
                .Aggregate((a ,b) => $"{a}{b}");

            var p2 = all
                .Skip(all.Length / 2)
                .Aggregate((a ,b) => $"{a}{b}");

            return new []{p1, p2};
        });

produceThreeOutputsNode.SetInput(5);
var result = pipeline.Process().Output;

The code above represents the following graph of computations:

graph

Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Grapute:

Package Downloads
Zavolokas.ImageProcessing.Parallel

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0.2 1,144 11/2/2019
1.0.0 1,599 12/16/2017