@@ -69,8 +69,8 @@ private static float CosineSimilarityCore(ReadOnlySpan<float> x, ReadOnlySpan<fl
6969
7070        private  static float  Aggregate < TLoad ,  TAggregate > ( 
7171            float  identityValue ,  ReadOnlySpan < float >  x ,  TLoad  load  =  default ,  TAggregate  aggregate  =  default ) 
72-             where  TLoad  :  IUnaryOperator 
73-             where  TAggregate  :  IBinaryOperator 
72+             where  TLoad  :  struct ,   IUnaryOperator 
73+             where  TAggregate  :  struct ,   IBinaryOperator 
7474        { 
7575            // Initialize the result to the identity value 
7676            float  result  =  identityValue ; 
@@ -112,8 +112,8 @@ private static float Aggregate<TLoad, TAggregate>(
112112
113113        private  static float  Aggregate < TBinary ,  TAggregate > ( 
114114            float  identityValue ,  ReadOnlySpan < float >  x ,  ReadOnlySpan < float >  y ,  TBinary  binary  =  default ,  TAggregate  aggregate  =  default ) 
115-             where  TBinary  :  IBinaryOperator 
116-             where  TAggregate  :  IBinaryOperator 
115+             where  TBinary  :  struct ,   IBinaryOperator 
116+             where  TAggregate  :  struct ,   IBinaryOperator 
117117        { 
118118            // Initialize the result to the identity value 
119119            float  result  =  identityValue ; 
@@ -156,7 +156,7 @@ private static float Aggregate<TBinary, TAggregate>(
156156
157157        private  static void  InvokeSpanIntoSpan < TUnaryOperator > ( 
158158            ReadOnlySpan < float >  x ,  Span < float >  destination ,  TUnaryOperator  op  =  default ) 
159-             where  TUnaryOperator  :  IUnaryOperator 
159+             where  TUnaryOperator  :  struct ,   IUnaryOperator 
160160        { 
161161            if  ( x . Length  >  destination . Length ) 
162162            { 
@@ -203,7 +203,7 @@ private static void InvokeSpanIntoSpan<TUnaryOperator>(
203203
204204        private  static void  InvokeSpanSpanIntoSpan < TBinaryOperator > ( 
205205            ReadOnlySpan < float >  x ,  ReadOnlySpan < float >  y ,  Span < float >  destination ,  TBinaryOperator  op  =  default ) 
206-             where  TBinaryOperator  :  IBinaryOperator 
206+             where  TBinaryOperator  :  struct ,   IBinaryOperator 
207207        { 
208208            if  ( x . Length  !=  y . Length ) 
209209            { 
@@ -258,7 +258,7 @@ private static void InvokeSpanSpanIntoSpan<TBinaryOperator>(
258258
259259        private  static void  InvokeSpanScalarIntoSpan < TBinaryOperator > ( 
260260            ReadOnlySpan < float >  x ,  float  y ,  Span < float >  destination ,  TBinaryOperator  op  =  default ) 
261-             where  TBinaryOperator  :  IBinaryOperator 
261+             where  TBinaryOperator  :  struct ,   IBinaryOperator 
262262        { 
263263            if  ( x . Length  >  destination . Length ) 
264264            { 
@@ -309,7 +309,7 @@ private static void InvokeSpanScalarIntoSpan<TBinaryOperator>(
309309
310310        private  static void  InvokeSpanSpanSpanIntoSpan < TTernaryOperator > ( 
311311            ReadOnlySpan < float >  x ,  ReadOnlySpan < float >  y ,  ReadOnlySpan < float >  z ,  Span < float >  destination ,  TTernaryOperator  op  =  default ) 
312-             where  TTernaryOperator  :  ITernaryOperator 
312+             where  TTernaryOperator  :  struct ,   ITernaryOperator 
313313        { 
314314            if  ( x . Length  !=  y . Length  ||  x . Length  !=  z . Length ) 
315315            { 
@@ -369,7 +369,7 @@ private static void InvokeSpanSpanSpanIntoSpan<TTernaryOperator>(
369369
370370        private  static void  InvokeSpanSpanScalarIntoSpan < TTernaryOperator > ( 
371371            ReadOnlySpan < float >  x ,  ReadOnlySpan < float >  y ,  float  z ,  Span < float >  destination ,  TTernaryOperator  op  =  default ) 
372-             where  TTernaryOperator  :  ITernaryOperator 
372+             where  TTernaryOperator  :  struct ,   ITernaryOperator 
373373        { 
374374            if  ( x . Length  !=  y . Length ) 
375375            { 
@@ -430,7 +430,7 @@ private static void InvokeSpanSpanScalarIntoSpan<TTernaryOperator>(
430430
431431        private  static void  InvokeSpanScalarSpanIntoSpan < TTernaryOperator > ( 
432432            ReadOnlySpan < float >  x ,  float  y ,  ReadOnlySpan < float >  z ,  Span < float >  destination ,  TTernaryOperator  op  =  default ) 
433-             where  TTernaryOperator  :  ITernaryOperator 
433+             where  TTernaryOperator  :  struct ,   ITernaryOperator 
434434        { 
435435            if  ( x . Length  !=  z . Length ) 
436436            { 
0 commit comments