C.Csm.Math
0.0.2
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.7.2
This package targets .NET Framework 4.7.2. The package is compatible with this framework or higher.
dotnet add package C.Csm.Math --version 0.0.2
NuGet\Install-Package C.Csm.Math -Version 0.0.2
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="C.Csm.Math" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="C.Csm.Math" Version="0.0.2" />
<PackageReference Include="C.Csm.Math" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add C.Csm.Math --version 0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: C.Csm.Math, 0.0.2"
#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.
#:package C.Csm.Math@0.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=C.Csm.Math&version=0.0.2
#tool nuget:?package=C.Csm.Math&version=0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
一些常见的数学库
- 分段矫正
- 二次插值
PiecewiseLinearCalibrator 分段校准使用说明
功能概述
分段线性校准器,用于将原始值(rawValue)通过分段线性插值转换为校准值(calibratedValue)。
基本用法
// 创建校准器实例
var calibrator = new PiecewiseLinearCalibrator(deviationThreshold: 0.1);
// 添加校准点
calibrator.AddOrUpdateCalibrationPoint(rawValue: 1.0, calibratedValue: 10.0);
calibrator.AddOrUpdateCalibrationPoint(rawValue: 2.0, calibratedValue: 20.0);
// 进行校准
double result = calibrator.Calibrate(1.5); // 返回15.0
数据流图
flowchart TB
A[CSV文件输入] --> B[加载校准点集合]
B --> C{校准点数量}
C -->|0个| D[返回空值]
C -->|1个| E[返回单点校准值]
C -->|≥2个| F[排序校准点]
F --> G[查找插值区间]
G --> H[线性插值计算]
H --> I[计算绝对误差]
I --> J{误差是否超限}
J -->|是| K[记录异常点]
J -->|否| L[输出校准值]
L --> M[保存校准结果到CSV]
K --> M
时序图
sequenceDiagram
participant User as 用户
participant Calibrator as 校准器
participant CSV as CSV文件
participant Points as 校准点集合
User->>Calibrator: 创建实例(new)
User->>CSV: 选择文件路径
User->>Calibrator: LoadFromCsv(path)
Calibrator->>CSV: 读取数据
CSV-->>Calibrator: 返回行数据
loop 逐行处理
Calibrator->>Calibrator: ParseLine()
Calibrator->>Points: AddOrUpdate()
end
User->>Calibrator: Calibrate(input)
Calibrator->>Points: BinarySearch()
Points-->>Calibrator: 相邻点
alt 需要插值
Calibrator->>Calibrator: CalculateSlope()
Calibrator->>Calibrator: LinearInterpolation()
else 直接取值
Calibrator-->>User: 返回校准值
end
Calibrator->>User: 返回结果
User->>Calibrator: SaveToCsv(outputPath)
Calibrator->>Points: 遍历所有点
Points-->>Calibrator: 序列化数据
Calibrator->>CSV: 写入文件
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 was computed. 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 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.