LinearAlgebra`BLAS`
LinearAlgebra`BLAS`

SCAL

SCAL[α,x]

computes the scaled vector α x and resets x to the result.

Details

  • To use SCAL, you first need to load the BLAS Package using Needs["LinearAlgebra`BLAS`"].
  • The following arguments must be given:
  • αinput expressionscalar multiple
    xinput/output symbolvector; the symbol value is modified in place
  • SCAL[α,x] is equivalent to x=α x.

Examples

open allclose all

Basic Examples  (1)

Load the BLAS package:

Scale a vector by a scalar:

Scope  (4)

A real vector:

A complex vector:

An arbitrary-precision vector:

A symbolic vector:

Properties & Relations  (1)

SCAL[α,x] is equivalent to x=α x:

Possible Issues  (2)

The second argument must be a symbol:

If the second argument is not initialized, an error message is issued: