Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System;
using CeresSharp.Native;
namespace CeresSharp.Native.SafeHandles;
/// <summary>
/// Safe handle for Ceres GradientChecker.
/// </summary>
internal sealed class GradientCheckerHandle : BaseSafeHandle
{
private GradientCheckerHandle() : base()
{
}
private GradientCheckerHandle(IntPtr handle, bool ownsHandle) : base(handle, ownsHandle)
{
}
public static GradientCheckerHandle Create(IntPtr handle)
{
if (handle == IntPtr.Zero)
{
throw new Exceptions.CeresException(Exceptions.CeresErrorCode.NullPointer, "Gradient checker handle is null");
}
return new GradientCheckerHandle(handle, true);
}
protected override void ReleaseNativeHandle(IntPtr handle)
{
CeresNative.ceres_wrapper_free_gradient_checker(handle);
}
}