scal(3)

🌸 scal(3) β€” bestie, it's literally just x = alpha x πŸ’…

okay so picture this: you've got a vector, right, and you wanna scale the whole thing by one constant. That's it. That's the page. scal is the family name for six little Fortran subroutines that all do <rainbow>vector = alpha Γ— vector</rainbow>, one for each flavour of real/complex/single/double. No cap, it's the glow-up your array asked for ✨


✨ SYNOPSIS ✨

the function besties 🫢

  • subroutine cscal (n, ca, cx, incx) β€” CSCAL
  • subroutine csscal (n, sa, cx, incx) β€” CSSCAL
  • subroutine dscal (n, da, dx, incx) β€” DSCAL
  • subroutine sscal (n, sa, sx, incx) β€” SSCAL
  • subroutine zdscal (n, da, zx, incx) β€” ZDSCAL
  • subroutine zscal (n, za, zx, incx) β€” ZSCAL

πŸ’œ Detailed Description

ngl there is no big essay here β€” the detailed description is literally just the six function docs below. Scroll down, pick your type, live your truth πŸ’–


πŸŽ€ Function Documentation πŸŽ€

πŸ¦‹ subroutine cscal (integer n, complex ca, complex, dimension(*) cx, integer incx)

CSCAL

Purpose:

!>
!>    CSCAL scales a vector by a constant.
!>

so it takes a complex vector and multiplies the whole thing by a complex constant. iconic, no notes πŸ’…

Parameters

  • N
!>          N is INTEGER
!>         number of elements in input vector(s)
!>
  • CA
!>          CA is COMPLEX
!>           On entry, CA specifies the scalar alpha.
!>
  • CX
!>          CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
!>
  • INCX
!>          INCX is INTEGER
!>         storage spacing between elements of CX
!>

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details:

!>
!>     jack dongarra, linpack,  3/11/78.
!>     modified 3/93 to return if incx .le. 0.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!>

Definition at line 77 of file cscal.f.


πŸ¦‹ subroutine csscal (integer n, real sa, complex, dimension(*) cx, integer incx)

CSSCAL

Purpose:

!>
!>    CSSCAL scales a complex vector by a real constant.
!>

yes bestie, mixed types β€” a real scalar swooping in to scale a complex vector. it's giving versatility πŸ”₯

Parameters

  • N
!>          N is INTEGER
!>         number of elements in input vector(s)
!>
  • SA
!>          SA is REAL
!>           On entry, SA specifies the scalar alpha.
!>
  • CX
!>          CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
!>
  • INCX
!>          INCX is INTEGER
!>         storage spacing between elements of CX
!>

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details:

!>
!>     jack dongarra, linpack, 3/11/78.
!>     modified 3/93 to return if incx .le. 0.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!>

Definition at line 77 of file csscal.f.


πŸ¦‹ subroutine dscal (integer n, double precision da, double precision, dimension(*) dx, integer incx)

DSCAL

Purpose:

!>
!>    DSCAL scales a vector by a constant.
!>    uses unrolled loops for increment equal to 1.
!>

double precision AND it unrolls the loops when INCX is 1?? highkey a performance queen πŸ‘‘

Parameters

  • N
!>          N is INTEGER
!>         number of elements in input vector(s)
!>
  • DA
!>          DA is DOUBLE PRECISION
!>           On entry, DA specifies the scalar alpha.
!>
  • DX
!>          DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
!>
  • INCX
!>          INCX is INTEGER
!>         storage spacing between elements of DX
!>

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details:

!>
!>     jack dongarra, linpack, 3/11/78.
!>     modified 3/93 to return if incx .le. 0.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!>

Definition at line 78 of file dscal.f.


πŸ¦‹ subroutine sscal (integer n, real sa, real, dimension(*) sx, integer incx)

SSCAL

Purpose:

!>
!>    SSCAL scales a vector by a constant.
!>    uses unrolled loops for increment equal to 1.
!>

the single-precision sibling β€” same unrolled-loop energy when INCX equals 1 🌈

Parameters

  • N
!>          N is INTEGER
!>         number of elements in input vector(s)
!>
  • SA
!>          SA is REAL
!>           On entry, SA specifies the scalar alpha.
!>
  • SX
!>          SX is REAL array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
!>
  • INCX
!>          INCX is INTEGER
!>         storage spacing between elements of SX
!>

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details:

!>
!>     jack dongarra, linpack, 3/11/78.
!>     modified 3/93 to return if incx .le. 0.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!>

Definition at line 78 of file sscal.f.


πŸ¦‹ subroutine zdscal (integer n, double precision da, complex*16, dimension(*) zx, integer incx)

ZDSCAL

Purpose:

!>
!>    ZDSCAL scales a vector by a constant.
!>

double-precision real scalar, COMPLEX*16 vector β€” the Z + D combo meal πŸ“

Parameters

  • N
!>          N is INTEGER
!>         number of elements in input vector(s)
!>
  • DA
!>          DA is DOUBLE PRECISION
!>           On entry, DA specifies the scalar alpha.
!>
  • ZX
!>          ZX is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
!>
  • INCX
!>          INCX is INTEGER
!>         storage spacing between elements of ZX
!>

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details:

!>
!>     jack dongarra, 3/11/78.
!>     modified 3/93 to return if incx .le. 0.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!>
πŸ’€ tiny heads-up bestie: notice this one's history block says jack dongarra, 3/11/78. β€” no linpack in there, unlike all the others. it's the ✨ unique ✨ one, don't come for me, I'm just the messenger 🫢

Definition at line 77 of file zdscal.f.


πŸ¦‹ subroutine zscal (integer n, complex*16 za, complex*16, dimension(*) zx, integer incx)

ZSCAL

Purpose:

!>
!>    ZSCAL scales a vector by a constant.
!>

COMPLEX*16 all the way down β€” scalar AND vector. main character energy, truly πŸ‘‘

Parameters

  • N
!>          N is INTEGER
!>         number of elements in input vector(s)
!>
  • ZA
!>          ZA is COMPLEX*16
!>           On entry, ZA specifies the scalar alpha.
!>
  • ZX
!>          ZX is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
!>
  • INCX
!>          INCX is INTEGER
!>         storage spacing between elements of ZX
!>

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details:

!>
!>     jack dongarra, 3/11/78.
!>     modified 3/93 to return if incx .le. 0.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!>

Definition at line 77 of file zscal.f.


πŸ‘‘ Author

Generated automatically by Doxygen for LAPACK from the source code.

(so like, a robot wrote this and we're all just vibing on top of it πŸ’–)


and that's the whole page bestie, go forth and scale 🌸

LAPACK Version 3.12.0 β€” mwah, that's the version and it's stamped on scal(3), ok bye now πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from