![]() |
VOOZH | about |
dotnet add package magic.lambda.math --version 17.2.0
NuGet\Install-Package magic.lambda.math -Version 17.2.0
<PackageReference Include="magic.lambda.math" Version="17.2.0" />
<PackageVersion Include="magic.lambda.math" Version="17.2.0" />Directory.Packages.props
<PackageReference Include="magic.lambda.math" />Project file
paket add magic.lambda.math --version 17.2.0
#r "nuget: magic.lambda.math, 17.2.0"
#:package magic.lambda.math@17.2.0
#addin nuget:?package=magic.lambda.math&version=17.2.0Install as a Cake Addin
#tool nuget:?package=magic.lambda.math&version=17.2.0Install as a Cake Tool
This project provides math functions to Magic. More specifically, it provides the following slots.
double valueAll of the above besides the two last slots can be given any number of arguments, including as its value, and will treat the first argument as the "base", and performing the rest of the arguments self assigning the base as it proceeds. For instance, the following code will first divide 100 by 4, then divide that result by 5 again, resulting in 5.
math.divide:int:100
:int:4
:int:5
The value of the above [math.divide] node after evaluating the above Hyperlambda will be 5. All of the above slots will also evaluate the children collection as a lambda, before starting the actual math function, allowing you to recursively raise signals to retrieve values that are supposed to be mathematically handled somehow. This allows you to recursively nest math operations, such as for instance.
.one:int:5
.two:int:2
math.multiply
.:int:3
math.add
get-value:x:@.one
get-value:x:@.two
The above of course will first add 5 and 2, then multiple the result of that with 3, resulting in 21.
The above [math.increment] and [math.decrement] slots, will instead of yielding a result, inline modify the value of the node(s) it is pointing to, assuming its value is an expression. In addition these two slots can take an optional "step" argument, allowing you to declare how much the incrementation/decrementation process should add/reduce the original node's value by. Below is an example that decrements the value found in its expression by 2.
.value:int:5
math.decrement:x:-
.:int:2
After executing the above, the result of [.value] will be 3. The default "step" value if ommitted will be 1. Below is an example.
.value:int:5
math.increment:x:-
Notice - You can use any slot invocation to retrieve the step value for the increment/decrement slots, including for instance an invocation to [get-value], or your custom slots. This is dues to that the first argument supplied to these slots will be assumed to be the "step" value you want.
This slot multiplies two or more values with each other, and can be given as many arguments as you wish, such as the following illustrates.
.arg:int:5
math.multiply
get-value:x:@.arg
.:int:3
It accepts both slot invocations, retrieving some value by invoking a slot, in addition to static values such as illustrated above where we provide the number 3 as one of its values.
This slot divides two or more values with each other, and can be given as many arguments as you wish, such as the following illustrates.
.arg:int:5
math.divide
get-value:x:@.arg
.:int:2
It accepts both slot invocations, retrieving some value by invoking a slot, in addition to static values such as illustrated above where we provide the number 3 as one of its values.
This slot adds two or more values with each other, and can be given as many arguments as you wish, such as the following illustrates.
.arg:int:5
math.add
get-value:x:@.arg
.:int:2
This slot subtracts two or more values with each other, and can be given as many arguments as you wish, such as the following illustrates.
.arg:int:5
math.subtract
get-value:x:@.arg
.:int:2
It accepts both slot invocations, retrieving some value by invoking a slot, in addition to static values such as illustrated above where we provide the number 3 as one of its values.
This slot calculates the modulo of two or more values with each other, and can be given as many arguments as you wish, such as the following illustrates.
.arg:int:5
math.modulo
get-value:x:@.arg
.:int:2
It accepts both slot invocations, retrieving some value by invoking a slot, in addition to static values such as illustrated above where we provide the number 3 as one of its values.
This slot decrements the value of some expression in place, by mutating the value of the node its expression is leading to.
.arg:int:5
math.decrement:x:@.arg
It can optionally be given a [step] argument, such as illustrated below.
.arg:int:5
math.decrement:x:@.arg
.:int:2
This slot increments the value of some expression in place, by mutating the value of the node its expression is leading to.
.arg:int:5
math.increment:x:@.arg
It can optionally be given a [step] argument, such as illustrated below.
.arg:int:5
math.increment:x:@.arg
.:int:2
This slot returns the min value of its input.
math.min
.:int:5
.:int:7
This slot returns the max value of its input.
math.max
.:int:11
.:int:12
This slot returns the dot product of two lists.
.list1
.:double:0.5
.:double:0.7
.:double:0.1
.list2
.:double:0.56
.:double:0.89
.:double:0.33
math.dot
get-nodes:x:@.list1/*
get-nodes:x:@.list2/*
This slot is useful for calculating similarities between two different objects in Machine Learning, where each list is an "embedding" or a vector.
Magic is 100% Open Source and you can find the primary project GitHub page here.
The source code for this repository can be found at github.com/polterguy/magic.lambda.math, and you can provide feedback, provide bug reports, etc at the same place.
The projects is copyright Thomas Hansen 2023 - 2024, and professionally maintained by AINIRO.IO.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on magic.lambda.math:
| Package | Downloads |
|---|---|
|
magic.library
Helper project for Magic to wire up everything easily by simply adding one package, and invoking two simple methods. When using Magic, this is (probably) the only package you should actually add, since this package pulls in everything else you'll need automatically, and wires up everything sanely by default. To use package go to https://polterguy.github.io |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 17.2.0 | 1,873 | 1/22/2024 |
| 17.1.7 | 401 | 1/12/2024 |
| 17.1.6 | 379 | 1/11/2024 |
| 17.1.5 | 389 | 1/5/2024 |
| 17.0.1 | 426 | 1/1/2024 |
| 17.0.0 | 575 | 12/14/2023 |
| 16.11.5 | 503 | 11/12/2023 |
| 16.9.0 | 458 | 10/9/2023 |
| 16.7.0 | 766 | 7/11/2023 |
| 16.4.1 | 650 | 7/2/2023 |
| 16.4.0 | 637 | 6/22/2023 |
| 16.3.1 | 537 | 6/7/2023 |
| 16.3.0 | 547 | 5/28/2023 |
| 16.1.9 | 870 | 4/30/2023 |
| 15.10.11 | 697 | 4/13/2023 |
| 15.9.1 | 832 | 3/27/2023 |
| 15.9.0 | 658 | 3/24/2023 |
| 15.8.2 | 708 | 3/20/2023 |
| 15.7.0 | 607 | 3/6/2023 |
| 15.5.0 | 1,858 | 1/28/2023 |