@@ -31,15 +31,19 @@ extension Matft{
3131 }
3232 }
3333 else {
34+ #if canImport(Accelerate)
3435 switch MfType . storedType ( rettype) {
3536 case . Float:
3637 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvadd)
3738 case . Double:
3839 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvaddD)
3940 }
41+ #else
42+ fatalError ( " Complex array operations are not supported on this platform " )
43+ #endif
4044 }
4145 }
42-
46+
4347 /**
4448 Element-wise addition of mfarray and scalar
4549 - parameters:
@@ -64,12 +68,16 @@ extension Matft{
6468 }
6569 }
6670 else {
71+ #if canImport(Accelerate)
6772 switch MfType . storedType ( retmftype) {
6873 case . Float:
6974 return biopzvs_by_vDSP ( l_mfarray, Float . from ( r_scalar) , vDSP_zrvadd)
7075 case . Double:
7176 return biopzvs_by_vDSP ( l_mfarray, Double . from ( r_scalar) , vDSP_zrvaddD)
7277 }
78+ #else
79+ fatalError ( " Complex array operations are not supported on this platform " )
80+ #endif
7381 }
7482 }
7583 /**
@@ -96,12 +104,16 @@ extension Matft{
96104 }
97105 }
98106 else {
107+ #if canImport(Accelerate)
99108 switch MfType . storedType ( retmftype) {
100109 case . Float:
101110 return biopzvs_by_vDSP ( r_mfarray, Float . from ( l_scalar) , vDSP_zrvadd)
102111 case . Double:
103112 return biopzvs_by_vDSP ( r_mfarray, Double . from ( l_scalar) , vDSP_zrvaddD)
104113 }
114+ #else
115+ fatalError ( " Complex array operations are not supported on this platform " )
116+ #endif
105117 }
106118 }
107119 /**
@@ -122,12 +134,16 @@ extension Matft{
122134 }
123135 }
124136 else {
137+ #if canImport(Accelerate)
125138 switch MfType . storedType ( rettype) {
126139 case . Float:
127140 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvsub)
128141 case . Double:
129142 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvsubD)
130143 }
144+ #else
145+ fatalError ( " Complex array operations are not supported on this platform " )
146+ #endif
131147 }
132148 }
133149 /**
@@ -154,12 +170,16 @@ extension Matft{
154170 }
155171 }
156172 else {
173+ #if canImport(Accelerate)
157174 switch MfType . storedType ( retmftype) {
158175 case . Float:
159176 return biopzvs_by_vDSP ( l_mfarray, Float . from ( r_scalar) , vDSP_zrvsub)
160177 case . Double:
161178 return biopzvs_by_vDSP ( l_mfarray, Double . from ( r_scalar) , vDSP_zrvsubD)
162179 }
180+ #else
181+ fatalError ( " Complex array operations are not supported on this platform " )
182+ #endif
163183 }
164184 }
165185 /**
@@ -186,12 +206,16 @@ extension Matft{
186206 }
187207 }
188208 else {
209+ #if canImport(Accelerate)
189210 switch MfType . storedType ( retmftype) {
190211 case . Float:
191212 return biopzvs_by_vDSP ( - r_mfarray, Float . from ( l_scalar) , vDSP_zrvadd)
192213 case . Double:
193214 return biopzvs_by_vDSP ( - r_mfarray, Double . from ( l_scalar) , vDSP_zrvaddD)
194215 }
216+ #else
217+ fatalError ( " Complex array operations are not supported on this platform " )
218+ #endif
195219 }
196220 }
197221 /**
@@ -212,12 +236,16 @@ extension Matft{
212236 }
213237 }
214238 else {
239+ #if canImport(Accelerate)
215240 switch MfType . storedType ( rettype) {
216241 case . Float:
217242 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvmul_)
218243 case . Double:
219244 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvmulD_)
220245 }
246+ #else
247+ fatalError ( " Complex array operations are not supported on this platform " )
248+ #endif
221249 }
222250 }
223251 /**
@@ -244,12 +272,16 @@ extension Matft{
244272 }
245273 }
246274 else {
275+ #if canImport(Accelerate)
247276 switch MfType . storedType ( retmftype) {
248277 case . Float:
249278 return biopzvs_by_vDSP ( l_mfarray, Float . from ( r_scalar) , vDSP_zrvmul)
250279 case . Double:
251280 return biopzvs_by_vDSP ( l_mfarray, Double . from ( r_scalar) , vDSP_zrvmulD)
252281 }
282+ #else
283+ fatalError ( " Complex array operations are not supported on this platform " )
284+ #endif
253285 }
254286 }
255287 /**
@@ -276,12 +308,16 @@ extension Matft{
276308 }
277309 }
278310 else {
311+ #if canImport(Accelerate)
279312 switch MfType . storedType ( retmftype) {
280313 case . Float:
281314 return biopzvs_by_vDSP ( r_mfarray, Float . from ( l_scalar) , vDSP_zrvmul)
282315 case . Double:
283316 return biopzvs_by_vDSP ( r_mfarray, Double . from ( l_scalar) , vDSP_zrvmulD)
284317 }
318+ #else
319+ fatalError ( " Complex array operations are not supported on this platform " )
320+ #endif
285321 }
286322 }
287323 /**
@@ -304,12 +340,16 @@ extension Matft{
304340 }
305341 }
306342 else {
343+ #if canImport(Accelerate)
307344 switch MfType . storedType ( rettype) {
308345 case . Float:
309346 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvdiv)
310347 case . Double:
311348 return biopzvv_by_vDSP ( l_mfarray, r_mfarray, vDSP_func: vDSP_zvdivD)
312349 }
350+ #else
351+ fatalError ( " Complex array operations are not supported on this platform " )
352+ #endif
313353 }
314354 }
315355 /**
@@ -336,12 +376,16 @@ extension Matft{
336376 }
337377 }
338378 else {
379+ #if canImport(Accelerate)
339380 switch MfType . storedType ( retmftype) {
340381 case . Float:
341382 return biopzvs_by_vDSP ( l_mfarray, Float . from ( r_scalar) , vDSP_zrvdiv)
342383 case . Double:
343384 return biopzvs_by_vDSP ( l_mfarray, Double . from ( r_scalar) , vDSP_zrvdivD)
344385 }
386+ #else
387+ fatalError ( " Complex array operations are not supported on this platform " )
388+ #endif
345389 }
346390 }
347391 /**
@@ -368,12 +412,16 @@ extension Matft{
368412 }
369413 }
370414 else {
415+ #if canImport(Accelerate)
371416 switch MfType . storedType ( retmftype) {
372417 case . Float:
373418 return biopzsv_by_vDSP ( Float . from ( l_scalar) , r_mfarray, vDSP_ztrans)
374419 case . Double:
375420 return biopzsv_by_vDSP ( Double . from ( l_scalar) , r_mfarray, vDSP_ztransD)
376421 }
422+ #else
423+ fatalError ( " Complex array operations are not supported on this platform " )
424+ #endif
377425 }
378426 }
379427
0 commit comments