namespace arrange; final wrap scheduale solution

This commit is contained in:
Youmu Liu
2025-10-13 20:59:14 +08:00
parent 31f649015c
commit a95e9b1ff7
44 changed files with 683 additions and 926 deletions
+38 -35
View File
@@ -1,33 +1,33 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Global.cs"
// Project: StepVisualizer
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="Global.cs"
// Project: StepVisualizer
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
@@ -38,64 +38,67 @@ global using StgSharp.Internal.Intrinsic;
global using StgSharp.Internal.OpenGL;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("StgSharp.Mathematics")]
[assembly: SuppressMessage(
"Design",
"CA1008:枚举应具有零值",
Justification = "<挂起>",
Scope = "type",
Target = "~T:StgSharp.Graphics.OpenGL.ShaderStatus" )]
Target = "~T:StgSharp.Graphics.OpenGL.ShaderStatus")]
[assembly: SuppressMessage(
"Naming",
"CA1715:标识符应具有正确的前缀",
Justification = "<挂起>",
Scope = "member",
Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``2(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1}" )]
Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``2(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1}")]
[assembly: SuppressMessage(
"Naming",
"CA1715:标识符应具有正确的前缀",
Justification = "<挂起>",
Scope = "member",
Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``3(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1,``2}" )]
Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``3(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1,``2}")]
[assembly: SuppressMessage(
"Naming",
"CA1715:标识符应具有正确的前缀",
Justification = "<挂起>",
Scope = "member",
Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``4(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1,``2,``3}" )]
Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``4(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1,``2,``3}")]
[assembly: SuppressMessage(
"Naming",
"CA1715:标识符应具有正确的前缀",
Justification = "<挂起>",
Scope = "type",
Target = "~T:StgSharp.Graphics.OpenGL.Uniform`4" )]
Target = "~T:StgSharp.Graphics.OpenGL.Uniform`4")]
[assembly: SuppressMessage(
"Design",
"CA1043:将整型或字符串参数用于索引器",
Justification = "<挂起>",
Scope = "member",
Target = "~P:StgSharp.MVVM.ViewBase.IViewResponder`1.Item(StgSharp.Controlling.UsrActivity.ITrigger)" )]
Target = "~P:StgSharp.MVVM.ViewBase.IViewResponder`1.Item(StgSharp.Controlling.UsrActivity.ITrigger)")]
[assembly: SuppressMessage(
"Design",
"CA1043:将整型或字符串参数用于索引器",
Justification = "<挂起>",
Scope = "member",
Target = "~P:StgSharp.MVVM.ViewBase.ViewResponder`1.Item(StgSharp.Controlling.UsrActivity.ITrigger)" )]
Target = "~P:StgSharp.MVVM.ViewBase.ViewResponder`1.Item(StgSharp.Controlling.UsrActivity.ITrigger)")]
[assembly: SuppressMessage(
"Performance",
"CA1864:首选 \"IDictionary.TryAdd(TKey, TValue)\" 方法",
Justification = "<挂起>",
Scope = "member",
Target = "~P:StgSharp.MVVM.ViewBase.ViewRender`1.Item(System.String)" )]
Target = "~P:StgSharp.MVVM.ViewBase.ViewRender`1.Item(System.String)")]
[assembly: SuppressMessage(
"Design",
"CA1033:接口方法应可由子类型调用",
Justification = "<挂起>",
Scope = "member",
Target = "~P:StgSharp.Collections.IBidirectionalDictionary`2.System#Collections#Generic#IDictionary<TFirst,TSecond>#Keys" )]
Target = "~P:StgSharp.Collections.IBidirectionalDictionary`2.System#Collections#Generic#IDictionary<TFirst,TSecond>#Keys")]
[assembly: SuppressMessage(
"Design",
"CA1033:接口方法应可由子类型调用",
Justification = "<挂起>",
Scope = "member",
Target = "~P:StgSharp.Collections.IBidirectionalDictionary`2.System#Collections#Generic#IDictionary<TFirst,TSecond>#Values" )]
Target = "~P:StgSharp.Collections.IBidirectionalDictionary`2.System#Collections#Generic#IDictionary<TFirst,TSecond>#Values")]
@@ -28,17 +28,9 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Mathematics;
using System;
using System.Collections.Generic;
using StgSharp.Mathematics.Graphic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp.Graphics.OpenGL
{
@@ -1,33 +1,33 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="IRegisterType.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="IRegisterType.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
@@ -40,9 +40,9 @@ namespace StgSharp.HighPerformance
public interface IRegisterType
{
public ref T AsRef<T>() where T: unmanaged, INumber<T>;
ref T AsRef<T>() where T: unmanaged, INumber<T>;
public ref T Member<T>(int index) where T: unmanaged, INumber<T>;
ref T Member<T>(int index) where T: unmanaged, INumber<T>;
}
}
+2 -1
View File
@@ -43,7 +43,7 @@ namespace StgSharp.HighPerformance
public string Name
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get;
init;
}
@@ -61,6 +61,7 @@ namespace StgSharp.HighPerformance
public static class DataLabelBuilder
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static DataLabel AsLabel(this string name)
{
return new DataLabel(name);
@@ -28,16 +28,9 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.HighPerformance
{
@@ -52,7 +52,7 @@ namespace StgSharp.HighPerformance.Memory
public int Count
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => (int)_count;
}
@@ -151,7 +151,7 @@ namespace StgSharp.HighPerformance.Memory
{
Header* header = (Header*)_buffer;
nuint newCap = header->Capacity * 2;
nuint newSize = (nuint)sizeof(Header) + newCap * (nuint)sizeof(T);
nuint newSize = (nuint)sizeof(Header) + (newCap * (nuint)sizeof(T));
_buffer = (byte*)NativeMemory.Realloc(_buffer, newSize);
header = (Header*)_buffer;
header->Capacity = newCap;
@@ -1,60 +1,56 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="UnsafeCompute.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="UnsafeCompute.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.HighPerformance
{
public static class UnsafeCompute
{
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe int CityHashSimplify( char* span, int length )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int CityHashSimplify(char* span, int length)
{
return InternalIO.Intrinsic.city_hash_simplify( span, length );
return InternalIO.Intrinsic.city_hash_simplify(span, length);
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe int CityHashSimplify( char* span, int begin, int length )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int CityHashSimplify(char* span, int begin, int length)
{
return InternalIO.Intrinsic.city_hash_simplify( span + begin, length );
return InternalIO.Intrinsic.city_hash_simplify(span + begin, length);
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe int IndexOfCharPair( char* source, int pairValue, int length )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int IndexOfCharPair(char* source, int pairValue, int length)
{
return InternalIO.Intrinsic.index_pair( source, pairValue, length );
return InternalIO.Intrinsic.index_pair(source, pairValue, length);
}
}
@@ -1,33 +1,33 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="ColumnSet4.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="ColumnSet4.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp;
using StgSharp.Internal.Intrinsic;
@@ -38,66 +38,66 @@ using System.Runtime.InteropServices;
namespace StgSharp.Internal.Intrinsic
{
[StructLayout( LayoutKind.Explicit, Size = 16 * sizeof( float ) )]
[StructLayout(LayoutKind.Explicit, Size = 16 * sizeof(float))]
internal struct ColumnSet4 : IEquatable<ColumnSet4>
{
[FieldOffset( 0 )] internal Vector4 colum0;
[FieldOffset( 16 )] internal Vector4 colum1;
[FieldOffset( 32 )] internal Vector4 colum2;
[FieldOffset( 48 )] internal Vector4 colum3;
[FieldOffset(0)] internal Vector4 colum0;
[FieldOffset(16)] internal Vector4 colum1;
[FieldOffset(32)] internal Vector4 colum2;
[FieldOffset(48)] internal Vector4 colum3;
[FieldOffset( 0 )] public float m00;
[FieldOffset( 16 )] public float m01;
[FieldOffset( 32 )] public float m02;
[FieldOffset( 48 )] public float m03;
[FieldOffset( 4 )] public float m10;
[FieldOffset( 20 )] public float m11;
[FieldOffset( 36 )] public float m12;
[FieldOffset( 52 )] public float m13;
[FieldOffset( 8 )] public float m20;
[FieldOffset( 24 )] public float m21;
[FieldOffset( 40 )] public float m22;
[FieldOffset( 56 )] public float m23;
[FieldOffset( 12 )] public float m30;
[FieldOffset( 28 )] public float m31;
[FieldOffset( 44 )] public float m32;
[FieldOffset( 60 )] public float m33;
[FieldOffset(0)] public float m00;
[FieldOffset(16)] public float m01;
[FieldOffset(32)] public float m02;
[FieldOffset(48)] public float m03;
[FieldOffset(4)] public float m10;
[FieldOffset(20)] public float m11;
[FieldOffset(36)] public float m12;
[FieldOffset(52)] public float m13;
[FieldOffset(8)] public float m20;
[FieldOffset(24)] public float m21;
[FieldOffset(40)] public float m22;
[FieldOffset(56)] public float m23;
[FieldOffset(12)] public float m30;
[FieldOffset(28)] public float m31;
[FieldOffset(44)] public float m32;
[FieldOffset(60)] public float m33;
[MethodImpl( MethodImplOptions.AggressiveInlining )]
internal ColumnSet4( Vector4 colum0, Vector4 colum1, Vector4 colum2, Vector4 colum3 )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal ColumnSet4(Vector4 colum0, Vector4 colum1, Vector4 colum2, Vector4 colum3)
{
Unsafe.SkipInit( out this );
Unsafe.SkipInit(out this);
this.colum0 = colum0;
this.colum1 = colum1;
this.colum2 = colum2;
this.colum3 = colum3;
}
public override bool Equals( object? obj )
public override bool Equals(object? obj)
{
return ( obj is ColumnSet4 mat ) && Equals( mat );
return (obj is ColumnSet4 mat) && Equals(mat);
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public bool Equals( ColumnSet4 other )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(ColumnSet4 other)
{
return colum0.Equals( other.colum0 ) &&
colum1.Equals( other.colum1 ) &&
colum2.Equals( other.colum2 ) &&
colum3.Equals( other.colum3 );
return colum0.Equals(other.colum0) &&
colum1.Equals(other.colum1) &&
colum2.Equals(other.colum2) &&
colum3.Equals(other.colum3);
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static bool operator !=( ColumnSet4 left, ColumnSet4 right )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(ColumnSet4 left, ColumnSet4 right)
{
return !( left == right );
return !(left == right);
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static bool operator ==( ColumnSet4 left, ColumnSet4 right )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(ColumnSet4 left, ColumnSet4 right)
{
return left.Equals( right );
return left.Equals(right);
}
}
+12 -20
View File
@@ -28,20 +28,12 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Graphics.OpenGL;
using StgSharp.Graphics.ShaderEdit;
using StgSharp.HighPerformance;
using StgSharp.Mathematics;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp.Graphics
namespace StgSharp.Mathematics.Graphic
{
public sealed class Camera : IglConvertable
{
@@ -150,7 +142,7 @@ namespace StgSharp.Graphics
public unsafe void SetAllUniforms()
{
// Console.WriteLine(Projection * ViewBase);
OpenGL.OpenGLFunction.CurrentGL.SetUniformValue(convertedUniform, Projection * View);
OpenGLFunction.CurrentGL.SetUniformValue(convertedUniform, Projection * View);
}
public void SetViewDirection(Vec3 position, Vec3 target, Vec3 up)
@@ -172,7 +164,7 @@ namespace StgSharp.Graphics
_isLookAtAvailable = false;
Linear.Orthogonalize(ref direction, ref up);
direction.Orthogonalize(ref up);
Vec3 right = Linear.Orthogonalize(Linear.Cross(up, direction));
@@ -186,24 +178,24 @@ namespace StgSharp.Graphics
InternalYaw();
}
public void SetViewRange(Radius fovRadius, Vec2 size, Vec2 offset, (float front, float back) dephRange)
public void SetViewRange(Radius fovRadius, Vec2 size, Vec2 offset, (float front, float back) depthRange)
{
float
distance = _target.GetLength(),
near = distance - dephRange.front,
far = distance + dephRange.back,
near = distance - depthRange.front,
far = distance + depthRange.back,
offsetX = offset.X,
offsetY = offset.Y,
width = Scaler.Abs(GeometryScaler.Tan(fovRadius / 2) * near * 2),
height = (width * size.Y) / size.X;
height = width * size.Y / size.X;
_projection.colum0.X = (2 * near) / width;
_projection.colum1.Y = (2 * near) / height;
_projection.colum2.X = (2 * offsetX) / width;
_projection.colum2.Y = (2 * offsetY) / height;
_projection.colum0.X = 2 * near / width;
_projection.colum1.Y = 2 * near / height;
_projection.colum2.X = 2 * offsetX / width;
_projection.colum2.Y = 2 * offsetY / height;
_projection.colum2.Z = (far + near) / (near - far);
_projection.colum2.W = -1;
_projection.colum3.Z = (2 * near * far) / (near - far);
_projection.colum3.Z = 2 * near * far / (near - far);
}
public void Test(params Vec4[] vec)
@@ -29,7 +29,7 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Internal.Intrinsic;
using StgSharp.Mathematics.Numeric;
using System;
using System.ComponentModel;
using System.Drawing;
@@ -37,9 +37,9 @@ using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Graphic
{
[StructLayout(LayoutKind.Explicit, Size = (2 * 16 * sizeof(float)) + sizeof(bool), Pack = 16)]
[StructLayout(LayoutKind.Explicit, Size = 2 * 16 * sizeof(float) + sizeof(bool), Pack = 16)]
public unsafe struct Matrix44 : IEquatable<Matrix44>, IMatrix<Matrix44>
{
@@ -115,9 +115,9 @@ namespace StgSharp.Mathematics
}
#endif
InternalTranspose();
fixed (float* p = &this.transpose.m00)
fixed (float* p = &transpose.m00)
{
ulong pBit = ((ulong)p) + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + (((ulong)sizeof(float)) * ((ulong)columNum));
ulong pBit = (ulong)p + (ulong)sizeof(Vector4) * (ulong)rowNum + sizeof(float) * (ulong)columNum;
return *(float*)pBit;
}
}
@@ -133,9 +133,9 @@ namespace StgSharp.Mathematics
}
#endif
InternalTranspose();
fixed (float* p = &this.transpose.m00)
fixed (float* p = &transpose.m00)
{
ulong pbit = ((ulong)p) + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + (((ulong)sizeof(float)) * ((ulong)columNum));
ulong pbit = (ulong)p + (ulong)sizeof(Vector4) * (ulong)rowNum + sizeof(float) * (ulong)columNum;
*(float*)pbit = value;
}
isTransposed = false;
@@ -147,7 +147,7 @@ namespace StgSharp.Mathematics
get
{
InternalTranspose();
return new Matrix44(this.transpose);
return new Matrix44(transpose);
}
}
@@ -169,7 +169,7 @@ namespace StgSharp.Mathematics
public override bool Equals(object? obj)
{
return (obj is Matrix44 x) && Equals(x);
return obj is Matrix44 x && Equals(x);
}
public bool Equals(Matrix44 other)
@@ -197,6 +197,8 @@ namespace StgSharp.Mathematics
{
fixed (ColumnSet4* source = &mat, target = &transpose)
{
InternalIO.Intrinsic.f32_transpose(source, target);
// InternalIO.Intrinsic.transpose44(source, target);
}
isTransposed = true;
@@ -29,20 +29,20 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using StgSharp.Mathematics.Numeric;
using System.Net.Http.Headers;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Graphic
{
/// <summary>
/// A two dimension vector defined by two elements. Vec2 in World are default used as colum
/// vector.
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
public struct Vec2 : IFixedVector<Vec2>
public struct Vec2 : IUnmanagedVector<Vec2>
{
[FieldOffset(0)] internal unsafe fixed float num[2];
@@ -108,7 +108,7 @@ namespace StgSharp.Mathematics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float Cross(Vec2 right)
{
return (X * right.Y) - (Y * right.X);
return X * right.Y - Y * right.X;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -29,6 +29,7 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using StgSharp.Mathematics.Numeric;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -36,11 +37,11 @@ using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Graphic
{
[CollectionBuilder(typeof(Vec3), nameof(Vec3.FromSpan))]
[CollectionBuilder(typeof(Vec3), nameof(FromSpan))]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
public struct Vec3 : IEquatable<Vec3>, IFixedVector<Vec3>, IEnumerable<float>
public struct Vec3 : IEquatable<Vec3>, IUnmanagedVector<Vec3>, IEnumerable<float>
{
[FieldOffset(0)] internal unsafe fixed float num[3];
@@ -93,7 +94,7 @@ namespace StgSharp.Mathematics
public unsafe Vec2 XY
{
get => new Vec2(this.reg);
get => new Vec2(reg);
set
{
fixed (Vector3* vptr = &v) {
@@ -132,7 +133,7 @@ namespace StgSharp.Mathematics
public bool Equals(Vec3 other)
{
return this.reg == other.reg;
return reg == other.reg;
}
public override bool Equals(object obj)
@@ -171,8 +172,8 @@ namespace StgSharp.Mathematics
public float GetMaxValue()
{
float ret = X;
ret = (ret > Y) ? ret : Y;
ret = (ret > Z) ? ret : Z;
ret = ret > Y ? ret : Y;
ret = ret > Z ? ret : Z;
return ret;
}
@@ -30,18 +30,17 @@
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using StgSharp.Internal.Intrinsic;
using StgSharp.Mathematics;
using StgSharp.Mathematics.Numeric;
using System;
using System.Data.Common;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Graphic
{
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
public struct Vec4 : IEquatable<Vec4>, IFixedVector<Vec4>
public struct Vec4 : IEquatable<Vec4>, IUnmanagedVector<Vec4>
{
[FieldOffset(0)] internal unsafe fixed float num[4];
@@ -131,7 +130,7 @@ namespace StgSharp.Mathematics
public override bool Equals(object obj)
{
return (obj is Vec4 v) ? (v == this) : false;
return obj is Vec4 v ? v == this : false;
}
public override int GetHashCode()
@@ -0,0 +1,52 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Vector.Cross.cs"
// Project: World
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Mathematics.Graphic;
namespace StgSharp.Mathematics.Graphic
{
public static unsafe partial class Linear
{
public static float Cross(Vec2 vec1, Vec2 vec2)
{
return (vec1.X * vec2.Y) - (vec1.Y * vec2.X);
}
public static Vec3 Cross(Vec3 vec1, Vec3 vec2)
{
return new Vec3(
(vec1.Y * vec2.Z) - (vec1.Z * vec2.Y),
(vec1.X * vec2.Z) - (vec1.Z * vec2.X),
(vec1.X * vec2.Y) - (vec1.Y * vec2.X));
}
}
}
@@ -1,6 +1,6 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Vec4HP.cs"
// file="Vector.GetAngle.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
@@ -28,43 +28,23 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using StgSharp.Mathematics.Graphic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics.HighPrecision
namespace StgSharp.Mathematics.Graphic
{
[StructLayout(LayoutKind.Explicit, Pack =16)]
public struct Vec4HP : IFixedVector<Vec4HP>
public static unsafe partial class Linear
{
[FieldOffset(0)] private M256 buffer;
[FieldOffset(0)] private Vector256<float> clrBuffer;
[FieldOffset(3 * sizeof(double))] public double W;
[FieldOffset(0 * sizeof(double))] public double X;
[FieldOffset(1 * sizeof(double))] public double Y;
[FieldOffset(2 * sizeof(double))] public double Z;
public Vec4HP(double x, double y, double z, double w)
public static float GetAngle(Vec2 vec1, Vec2 vec2)
{
this.X = x;
this.Y = y;
this.Z = z;
this.W = w;
Unsafe.SkipInit(out buffer);
Unsafe.SkipInit(out clrBuffer);
return Scaler.ACos(
1 / (vec1.GetLength() * vec2.GetLength()));
}
public static Vec4HP Zero => new Vec4HP(0, 0, 0, 0);
public static Vec4HP One => new Vec4HP(1, 1, 1, 1);
public static float GetAngle(Vec3 vec1, Vec3 vec2)
{
return Scaler.ACos((vec1 * vec2) / (vec1.GetLength() * vec2.GetLength()));
}
}
}
@@ -0,0 +1,49 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Vector.GetLength.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Mathematics.Graphic;
namespace StgSharp.Mathematics.Graphic
{
public static unsafe partial class Linear
{
public static float GetLength(this Vec3 vec)
{
return Scaler.Sqrt(vec.Dot(vec));
}
public static float GetLength(this Vec2 vec)
{
return Scaler.Sqrt(vec.Dot(vec));
}
}
}
@@ -1,6 +1,6 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Vec3HP.cs"
// file="Vector.Normalize.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
@@ -28,58 +28,57 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using StgSharp.Mathematics.Graphic;
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics.HighPrecision
namespace StgSharp.Mathematics.Graphic
{
[StructLayout(LayoutKind.Explicit, Pack = 16)]
public struct Vec3HP : IFixedVector<Vec3HP>
public static partial class Linear
{
[FieldOffset(0)] internal M256 buffer;
[FieldOffset(0)] internal Vector256<float> clrBuffer;
[FieldOffset(0 * sizeof(double))] public double X;
[FieldOffset(1 * sizeof(double))] public double Y;
[FieldOffset(2 * sizeof(double))] public double Z;
public Vec3HP() : this(0, 0, 0) { }
public Vec3HP(Vector256<float> clrBuffer)
public static Vec4 Normalize(Vec4 vec)
{
this.X = 0;
this.Y = 0;
this.Z = 0;
Unsafe.SkipInit(out buffer);
Unsafe.SkipInit(out this.clrBuffer);
this.clrBuffer = clrBuffer;
return new Vec4
{
vec = Vector4.Normalize(vec.vec)
};
}
public Vec3HP(double x, double y, double z)
public static Vec3 Normalize(Vec3 vec)
{
this.X = x;
this.Y = y;
this.Z = z;
Unsafe.SkipInit(out buffer);
Unsafe.SkipInit(out clrBuffer);
return new Vec3
{
v = Vector3.Normalize(vec.v)
};
}
public static Vec3HP Zero => new Vec3HP(1, 1, 1);
public static Vec3HP One => throw new NotImplementedException();
public override string ToString()
public static unsafe void Normalize(ref Vec4 source, ref Vec4 target)
{
return $"Double precision 3D Vector<{X},{Y},{Z}>";
Vector4 s = source.vec;
Vector4 t = target.vec;
s = Vector4.Normalize(s);
Vector4 projection = Vector4.Multiply(s, t);
t -= projection;
source.vec = s;
target.vec = t;
}
public static unsafe void Normalize(ref Vec3 source, ref Vec3 target)
{
Vector3 s = source.v;
Vector3 t = target.v;
s = Vector3.Normalize(s);
Vector3 projection = Vector3.Dot(t, s) / Vector3.Dot(s, s) * s;
t -= projection;
t = Vector3.Normalize(t);
source.v = s;
target.v = t;
}
}
@@ -0,0 +1,95 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Vector.Orthogonalize.cs"
// Project: World
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Mathematics.Graphic;
using System.Numerics;
namespace StgSharp.Mathematics.Graphic
{
public static partial class Linear
{
public static Vec4 Orthogonalize(this Vec4 vec)
{
return new Vec4
{
vec = Vector4.Normalize(vec.vec)
};
}
public static Vec3 Orthogonalize(Vec3 vec)
{
return new Vec3
{
v = Vector3.Normalize(vec.v)
};
}
public static unsafe void Orthogonalize(this Vec4 source, ref Vec4 target)
{
Vector4 s = source.vec;
Vector4 t = target.vec;
s = Vector4.Normalize(s);
Vector4 projection = Vector4.Multiply(s, t);
t -= projection;
source.vec = s;
target.vec = t;
}
/// <summary>
/// Orthogonalize two <see cref="Vec3" />s, let their length be 1 and perpendicular to
/// each other.
/// </summary>
/// <param _label="source">
///
/// </param>
/// <param _label="target">
///
/// </param>
public static unsafe void Orthogonalize(this Vec3 source, ref Vec3 target)
{
Vector3 s = source.v;
Vector3 t = target.v;
s = Vector3.Normalize(s);
Vector3 projection = Vector3.Dot(t, s) / Vector3.Dot(s, s) * s;
t -= projection;
t = Vector3.Normalize(t);
source.v = s;
target.v = t;
}
}
}
@@ -28,7 +28,7 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public enum CoordinatePlain
{
+26 -26
View File
@@ -1,40 +1,40 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="IMatrix.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="IMatrix.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Graphics;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public interface IMatrix<TSelf> where TSelf: IMatrix<TSelf> { }
}
@@ -36,9 +36,9 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public interface IFixedVector<TSelf> where TSelf: unmanaged, IFixedVector<TSelf>
public interface IUnmanagedVector<TSelf> where TSelf: unmanaged, IUnmanagedVector<TSelf>
{
public static abstract TSelf Zero { get; }
@@ -1,86 +0,0 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Matrix.Basic.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
{
public static class Matrix
{
public static Matrix<float> Add(Matrix<float> left, Matrix<float> right)
{
if (left.ColumnLength != right.ColumnLength || left.RowLength != right.RowLength) {
throw new IndexOutOfRangeException("Matrix dimensions must agree.");
}
MatrixParallel.LeadParallel();
try
{
Matrix<float> result = GCMatrix<float>.FromDefault(left.ColumnLength, left.RowLength);
unsafe
{
MatrixParallelTaskPackage<float>* handle = MatrixParallelFactory.CreateBaseTask<float>();
handle->Left = left.Buffer;
handle->Right = right.Buffer;
handle->Result = result.Buffer;
handle->ComputeHandle = (IntPtr)InternalIO.Intrinsic.f32_add;
handle->LeftPrimOffset = 0;
handle->RightPrimOffset = 0;
handle->LeftPrimStride = left.KernelColumnLength;
handle->LeftSecOffset = 1;
handle->LeftPrimOffset = 0;
handle->RightPrimOffset = 0;
handle->RightPrimStride = right.KernelColumnLength;
handle->RightSecOffset = 1;
handle->RightPrimOffset = 0;
handle->ResultPrimOffset = 0;
handle->ResultPrimStride = result.KernelColumnLength;
handle->ResultSecOffset = 1;
handle->ResultPrimOffset = 0;
handle->PrimCount = left.KernelRowLength;
handle->SecCount = left.KernelColumnLength;
}
MatrixParallel.LaunchParallel(SleepMode.DeepSleep);
return result;
}
finally
{
MatrixParallel.EndParallel();
}
}
}
}
@@ -39,7 +39,7 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
internal unsafe partial class GCMatrix<T> : Matrix<T> where T: unmanaged, INumber<T>
{
@@ -40,7 +40,7 @@ using System.Threading.Tasks;
using hlsfAllocator = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator;
using hlsfHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
internal unsafe partial class HlsfMatrix<T> : Matrix<T> where T: unmanaged, INumber<T>
{
+2 -2
View File
@@ -38,7 +38,7 @@ using hlsfAllocator = global::StgSharp.HighPerformance.Memory.HybridLayerSegrega
// using hlsfHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public abstract unsafe partial class Matrix<T> where T: unmanaged, INumber<T>
{
@@ -147,13 +147,13 @@ namespace StgSharp.Mathematics
{
private readonly MatrixKernel<T>* _source = source;
internal readonly int SecondaryStride = secondaryStride;
internal readonly int PrimOffset = primOffset;
internal readonly int PrimSize = primSize;
internal readonly int PrimStride = primStride;
internal readonly int SecondaryOffset = secondaryOffset;
internal readonly int SecondarySize = secondarySize;
internal readonly int SecondaryStride = secondaryStride;
internal readonly MatrixKernel<T>* Source
{
@@ -34,7 +34,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public enum MatrixAllocation
{
@@ -29,14 +29,10 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
[StructLayout(LayoutKind.Sequential)]
public readonly struct MatrixIndex
@@ -1,50 +0,0 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Vector.Cross.cs"
// Project: World
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
namespace StgSharp.Mathematics
{
public static unsafe partial class Linear
{
public static float Cross( Vec2 vec1, Vec2 vec2 )
{
return ( vec1.X * vec2.Y ) - ( vec1.Y * vec2.X );
}
public static Vec3 Cross( Vec3 vec1, Vec3 vec2 )
{
return new Vec3(
( vec1.Y * vec2.Z ) - ( vec1.Z * vec2.Y ),
( vec1.X * vec2.Z ) - ( vec1.Z * vec2.X ),
( vec1.X * vec2.Y ) - ( vec1.Y * vec2.X ) );
}
}
}
@@ -1,50 +0,0 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Vector.GetAngle.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
namespace StgSharp.Mathematics
{
public static unsafe partial class Linear
{
public static float GetAngle( Vec2 vec1, Vec2 vec2 )
{
return Scaler.ACos(
1
//vec1.multiple(vec2)
/ ( vec1.GetLength() * vec2.GetLength() ) );
}
public static float GetAngle( Vec3 vec1, Vec3 vec2 )
{
return Scaler.ACos( ( vec1 * vec2 ) / ( vec1.GetLength() * vec2.GetLength() ) );
}
}
}
@@ -1,47 +0,0 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Vector.GetLength.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
namespace StgSharp.Mathematics
{
public static unsafe partial class Linear
{
public static float GetLength( this Vec3 vec )
{
return Scaler.Sqrt( vec.Dot( vec ) );
}
public static float GetLength( this Vec2 vec )
{
return Scaler.Sqrt( vec.Dot( vec ) );
}
}
}
@@ -1,94 +0,0 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Vector.Normalize.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Internal;
using StgSharp.Mathematics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
{
public static partial class Linear
{
public static Vec4 Normalize( Vec4 vec )
{
return new Vec4
{
vec = Vector4.Normalize( vec.vec )
};
}
public static Vec3 Normalize( Vec3 vec )
{
return new Vec3
{
v = Vector3.Normalize( vec.v )
};
}
public static unsafe void Normalize( ref Vec4 source, ref Vec4 target )
{
Vector4 s = source.vec;
Vector4 t = target.vec;
s = Vector4.Normalize( s );
float dotProduct = Vector4.Dot( s, t );
Vector4 projection = Vector4.Multiply( s, t );
t -= projection;
source.vec = s;
target.vec = t;
}
public static unsafe void Normalize( ref Vec3 source, ref Vec3 target )
{
Vector3 s = source.v;
Vector3 t = target.v;
s = Vector3.Normalize( s );
Vector3 projection = ( Vector3.Dot( t, s ) / Vector3.Dot( s, s ) ) * s;
t -= projection;
t = Vector3.Normalize( t );
source.v = s;
target.v = t;
}
}
}
@@ -1,104 +0,0 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Vector.Orthogonalize.cs"
// Project: World
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Internal.Intrinsic;
using StgSharp.Mathematics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
{
public static partial class Linear
{
public static Vec4 Orthogonalize( Vec4 vec )
{
return new Vec4
{
vec = Vector4.Normalize( vec.vec )
};
}
public static Vec3 Orthogonalize( Vec3 vec )
{
return new Vec3
{
v = Vector3.Normalize( vec.v )
};
}
public static unsafe void Orthogonalize( ref Vec4 source, ref Vec4 target )
{
Vector4 s = source.vec;
Vector4 t = target.vec;
s = Vector4.Normalize( s );
float dotProduct = Vector4.Dot( s, t );
Vector4 projection = Vector4.Multiply( s, t );
t -= projection;
source.vec = s;
target.vec = t;
}
/// <summary>
/// Orthogonalize two <see cref="Vec3" />s, let their length be 1 and perpendicular to
/// each other.
/// </summary>
/// <param _label="source">
///
/// </param>
/// <param _label="target">
///
/// </param>
public static unsafe void Orthogonalize( ref Vec3 source, ref Vec3 target )
{
Vector3 s = source.v;
Vector3 t = target.v;
s = Vector3.Normalize( s );
Vector3 projection = ( Vector3.Dot( t, s ) / Vector3.Dot( s, s ) ) * s;
t -= projection;
t = Vector3.Normalize( t );
source.v = s;
target.v = t;
}
}
}
+27 -27
View File
@@ -1,33 +1,33 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="ASin.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="ASin.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
namespace StgSharp.Mathematics
@@ -52,9 +52,9 @@ namespace StgSharp.Mathematics
/// <exception cref="ArgumentException">
///
/// </exception>
public static float ASin( float x )
public static float ASin(float x)
{
return MathF.Asin( x );
return MathF.Asin(x);
/*
int sign = 1;
float y;
+28 -28
View File
@@ -1,33 +1,33 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Cos.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="Cos.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
@@ -36,8 +36,8 @@ namespace StgSharp.Mathematics
public static partial class Scaler
{
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static float Cos( float x )
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Cos(float x)
{
/*
float refer = x / 360.0f;
@@ -53,7 +53,7 @@ namespace StgSharp.Mathematics
return ((-sinData[a]) * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2)))
+ (cosData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2)));
*/
return MathF.Cos( x );
return MathF.Cos(x);
}
}
+33 -32
View File
@@ -1,43 +1,44 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="PlainGeometryCollisionSensor.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// -----------------------------------------------------------------------
// file="PlainGeometryCollisionSensor.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Geometries;
using System;
using System.Runtime.CompilerServices;
namespace StgSharp
{
public class CollisionEventArgs : EventArgs
{
public CollisionEventArgs( IGeometry target, IGeometry boarder )
public CollisionEventArgs(IGeometry target, IGeometry boarder)
{
Target = target;
Boarder = boarder;
@@ -49,8 +50,7 @@ namespace StgSharp
}
public class PlainGeometryCollisionSensor<TBoarder, TTarget> where TBoarder: IGeometry
where TTarget: IGeometry
public class PlainGeometryCollisionSensor<TBoarder, TTarget> where TBoarder: IGeometry where TTarget: IGeometry
{
internal EventHandler<CollisionEventArgs> _rule;
@@ -59,15 +59,16 @@ namespace StgSharp
public event EventHandler<CollisionEventArgs> Rule
{
add { _rule += value; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
add => _rule += value;
remove
{
if( value == null ) {
if (value == null) {
return;
}
#pragma warning disable CS8601
#pragma warning disable CS8601
_rule -= value;
#pragma warning restore CS8601
#pragma warning restore CS8601
}
}
@@ -1,6 +1,6 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Vec2HP.cs"
// file="Matrix.Basic.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
@@ -28,40 +28,33 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.HighPerformance;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics.HighPrecision
namespace StgSharp.Mathematics.Numeric
{
[StructLayout(LayoutKind.Explicit, Pack = 16)]
public struct Vec2HP : IFixedVector<Vec2HP>
public static class MatrixCompute
{
[FieldOffset(0)] private M256 buffer;
[FieldOffset(0)] private Vector256<float> clrBuffer;
[FieldOffset(0 * sizeof(double))] public double X;
[FieldOffset(1 * sizeof(double))] public double Y;
public Vec2HP(double x, double y)
public static Matrix<float> Add(Matrix<float> left, Matrix<float> right)
{
this.X = x;
this.Y = y;
Unsafe.SkipInit(out buffer);
Unsafe.SkipInit(out clrBuffer);
if (left.ColumnLength != right.ColumnLength || left.RowLength != right.RowLength) {
throw new IndexOutOfRangeException("Matrix dimensions must agree.");
}
MatrixParallel.LeadParallel();
try
{
throw new NotImplementedException();
}
finally
{
MatrixParallel.EndParallel();
}
}
public static Vec2HP Zero => new Vec2HP(0, 0);
public static Vec2HP One => new Vec2HP(1, 1);
}
}
@@ -31,7 +31,7 @@
using System;
using System.Runtime.CompilerServices;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public static partial class MatrixParallel
{
@@ -37,7 +37,7 @@ using System.Numerics;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public static partial class MatrixParallel
{
@@ -819,8 +819,14 @@ namespace StgSharp.Mathematics
{
int primCount = package->PrimCount;
int secCount = package->SecCount;
int threadPerGroup = (1024 / primCount) + 1;
secCount /= threadPerGroup;
int tileWidth = (1024 / secCount) + 1;
int tileCount = (primCount / tileWidth) + 1;
int tilePerThreadLess = tileCount / Wraps.Length;
int tileToSlice = tileCount % Wraps.Length;
// TODO 这个方法依然是独占,需要一个新的缓存类型用来辅助复用空线程束
for (int i = 0; i < Wraps.Length; i++) { }
}
}
@@ -35,7 +35,7 @@ using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
public unsafe struct ScalarPacket
{
@@ -41,7 +41,7 @@ using System.Threading.Tasks;
using hlsfAllocator = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
internal static unsafe class MatrixParallelFactory
{
@@ -34,7 +34,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading;
namespace StgSharp.Mathematics
namespace StgSharp.Mathematics.Numeric
{
/*
* Thread wrapping to accelerate matrix operations by dividing threads into groups (wraps).
@@ -56,18 +56,6 @@ namespace StgSharp.Mathematics
public static partial class MatrixParallel
{
// TODO
/*
* 目前认为应当按照如下方式进行调整:
* 1. 使用Queue进行线程束池化
* 2. 一次只能有一个线程进行发布活动(一次只能由一个线程持有)
* 3. 发布任务似乎应当分类进行,分类条件为q = n_task / n_thread
* 3.1 q=0时,不是全部任务束可以参与计算
* 3.2 q>0时,全部任务束可以参与计算
* 4. 后续分为a个q线程,b个q+1线程,然后分到线程束中,同时不保证束内任务同步
* 5. 仅可能保证线程间任务数量差异不超过512
*/
private static Thread[] _threads;
private static readonly (int a, int b)[] LookupTable = [
(1, 1), // 7
@@ -140,47 +128,46 @@ namespace StgSharp.Mathematics
{
if (count == 3)
{
SmallWraps = [ new MatrixParallelWrap(0, count, true) ];
LargeWraps = [];
Wraps = [ new MatrixParallelWrap(0, count, true) ];
(LargeWrapCount, SmallWrapCount) = (0, 1);
LeaderHandle = new MatrixParallelWrap.Handle(0, SmallWraps[0]);
LeaderHandle = new MatrixParallelWrap.Handle(0, Wraps[0]);
} else
{
count = 4;
LargeWraps = [ new MatrixParallelWrap(0, count, true) ];
SmallWraps = [];
Wraps = [ new MatrixParallelWrap(0, count, true) ];
(LargeWrapCount, SmallWrapCount) = (1, 0);
LeaderHandle = new MatrixParallelWrap.Handle(0, LargeWraps[0]);
LeaderHandle = new MatrixParallelWrap.Handle(0, Wraps[0]);
}
} else if (count == 6)
{
SmallWraps = [ new MatrixParallelWrap(0, 3, true), new MatrixParallelWrap(3, 3, false) ];
LargeWraps = [];
Wraps = [
new MatrixParallelWrap(0, 3, true),
new MatrixParallelWrap(3, 3, false)
];
(LargeWrapCount, SmallWrapCount) = (0, 2);
LeaderHandle = new MatrixParallelWrap.Handle(0, SmallWraps[0]);
LeaderHandle = new MatrixParallelWrap.Handle(0, Wraps[0]);
} else
{
(int _3wrap, int _4wrap) = FastDecompose(count);
LargeWraps = new MatrixParallelWrap[_4wrap];
SmallWraps = new MatrixParallelWrap[_3wrap];
int id = 0;
for (int idx = 0; idx < _3wrap; idx++, id += 3) {
SmallWraps[idx] = new MatrixParallelWrap(idx, 3, id == 0);
Wraps = new MatrixParallelWrap[_4wrap + _3wrap];
int id = 0,idx = 0;
for (; idx < _3wrap; idx++, id += 3) {
Wraps[idx] = new MatrixParallelWrap(idx, 3, id == 0);
}
for (int idx = 0; idx < _3wrap + _4wrap; idx++, id += 4) {
LargeWraps[idx] = new MatrixParallelWrap(id, 4, id == 0);
for (; idx < _3wrap + _4wrap; idx++, id += 4) {
Wraps[idx] = new MatrixParallelWrap(id, 4, id == 0);
}
LeaderHandle = new MatrixParallelWrap.Handle(0, _3wrap == 0 ? LargeWraps[0] : SmallWraps[0]);
LeaderHandle = new MatrixParallelWrap.Handle(0, Wraps[0]);
}
LeaderTask = LeaderHandle.Wrap.GetWorkerTaskQueue(0);
IsInitialized = true;
}
public static void LaunchParallel(SleepMode afterWork)
public static void LaunchParallel(IEnumerable<MatrixParallelWrap> wraps, SleepMode afterWork)
{
RemainThreadCount = _threads.Length;
_AfterWork = (ThreadPriority)afterWork;
SetAllWrap();
SetAllWrap(wraps);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -202,13 +189,10 @@ namespace StgSharp.Mathematics
RemainThreadCount = _threads.Length;
}
public static void SetAllWrap()
public static void SetAllWrap(IEnumerable<MatrixParallelWrap> wraps)
{
ResetThreadCount();
foreach (MatrixParallelWrap item in LargeWraps) {
item.SchedulerReset.Set();
}
foreach (MatrixParallelWrap item in SmallWraps) {
foreach (MatrixParallelWrap item in wraps) {
item.SchedulerReset.Set();
}
}
@@ -360,8 +344,7 @@ namespace StgSharp.Mathematics
#region wrap field
private static MatrixParallelWrap[] LargeWraps;
private static MatrixParallelWrap[] SmallWraps;
private static MatrixParallelWrap[] Wraps;
private static int LargeWrapCount;
private static int SmallWrapCount;
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>Preview</LangVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\StgSharp.Common\StgSharp.Common.csproj" />
</ItemGroup>
</Project>
+40
View File
@@ -28,61 +28,101 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.Script", "StgSharp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.Model", "StgSharp.Model\StgSharp.Model.csproj", "{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp.Mathematics", "StgSharp.Mathematics\StgSharp.Mathematics.csproj", "{9946599F-4D34-440F-840D-F9443D5AEFAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Debug|Any CPU.ActiveCfg = Debug|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Debug|Any CPU.Build.0 = Debug|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Debug|ARM64.ActiveCfg = Debug|ARM64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Debug|ARM64.Build.0 = Debug|ARM64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Debug|x64.ActiveCfg = Debug|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Debug|x64.Build.0 = Debug|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Release|Any CPU.ActiveCfg = Release|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Release|Any CPU.Build.0 = Release|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Release|ARM64.ActiveCfg = Release|ARM64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Release|ARM64.Build.0 = Release|ARM64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Release|x64.ActiveCfg = Release|x64
{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}.Release|x64.Build.0 = Release|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Debug|Any CPU.ActiveCfg = Debug|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Debug|Any CPU.Build.0 = Debug|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Debug|ARM64.ActiveCfg = Debug|ARM64
{610B992B-BB34-49C3-9993-676C595FC12E}.Debug|ARM64.Build.0 = Debug|ARM64
{610B992B-BB34-49C3-9993-676C595FC12E}.Debug|x64.ActiveCfg = Debug|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Debug|x64.Build.0 = Debug|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Release|Any CPU.ActiveCfg = Release|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Release|Any CPU.Build.0 = Release|x64
{610B992B-BB34-49C3-9993-676C595FC12E}.Release|ARM64.ActiveCfg = Release|ARM64
{610B992B-BB34-49C3-9993-676C595FC12E}.Release|ARM64.Build.0 = Release|ARM64
{610B992B-BB34-49C3-9993-676C595FC12E}.Release|x64.ActiveCfg = Release|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Debug|Any CPU.ActiveCfg = Debug|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Debug|Any CPU.Build.0 = Debug|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Debug|ARM64.ActiveCfg = Debug|ARM64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Debug|ARM64.Build.0 = Debug|ARM64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Debug|x64.ActiveCfg = Release|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Debug|x64.Build.0 = Release|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Release|Any CPU.ActiveCfg = Release|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Release|Any CPU.Build.0 = Release|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Release|ARM64.ActiveCfg = Release|ARM64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Release|ARM64.Build.0 = Release|ARM64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Release|x64.ActiveCfg = Release|x64
{20CBFF26-6746-402E-992C-7B643E9423EB}.Release|x64.Build.0 = Release|x64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Debug|ARM64.Build.0 = Debug|ARM64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Debug|x64.ActiveCfg = Debug|x64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Debug|x64.Build.0 = Debug|x64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|Any CPU.Build.0 = Release|Any CPU
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|ARM64.ActiveCfg = Release|ARM64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|ARM64.Build.0 = Release|ARM64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|x64.ActiveCfg = Release|x64
{10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|x64.Build.0 = Release|x64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|ARM64.ActiveCfg = Debug|ARM64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|ARM64.Build.0 = Debug|ARM64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|x64.ActiveCfg = Debug|x64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|x64.Build.0 = Debug|x64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|Any CPU.Build.0 = Release|Any CPU
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|ARM64.ActiveCfg = Release|ARM64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|ARM64.Build.0 = Release|ARM64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|x64.ActiveCfg = Release|x64
{5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|x64.Build.0 = Release|x64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|ARM64.ActiveCfg = Debug|ARM64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|ARM64.Build.0 = Debug|ARM64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|x64.ActiveCfg = Debug|x64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|x64.Build.0 = Debug|x64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Release|Any CPU.Build.0 = Release|Any CPU
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Release|ARM64.ActiveCfg = Release|ARM64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Release|ARM64.Build.0 = Release|ARM64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Release|x64.ActiveCfg = Release|x64
{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Release|x64.Build.0 = Release|x64
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Debug|ARM64.Build.0 = Debug|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Debug|x64.ActiveCfg = Debug|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Debug|x64.Build.0 = Debug|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Release|Any CPU.Build.0 = Release|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Release|ARM64.ActiveCfg = Release|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Release|ARM64.Build.0 = Release|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Release|x64.ActiveCfg = Release|Any CPU
{9946599F-4D34-440F-840D-F9443D5AEFAA}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE