@@ -840,22 +840,50 @@ int izamax( int n, doublecomplex *x, int incx)
840840
841841float snrm2 ( int n , float * x , int incx )
842842{
843+ #ifdef __APPLE__
844+ if (n < 1 || incx < 1 ) {
845+ return 0 ;
846+ }
847+ return cblas_snrm2 (n , x , incx );
848+ #else
843849 return snrm2_ (& n , x , & incx );
850+ #endif
844851}
845852
846853double dnrm2 ( int n , double * x , int incx )
847854{
855+ #ifdef __APPLE__
856+ if (n < 1 || incx < 1 ) {
857+ return 0 ;
858+ }
859+ return cblas_dnrm2 (n , x , incx );
860+ #else
848861 return dnrm2_ (& n , x , & incx );
862+ #endif
849863}
850864
851865float scnrm2 ( int n , complex * x , int incx )
852866{
867+ #ifdef __APPLE__
868+ if (n < 1 || incx < 1 ) {
869+ return 0 ;
870+ }
871+ return cblas_scnrm2 (n , x , incx );
872+ #else
853873 return scnrm2_ (& n , x , & incx );
874+ #endif
854875}
855876
856877double dznrm2 ( int n , doublecomplex * x , int incx )
857878{
879+ #ifdef __APPLE__
880+ if (n < 1 || incx < 1 ) {
881+ return 0 ;
882+ }
883+ return cblas_dznrm2 (n , x , incx );
884+ #else
858885 return dznrm2_ (& n , x , & incx );
886+ #endif
859887}
860888
861889float sasum ( int n , float * x , int incx )
0 commit comments