SpecialFunctions 1.0.2
dotnet add package SpecialFunctions --version 1.0.2
NuGet\Install-Package SpecialFunctions -Version 1.0.2
<PackageReference Include="SpecialFunctions" Version="1.0.2" />
<PackageVersion Include="SpecialFunctions" Version="1.0.2" />
<PackageReference Include="SpecialFunctions" />
paket add SpecialFunctions --version 1.0.2
#r "nuget: SpecialFunctions, 1.0.2"
#:package SpecialFunctions@1.0.2
#addin nuget:?package=SpecialFunctions&version=1.0.2
#tool nuget:?package=SpecialFunctions&version=1.0.2
SpecialFunctions
A minimal C# library providing numerical implementations of common special functions, such as:
Airy Functions
airy(z: Complex)airy(z: double)airy(k: int, z: Complex)airy(k: int, z: double)
Bessel Functions (First, Second, Modified, Hankel)
besselj(n: double, z: Complex)besselj(n: double, z: double)bessely(n: double, z: Complex)bessely(n: double, z: double)besseli(n: double, z: Complex)besseli(n: double, z: double)besselk(n: double, z: Complex)besselk(n: double, z: double)besselh(n: double, z: Complex)besselh(n: double, k: int, z: Complex)
Spherical Bessel Functions
sbesselj(n: double, z: Complex)sbesselj(n: double, z: double)sbessely(n: double, z: Complex)sbessely(n: double, z: double)sbesselh(n: double, z: Complex)sbesselh(n: double, k: int, z: Complex)
Beta and Log-Beta
beta(z: double, w: double)betaln(z: double, w: double)
Error Functions
erf(x: double)erfc(x: double)erfinv(z: double)erfcinv(z: double)
Legendre Functions
legendre0(n: int, x: double)legendre(n: int, x: double)
Gamma Functions
gammaln(x: double)gamma(x: double)
The package utilizes core numerical routines from Math.NET Numerics, with updated APIs for functions such as Bessel and error functions. It also includes Legendre polynomial implementations adapted from AminKH's Legendre Polynomials repository. The API is designed to closely mirror MATLAB’s structure and naming conventions, enabling a smooth transition for users familiar with MATLAB syntax. This compatibility facilitates rapid prototyping, intuitive function calls, and straightforward adaptation of existing MATLAB-based codebases to C#.
Installation
To install the package, use the .NET CLI:
dotnet add package SpecialFunctions
Supported Frameworks
The library supports the following frameworks:
- .NET Framework 4.7.2 (
net472) - .NET Framework 4.8.1 (
net481) - .NET 8.0 (
net8.0) - .NET 9.0 (
net9.0)
Usage
using static SpecialFunctions.SF;
using System.Numerics;
double result = erf(1.0);
Complex bessel = besselj(1.5, new Complex(1.0, 0.5));
For detailed functionalities, please visit the manual page.
Build and Test
Prerequisites
To build and test this library from source, you will need the following:
- .NET SDK: Version 8.0 or higher.
- .NET Framework: Version 4.7.2 or higher. This is required for legacy hardware driver compatibility.
Building the Library
Clone the repository:
git clone https://github.com/jake-w-liu/SpecialFunctions.git cd SpecialFunctionsBuild the project:
dotnet build
Running the Tests
To run the tests, use the following command:
dotnet test
Contributing
We welcome contributions from the community. Here are some ways you can contribute to the project.
Reporting Issues
If you find a bug or have a problem with the software, please open an issue on our GitHub repository.
When reporting an issue, please include the following information:
- A clear and descriptive title.
- A detailed description of the issue, including steps to reproduce it.
- The version of the software you are using.
- Any relevant error messages or logs.
Contributing Code
If you would like to contribute code to the project, please follow these.
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with a clear and descriptive commit message.
- Push your changes to your fork.
- Open a pull request to the main repository.
Please ensure that your code adheres to the existing coding style and that all tests pass.
Seeking Support
If you have a question or need help with the software, you can:
- Open an issue on our GitHub repository.
- Contact the maintainers directly.
We will do our best to respond to your request in a timely manner.
Notes
- Most functions are overloaded for both real (
double) and complex (System.Numerics.Complex) inputs. - Many implementations delegate to the
Amoslibrary for accurate numerical evaluation. - Ensure input values are valid to avoid
NaNresults.
License
MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net472 is compatible. net48 was computed. net481 is compatible. |
-
.NETFramework 4.7.2
- Microsoft.NET.Test.Sdk (>= 17.14.1)
- MSTest.TestAdapter (>= 3.9.1)
- MSTest.TestFramework (>= 3.9.1)
-
.NETFramework 4.8.1
- Microsoft.NET.Test.Sdk (>= 17.14.1)
- MSTest.TestAdapter (>= 3.9.1)
- MSTest.TestFramework (>= 3.9.1)
-
net8.0
- Microsoft.NET.Test.Sdk (>= 17.14.1)
- MSTest.TestAdapter (>= 3.9.1)
- MSTest.TestFramework (>= 3.9.1)
-
net9.0
- Microsoft.NET.Test.Sdk (>= 17.14.1)
- MSTest.TestAdapter (>= 3.9.1)
- MSTest.TestFramework (>= 3.9.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.