- 
                Notifications
    
You must be signed in to change notification settings  - Fork 480
 
Implement S/C/D/Z AXPBY #1048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            langou
  merged 11 commits into
  Reference-LAPACK:master
from
grisuthedragon:implement-axpby
  
      
      
   
  Sep 19, 2025 
      
    
  
     Merged
                    Implement S/C/D/Z AXPBY #1048
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            11 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      6cdf7bc
              
                Implement AXBPY
              
              
                grisuthedragon ad70e72
              
                Tests for C/S/D/ZAXBPY
              
              
                grisuthedragon c571921
              
                Update CBLAS headers
              
              
                grisuthedragon 4b9693f
              
                Add CBLAS for AXPBY
              
              
                grisuthedragon f21a6ae
              
                Fix error if alpha=0
              
              
                grisuthedragon 1221bb2
              
                Merge branch 'Reference-LAPACK:master' into implement-axpby
              
              
                grisuthedragon 506f2b3
              
                Merge branch 'Reference-LAPACK:master' into implement-axpby
              
              
                grisuthedragon 0ab775d
              
                Merge branch 'master' into implement-axpby
              
              
                grisuthedragon e6eeebd
              
                Merge branch 'Reference-LAPACK:master' into implement-axpby
              
              
                grisuthedragon 6fa7bf6
              
                Fix suggestions by angsch
              
              
                grisuthedragon 7f5bcbb
              
                Merge branch 'Reference-LAPACK:master' into implement-axpby
              
              
                grisuthedragon File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| *> \brief \b CAXPBY | ||
| * | ||
| * =========== DOCUMENTATION =========== | ||
| * | ||
| * Online html documentation available at | ||
| * http://www.netlib.org/lapack/explore-html/ | ||
| * | ||
| * Definition: | ||
| * =========== | ||
| * | ||
| * SUBROUTINE CAXPBY(N,CA,CX,INCX,CB,CY,INCY) | ||
| * | ||
| * .. Scalar Arguments .. | ||
| * COMPLEX CA,CB | ||
| * INTEGER INCX,INCY,N | ||
| * .. | ||
| * .. Array Arguments .. | ||
| * COMPLEX CX(*),CY(*) | ||
| * .. | ||
| * | ||
| * | ||
| *> \par Purpose: | ||
| * ============= | ||
| *> | ||
| *> \verbatim | ||
| *> | ||
| *> CAXPBY constant times a vector plus constant times a vector. | ||
| *> | ||
| *> Y = ALPHA * X + BETA * Y | ||
| *> | ||
| *> \endverbatim | ||
| * | ||
| * Arguments: | ||
| * ========== | ||
| * | ||
| *> \param[in] N | ||
| *> \verbatim | ||
| *> N is INTEGER | ||
| *> number of elements in input vector(s) | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] CA | ||
| *> \verbatim | ||
| *> CA is COMPLEX | ||
| *> On entry, CA specifies the scalar alpha. | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] CX | ||
| *> \verbatim | ||
| *> CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) ) | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] INCX | ||
| *> \verbatim | ||
| *> INCX is INTEGER | ||
| *> storage spacing between elements of CX | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] CB | ||
| *> \verbatim | ||
| *> CB is COMPLEX | ||
| *> On entry, CB specifies the scalar beta. | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in,out] CY | ||
| *> \verbatim | ||
| *> CY is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCY ) ) | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] INCY | ||
| *> \verbatim | ||
| *> INCY is INTEGER | ||
| *> storage spacing between elements of CY | ||
| *> \endverbatim | ||
| * | ||
| * Authors: | ||
| * ======== | ||
| * | ||
| *> \author Univ. of Tennessee | ||
| *> \author Univ. of California Berkeley | ||
| *> \author Univ. of Colorado Denver | ||
| *> \author NAG Ltd. | ||
| *> \author Martin Koehler, MPI Magdeburg | ||
| * | ||
| *> \ingroup axpby | ||
| * | ||
| * ===================================================================== | ||
| SUBROUTINE CAXPBY(N,CA,CX,INCX,CB,CY,INCY) | ||
| IMPLICIT NONE | ||
| * | ||
| * -- Reference BLAS level1 routine -- | ||
| * -- Reference BLAS is a software package provided by Univ. of Tennessee, -- | ||
| * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- | ||
| * | ||
| * .. Scalar Arguments .. | ||
| COMPLEX CA, CB | ||
| INTEGER INCX,INCY,N | ||
| * .. | ||
| * .. Array Arguments .. | ||
| COMPLEX CX(*),CY(*) | ||
| * .. | ||
| * .. External Subroutines .. | ||
| EXTERNAL CSCAL | ||
| * | ||
| * ===================================================================== | ||
| * | ||
| * .. Local Scalars .. | ||
| INTEGER I,IX,IY | ||
| * .. | ||
| IF (N.LE.0) RETURN | ||
| 
     | 
||
| IF (CA .EQ. (0.0,0.0) .AND. CB.NE.(0.0,0.0)) THEN | ||
| CALL CSCAL(N,CB, CY, INCY) | ||
| RETURN | ||
| END IF | ||
| 
     | 
||
| IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN | ||
| * | ||
| * code for both increments equal to 1 | ||
| * | ||
| DO I = 1,N | ||
| CY(I) = CB*CY(I) + CA*CX(I) | ||
| END DO | ||
| ELSE | ||
| * | ||
| * code for unequal increments or equal increments | ||
| * not equal to 1 | ||
| * | ||
| IX = 1 | ||
| IY = 1 | ||
| IF (INCX.LT.0) IX = (-N+1)*INCX + 1 | ||
| IF (INCY.LT.0) IY = (-N+1)*INCY + 1 | ||
| DO I = 1,N | ||
| CY(IY) = CB*CY(IY) + CA*CX(IX) | ||
| IX = IX + INCX | ||
| IY = IY + INCY | ||
| END DO | ||
| END IF | ||
| * | ||
| RETURN | ||
| * | ||
| * End of CAXBPY | ||
| * | ||
| END | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| *> \brief \b DAXPBY | ||
| * | ||
| * =========== DOCUMENTATION =========== | ||
| * | ||
| * Online html documentation available at | ||
| * http://www.netlib.org/lapack/explore-html/ | ||
| * | ||
| * Definition: | ||
| * =========== | ||
| * | ||
| * SUBROUTINE DAXPBY(N,DA,DX,INCX,DB,DY,INCY) | ||
| * | ||
| * .. Scalar Arguments .. | ||
| * DOUBLE PRECISION DA,DB | ||
| * INTEGER INCX,INCY,N | ||
| * .. | ||
| * .. Array Arguments .. | ||
| * DOUBLE PRECISION DX(*),DY(*) | ||
| * .. | ||
| * | ||
| * | ||
| *> \par Purpose: | ||
| * ============= | ||
| *> | ||
| *> \verbatim | ||
| *> | ||
| *> DAXPBY constant times a vector plus constant times a vector. | ||
| *> | ||
| *> Y = ALPHA * X + BETA * Y | ||
| *> | ||
| *> \endverbatim | ||
| * | ||
| * Arguments: | ||
| * ========== | ||
| * | ||
| *> \param[in] N | ||
| *> \verbatim | ||
| *> N is INTEGER | ||
| *> number of elements in input vector(s) | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] DA | ||
| *> \verbatim | ||
| *> DA is DOUBLE PRECISION | ||
| *> On entry, DA specifies the scalar alpha. | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] DX | ||
| *> \verbatim | ||
| *> DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) ) | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] INCX | ||
| *> \verbatim | ||
| *> INCX is INTEGER | ||
| *> storage spacing between elements of DX | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] DB | ||
| *> \verbatim | ||
| *> DB is DOUBLE PRECISION | ||
| *> On entry, DB specifies the scalar beta. | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in,out] DY | ||
| *> \verbatim | ||
| *> DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) ) | ||
| *> \endverbatim | ||
| *> | ||
| *> \param[in] INCY | ||
| *> \verbatim | ||
| *> INCY is INTEGER | ||
| *> storage spacing between elements of DY | ||
| *> \endverbatim | ||
| * | ||
| * Authors: | ||
| * ======== | ||
| * | ||
| *> \author Univ. of Tennessee | ||
| *> \author Univ. of California Berkeley | ||
| *> \author Univ. of Colorado Denver | ||
| *> \author NAG Ltd. | ||
| *> \author Martin Koehler, MPI Magdeburg | ||
| * | ||
| *> \ingroup axpby | ||
| * | ||
| * ===================================================================== | ||
| SUBROUTINE DAXPBY(N,DA,DX,INCX,DB,DY,INCY) | ||
| IMPLICIT NONE | ||
| * | ||
| * -- Reference BLAS level1 routine -- | ||
| * -- Reference BLAS is a software package provided by Univ. of Tennessee, -- | ||
| * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- | ||
| * | ||
| * .. Scalar Arguments .. | ||
| DOUBLE PRECISION DA,DB | ||
| INTEGER INCX,INCY,N | ||
| * .. | ||
| * .. Array Arguments .. | ||
| DOUBLE PRECISION DX(*),DY(*) | ||
| * .. | ||
| * .. External Subroutines | ||
| EXTERNAL DSCAL | ||
| * | ||
| * ===================================================================== | ||
| * | ||
| * .. Local Scalars .. | ||
| INTEGER I,IX,IY,M,MP1 | ||
| * .. | ||
| * .. Intrinsic Functions .. | ||
| INTRINSIC MOD | ||
| * .. | ||
| IF (N.LE.0) RETURN | ||
| 
     | 
||
| * Scale if DA.EQ.0 | ||
| IF (DA.EQ.0.0D0 .AND. DB.NE.0.0D0) THEN | ||
| CALL DSCAL(N, DB, DY, INCY) | ||
| RETURN | ||
| END IF | ||
| 
     | 
||
| IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN | ||
| * | ||
| * code for both increments equal to 1 | ||
| * | ||
| * | ||
| * | ||
| DO I = 1,N | ||
| DY(I) = DB*DY(I) + DA*DX(I) | ||
| END DO | ||
| ELSE | ||
| * | ||
| * code for unequal increments or equal increments | ||
| * not equal to 1 | ||
| * | ||
| IX = 1 | ||
| IY = 1 | ||
| IF (INCX.LT.0) IX = (-N+1)*INCX + 1 | ||
| IF (INCY.LT.0) IY = (-N+1)*INCY + 1 | ||
| DO I = 1,N | ||
| DY(IY) = DB*DY(IY) + DA*DX(IX) | ||
| IX = IX + INCX | ||
| IY = IY + INCY | ||
| END DO | ||
| END IF | ||
| RETURN | ||
| * | ||
| * End of DAXPBY | ||
| * | ||
| END | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.