-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* NativeAccumulatedProduct * NativeIndexedArray * NativeIndexedList * update README, CHANGELOG, and package.json
- Loading branch information
1 parent
d1c9906
commit f965d25
Showing
34 changed files
with
1,177 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace andywiecko.BurstCollections | ||
{ | ||
public readonly struct AABBUnion : IAbelianOperator<AABB> | ||
{ | ||
public AABB NeutralElement => new AABB(min: float.MaxValue, max: float.MinValue); | ||
public AABB Product(AABB a, AABB b) => a.Union(b); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Runtime/NativeAccumulatedProduct/AABBAbelianOperators.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using Unity.Mathematics; | ||
|
||
namespace andywiecko.BurstCollections | ||
{ | ||
#region Float | ||
public readonly struct FloatSum : IAbelianOperator<float> | ||
{ | ||
public float NeutralElement => 0; | ||
public float Product(float a, float b) => a + b; | ||
} | ||
|
||
public readonly struct FloatMin : IAbelianOperator<float> | ||
{ | ||
public float NeutralElement => float.MaxValue; | ||
public float Product(float a, float b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct FloatMax : IAbelianOperator<float> | ||
{ | ||
public float NeutralElement => float.MinValue; | ||
public float Product(float a, float b) => math.max(a, b); | ||
} | ||
#endregion | ||
|
||
#region Float2 | ||
public readonly struct Float2Sum : IAbelianOperator<float2> | ||
{ | ||
public float2 NeutralElement => 0; | ||
public float2 Product(float2 a, float2 b) => a + b; | ||
} | ||
|
||
public readonly struct Float2Min : IAbelianOperator<float2> | ||
{ | ||
public float2 NeutralElement => float.MaxValue; | ||
public float2 Product(float2 a, float2 b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct Float2Max : IAbelianOperator<float2> | ||
{ | ||
public float2 NeutralElement => float.MinValue; | ||
public float2 Product(float2 a, float2 b) => math.max(a, b); | ||
} | ||
#endregion | ||
|
||
#region Float3 | ||
public readonly struct Float3Sum : IAbelianOperator<float3> | ||
{ | ||
public float3 NeutralElement => 0; | ||
public float3 Product(float3 a, float3 b) => a + b; | ||
} | ||
|
||
public readonly struct Float3Min : IAbelianOperator<float3> | ||
{ | ||
public float3 NeutralElement => float.MaxValue; | ||
public float3 Product(float3 a, float3 b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct Float3Max : IAbelianOperator<float3> | ||
{ | ||
public float3 NeutralElement => float.MinValue; | ||
public float3 Product(float3 a, float3 b) => math.max(a, b); | ||
} | ||
#endregion | ||
|
||
#region Float4 | ||
public readonly struct Float4Sum : IAbelianOperator<float4> | ||
{ | ||
public float4 NeutralElement => 0; | ||
public float4 Product(float4 a, float4 b) => a + b; | ||
} | ||
|
||
public readonly struct Float4Min : IAbelianOperator<float4> | ||
{ | ||
public float4 NeutralElement => float.MaxValue; | ||
public float4 Product(float4 a, float4 b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct Float4Max : IAbelianOperator<float4> | ||
{ | ||
public float4 NeutralElement => float.MinValue; | ||
public float4 Product(float4 a, float4 b) => math.max(a, b); | ||
} | ||
#endregion | ||
} |
11 changes: 11 additions & 0 deletions
11
Runtime/NativeAccumulatedProduct/FloatAbelianOperators.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace andywiecko.BurstCollections | ||
{ | ||
public interface IAbelianOperator<TSelf> where TSelf : unmanaged | ||
{ | ||
TSelf Product(TSelf a, TSelf b); | ||
TSelf NeutralElement { get; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using Unity.Mathematics; | ||
|
||
namespace andywiecko.BurstCollections | ||
{ | ||
#region Int | ||
public readonly struct IntSum : IAbelianOperator<int> | ||
{ | ||
public int NeutralElement => 0; | ||
public int Product(int a, int b) => a + b; | ||
} | ||
|
||
public readonly struct IntMin : IAbelianOperator<int> | ||
{ | ||
public int NeutralElement => int.MaxValue; | ||
public int Product(int a, int b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct IntMax : IAbelianOperator<int> | ||
{ | ||
public int NeutralElement => int.MinValue; | ||
public int Product(int a, int b) => math.max(a, b); | ||
} | ||
#endregion | ||
|
||
#region Int2 | ||
public readonly struct Int2Sum : IAbelianOperator<int2> | ||
{ | ||
public int2 NeutralElement => 0; | ||
public int2 Product(int2 a, int2 b) => a + b; | ||
} | ||
|
||
public readonly struct Int2Min : IAbelianOperator<int2> | ||
{ | ||
public int2 NeutralElement => int.MaxValue; | ||
public int2 Product(int2 a, int2 b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct Int2Max : IAbelianOperator<int2> | ||
{ | ||
public int2 NeutralElement => int.MinValue; | ||
public int2 Product(int2 a, int2 b) => math.max(a, b); | ||
} | ||
#endregion | ||
|
||
#region Int3 | ||
public readonly struct Int3Sum : IAbelianOperator<int3> | ||
{ | ||
public int3 NeutralElement => 0; | ||
public int3 Product(int3 a, int3 b) => a + b; | ||
} | ||
|
||
public readonly struct Int3Min : IAbelianOperator<int3> | ||
{ | ||
public int3 NeutralElement => int.MaxValue; | ||
public int3 Product(int3 a, int3 b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct Int3Max : IAbelianOperator<int3> | ||
{ | ||
public int3 NeutralElement => int.MinValue; | ||
public int3 Product(int3 a, int3 b) => math.max(a, b); | ||
} | ||
#endregion | ||
|
||
#region Int4 | ||
public readonly struct Int4Sum : IAbelianOperator<int4> | ||
{ | ||
public int4 NeutralElement => 0; | ||
public int4 Product(int4 a, int4 b) => a + b; | ||
} | ||
|
||
public readonly struct Int4Min : IAbelianOperator<int4> | ||
{ | ||
public int4 NeutralElement => int.MaxValue; | ||
public int4 Product(int4 a, int4 b) => math.min(a, b); | ||
} | ||
|
||
public readonly struct Int4Max : IAbelianOperator<int4> | ||
{ | ||
public int4 NeutralElement => int.MinValue; | ||
public int4 Product(int4 a, int4 b) => math.max(a, b); | ||
} | ||
#endregion | ||
} |
11 changes: 11 additions & 0 deletions
11
Runtime/NativeAccumulatedProduct/IntAbelianOperators.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.