@@ -292,72 +292,9 @@ impl<A, S, D> ArrayBase<S, D>
292292 S2 : Data < Elem =A > ,
293293 A : LinalgScalar ,
294294 E : Dimension ,
295- {
296- self . scaled_add_impl ( alpha, rhs) ;
297- }
298-
299- fn scaled_add_generic < S2 , E > ( & mut self , alpha : A , rhs : & ArrayBase < S2 , E > )
300- where S : DataMut ,
301- S2 : Data < Elem =A > ,
302- A : LinalgScalar ,
303- E : Dimension ,
304295 {
305296 self . zip_mut_with ( rhs, move |y, & x| * y = * y + ( alpha * x) ) ;
306297 }
307-
308- #[ cfg( not( feature = "blas" ) ) ]
309- fn scaled_add_impl < S2 , E > ( & mut self , alpha : A , rhs : & ArrayBase < S2 , E > )
310- where S : DataMut ,
311- S2 : Data < Elem =A > ,
312- A : LinalgScalar ,
313- E : Dimension ,
314- {
315- self . scaled_add_generic ( alpha, rhs) ;
316- }
317-
318- #[ cfg( feature = "blas" ) ]
319- fn scaled_add_impl < S2 , E > ( & mut self , alpha : A , rhs : & ArrayBase < S2 , E > )
320- where S : DataMut ,
321- S2 : Data < Elem =A > ,
322- A : LinalgScalar ,
323- E : Dimension ,
324- {
325- debug_assert_eq ! ( self . len( ) , rhs. len( ) ) ;
326- assert ! ( self . len( ) == rhs. len( ) ) ;
327- {
328- macro_rules! axpy {
329- ( $ty: ty, $func: ident) => { {
330- if blas_compat:: <$ty, _, _>( self ) && blas_compat:: <$ty, _, _>( rhs) {
331- let order = Dimension :: _fastest_varying_stride_order( & self . strides) ;
332- let incx = self . strides( ) [ order[ 0 ] ] ;
333-
334- let order = Dimension :: _fastest_varying_stride_order( & rhs. strides) ;
335- let incy = self . strides( ) [ order[ 0 ] ] ;
336-
337- unsafe {
338- let ( lhs_ptr, n, incx) = blas_1d_params( self . ptr,
339- self . len( ) ,
340- incx) ;
341- let ( rhs_ptr, _, incy) = blas_1d_params( rhs. ptr,
342- rhs. len( ) ,
343- incy) ;
344- blas_sys:: c:: $func(
345- n,
346- cast_as( & alpha) ,
347- rhs_ptr as * const $ty,
348- incy,
349- lhs_ptr as * mut $ty,
350- incx) ;
351- return ;
352- }
353- }
354- } }
355- }
356- axpy ! { f32 , cblas_saxpy} ;
357- axpy ! { f64 , cblas_daxpy} ;
358- }
359- self . scaled_add_generic ( alpha, rhs) ;
360- }
361298}
362299
363300// mat_mul_impl uses ArrayView arguments to send all array kinds into
@@ -594,32 +531,6 @@ fn blas_compat_1d<A, S>(a: &ArrayBase<S, Ix1>) -> bool
594531 true
595532}
596533
597- #[ cfg( feature="blas" ) ]
598- fn blas_compat < A , S , D > ( a : & ArrayBase < S , D > ) -> bool
599- where S : Data ,
600- A : ' static ,
601- S :: Elem : ' static ,
602- D : Dimension ,
603- {
604- if !same_type :: < A , S :: Elem > ( ) {
605- return false ;
606- }
607-
608- match D :: equispaced_stride ( & a. raw_dim ( ) , & a. strides ) {
609- Some ( stride) => {
610- if a. len ( ) as isize * stride > blas_index:: max_value ( ) as isize ||
611- stride < blas_index:: min_value ( ) as isize {
612- return false ;
613- }
614- } ,
615- None => {
616- return false ;
617- }
618- }
619-
620- true
621- }
622-
623534#[ cfg( feature="blas" ) ]
624535fn blas_row_major_2d < A , S > ( a : & ArrayBase < S , Ix2 > ) -> bool
625536 where S : Data ,
0 commit comments