@@ -24,7 +24,7 @@ public static Float DotProduct(Float[] a, Float[] b)
2424        { 
2525            Contracts . Check ( Utils . Size ( a )  ==  Utils . Size ( b ) ,  "Arrays must have the same length" ) ; 
2626            Contracts . Check ( Utils . Size ( a )  >  0 ) ; 
27-             return  SseUtils . DotProductDense ( a ,  b ,  a . Length ) ; 
27+             return  CpuMathUtils . DotProductDense ( a ,  b ,  a . Length ) ; 
2828        } 
2929
3030        public  static   Float  DotProduct ( Float [ ]  a ,  ref  VBuffer < Float >  b ) 
@@ -33,8 +33,8 @@ public static Float DotProduct(Float[] a, ref VBuffer<Float> b)
3333            if  ( b . Count  ==  0 ) 
3434                return  0 ; 
3535            if  ( b . IsDense ) 
36-                 return  SseUtils . DotProductDense ( a ,  b . Values ,  b . Length ) ; 
37-             return  SseUtils . DotProductSparse ( a ,  b . Values ,  b . Indices ,  b . Count ) ; 
36+                 return  CpuMathUtils . DotProductDense ( a ,  b . Values ,  b . Length ) ; 
37+             return  CpuMathUtils . DotProductSparse ( a ,  b . Values ,  b . Indices ,  b . Count ) ; 
3838        } 
3939
4040        public  static   Float  DotProduct ( ref  VBuffer < Float >  a ,  ref  VBuffer < Float >  b ) 
@@ -47,12 +47,12 @@ public static Float DotProduct(ref VBuffer<Float> a, ref VBuffer<Float> b)
4747            if  ( a . IsDense ) 
4848            { 
4949                if  ( b . IsDense ) 
50-                     return  SseUtils . DotProductDense ( a . Values ,  b . Values ,  a . Length ) ; 
51-                 return  SseUtils . DotProductSparse ( a . Values ,  b . Values ,  b . Indices ,  b . Count ) ; 
50+                     return  CpuMathUtils . DotProductDense ( a . Values ,  b . Values ,  a . Length ) ; 
51+                 return  CpuMathUtils . DotProductSparse ( a . Values ,  b . Values ,  b . Indices ,  b . Count ) ; 
5252            } 
5353
5454            if  ( b . IsDense ) 
55-                 return  SseUtils . DotProductSparse ( b . Values ,  a . Values ,  a . Indices ,  a . Count ) ; 
55+                 return  CpuMathUtils . DotProductSparse ( b . Values ,  a . Values ,  a . Indices ,  a . Count ) ; 
5656            return  DotProductSparse ( a . Values ,  a . Indices ,  0 ,  a . Count ,  b . Values ,  b . Indices ,  0 ,  b . Count ,  0 ) ; 
5757        } 
5858
@@ -159,7 +159,7 @@ public static void MulElementWise(ref VBuffer<Float> a, ref VBuffer<Float> dst)
159159            Contracts . Check ( a . Length  ==  dst . Length ,  "Vectors must have the same dimensionality." ) ; 
160160
161161            if  ( a . IsDense  &&  dst . IsDense ) 
162-                 SseUtils . MulElementWise ( a . Values ,  dst . Values ,  dst . Values ,  a . Length ) ; 
162+                 CpuMathUtils . MulElementWise ( a . Values ,  dst . Values ,  dst . Values ,  a . Length ) ; 
163163            else 
164164                VBufferUtils . ApplyWithEitherDefined ( ref  a ,  ref  dst ,  ( int  ind ,  Float  v1 ,  ref  Float  v2 )  =>  {  v2  *=  v1 ;  } ) ; 
165165        } 
@@ -228,11 +228,11 @@ private static Float L2DistSquaredHalfSparse(Float[] valuesA, int lengthA, Float
228228            Contracts . Assert ( 0  <=  countB  &&  countB  <=  Utils . Size ( indicesB ) ) ; 
229229            Contracts . Assert ( countB  <=  Utils . Size ( valuesB ) ) ; 
230230
231-             var  normA  =  SseUtils . SumSq ( valuesA ,  0 ,  lengthA ) ; 
231+             var  normA  =  CpuMathUtils . SumSq ( valuesA ,  0 ,  lengthA ) ; 
232232            if  ( countB  ==  0 ) 
233233                return  normA ; 
234-             var  normB  =  SseUtils . SumSq ( valuesB ,  0 ,  countB ) ; 
235-             var  dotP  =  SseUtils . DotProductSparse ( valuesA ,  valuesB ,  indicesB ,  countB ) ; 
234+             var  normB  =  CpuMathUtils . SumSq ( valuesB ,  0 ,  countB ) ; 
235+             var  dotP  =  CpuMathUtils . DotProductSparse ( valuesA ,  valuesB ,  indicesB ,  countB ) ; 
236236            var  res  =  normA  +  normB  -  2  *  dotP ; 
237237            return  res  <  0  ?  0  :  res ; 
238238        } 
@@ -246,7 +246,7 @@ private static Float L2DiffSquaredDense(Float[] valuesA, Float[] valuesB, int le
246246
247247            if  ( length  ==  0 ) 
248248                return  0 ; 
249-             return  SseUtils . L2DistSquared ( valuesA ,  valuesB ,  length ) ; 
249+             return  CpuMathUtils . L2DistSquared ( valuesA ,  valuesB ,  length ) ; 
250250        } 
251251
252252        /// <summary> 
@@ -267,8 +267,8 @@ public static Float DotProductWithOffset(ref VBuffer<Float> a, int offset, ref V
267267            if  ( a . IsDense ) 
268268            { 
269269                if  ( b . IsDense ) 
270-                     return  SseUtils . DotProductDense ( a . Values ,  offset ,  b . Values ,  b . Length ) ; 
271-                 return  SseUtils . DotProductSparse ( a . Values ,  offset ,  b . Values ,  b . Indices ,  b . Count ) ; 
270+                     return  CpuMathUtils . DotProductDense ( a . Values ,  offset ,  b . Values ,  b . Length ) ; 
271+                 return  CpuMathUtils . DotProductSparse ( a . Values ,  offset ,  b . Values ,  b . Indices ,  b . Count ) ; 
272272            } 
273273            else 
274274            { 
@@ -314,8 +314,8 @@ public static Float DotProductWithOffset(Float[] a, int offset, ref VBuffer<Floa
314314                return  0 ; 
315315
316316            if  ( b . IsDense ) 
317-                 return  SseUtils . DotProductDense ( a ,  offset ,  b . Values ,  b . Length ) ; 
318-             return  SseUtils . DotProductSparse ( a ,  offset ,  b . Values ,  b . Indices ,  b . Count ) ; 
317+                 return  CpuMathUtils . DotProductDense ( a ,  offset ,  b . Values ,  b . Length ) ; 
318+             return  CpuMathUtils . DotProductSparse ( a ,  offset ,  b . Values ,  b . Indices ,  b . Count ) ; 
319319        } 
320320
321321        private  static   Float  DotProductSparse ( Float [ ]  aValues ,  int [ ]  aIndices ,  int  ia ,  int  iaLim ,  Float [ ]  bValues ,  int [ ]  bIndices ,  int  ib ,  int  ibLim ,  int  offset ) 
@@ -434,7 +434,7 @@ public static void Add(Float[] src, Float[] dst)
434434            Contracts . CheckParam ( src . Length  ==  dst . Length ,  nameof ( dst ) ,  "Arrays must have the same dimensionality." ) ; 
435435            if  ( src . Length  ==  0 ) 
436436                return ; 
437-             SseUtils . Add ( src ,  dst ,  src . Length ) ; 
437+             CpuMathUtils . Add ( src ,  dst ,  src . Length ) ; 
438438        } 
439439
440440        /// <summary> 
@@ -452,7 +452,7 @@ public static void AddMult(ref VBuffer<Float> src, Float[] dst, Float c)
452452                return ; 
453453
454454            if  ( src . IsDense ) 
455-                 SseUtils . AddScale ( c ,  src . Values ,  dst ,  src . Count ) ; 
455+                 CpuMathUtils . AddScale ( c ,  src . Values ,  dst ,  src . Count ) ; 
456456            else 
457457            { 
458458                for  ( int  i  =  0 ;  i  <  src . Count ;  i ++ ) 
@@ -502,15 +502,15 @@ public static void AddMult(Float[] src, Float[] dst, Float c)
502502            if  ( c  ==  0 ) 
503503                return ; 
504504
505-             SseUtils . AddScale ( c ,  src ,  dst ,  src . Length ) ; 
505+             CpuMathUtils . AddScale ( c ,  src ,  dst ,  src . Length ) ; 
506506        } 
507507
508508        /// <summary> 
509509        /// Returns the L2 norm of the vector (sum of squares of the components). 
510510        /// </summary> 
511511        public  static   Float  Norm ( Float [ ]  a ) 
512512        { 
513-             return  MathUtils . Sqrt ( SseUtils . SumSq ( a ,  a . Length ) ) ; 
513+             return  MathUtils . Sqrt ( CpuMathUtils . SumSq ( a ,  a . Length ) ) ; 
514514        } 
515515
516516        /// <summary> 
@@ -520,7 +520,7 @@ public static Float Sum(Float[] a)
520520        { 
521521            if  ( a  ==  null  ||  a . Length  ==  0 ) 
522522                return  0 ; 
523-             return  SseUtils . Sum ( a ,  a . Length ) ; 
523+             return  CpuMathUtils . Sum ( a ,  a . Length ) ; 
524524        } 
525525
526526        /// <summary> 
@@ -534,7 +534,7 @@ public static void ScaleBy(Float[] dst, Float c)
534534                return ; 
535535
536536            if  ( c  !=  0 ) 
537-                 SseUtils . Scale ( c ,  dst ,  dst . Length ) ; 
537+                 CpuMathUtils . Scale ( c ,  dst ,  dst . Length ) ; 
538538            else 
539539                Array . Clear ( dst ,  0 ,  dst . Length ) ; 
540540        } 
0 commit comments