f06faf (PDF version)
F06 (blas) Chapter Contents
F06 (blas) Chapter Introduction
NAG Library Manual
Keyword Search:
NAG Library Routine Document
f06faf (dvcos)
▸
▿
Contents
1
Purpose
2
Specification
3
Description
4
References
5
Arguments
6
Error Indicators and Warnings
7
Accuracy
8
Parallelism and Performance
9
Further Comments
10
Example
1
Purpose
f06faf
computes the cosine of the angle between two real vectors.
2
Specification
Fortran Interface
Function f06faf (
n
,
j
,
tolx
,
x
,
incx
,
toly
,
y
,
incy
)
Real (Kind=nag_wp)
::
f06faf
Integer, Intent (In)
::
n
,
j
,
incx
,
incy
Real (Kind=nag_wp), Intent (In)
::
tolx
,
x(*)
,
toly
,
y(*)
C Header Interface
#include nagmk26.h
double
f06faf_ (
const Integer *
n
,
const Integer *
j
,
const double *
tolx
,
const double
x
[]
,
const Integer *
incx
,
const double *
toly
,
const double
y
[]
,
const Integer *
incy
)
3
Description
f06faf
returns, via the function name, the cosine of the angle between two
n
-element real vectors
x
and
y
, given by the expression
x
T
y
x
2
y
2
.
If
1
≤
j
≤
n
,
y
is taken to be the unit vector
e
j
, in which case the array
y
is not referenced.
If
x
2
≤
tolx
, the routine returns
2.0
; if
x
2
>
tolx
but
y
2
≤
tol
y
, the routine returns
-
2.0
; otherwise the value returned is in the range
-
1.0
,
1.0
.
4
References
None.
5
Arguments
1:
n
– Integer
Input
On entry
:
n
, the number of elements in
x
and
y
.
2:
j
– Integer
Input
On entry
: if the vector
y
is supplied in
y
,
j
should be set to
0
. Otherwise,
j
specifies the index
j
of the unit vector
e
j
to be used as
y
.
3:
tolx
– Real (Kind=nag_wp)
Input
On entry
: the value
tolx
, used to determine whether
x
2
is effectively zero.
If
tolx
is negative, the value zero is used.
4:
x
*
– Real (Kind=nag_wp) array
Input
Note:
the dimension of the array
x
must be at least
max
1
,
1
+
n
-
1
×
incx
.
On entry
: the
n
-element vector
x
.
If
incx
>
0
,
x
i
must be stored in
x
1
+
i
-
1
×
incx
, for
i
=
1
,
2
,
…
,
n
.
If
incx
<
0
,
x
i
must be stored in
x
1
-
n
-
i
×
incx
, for
i
=
1
,
2
,
…
,
n
.
Intermediate elements of
x
are not referenced.
5:
incx
– Integer
Input
On entry
: the increment in the subscripts of
x
between successive elements of
x
.
6:
toly
– Real (Kind=nag_wp)
Input
On entry
: the value
toly
, used to determine whether
y
2
is effectively zero.
If
toly
is negative, the value zero is used.
7:
y
*
– Real (Kind=nag_wp) array
Input
Note:
the dimension of the array
y
must be at least
max
1
,
1
+
n
-
1
×
incy
.
On entry
: if
1
≤
j
≤
n
,
y
is not referenced. Otherwise,
y
holds the vector
y
.
If
incy
>
0
,
y
i
must be stored in
y
1
+
i
-
1
×
incy
, for
i
=
1
,
2
,
…
,
n
.
If
incy
<
0
,
y
i
must be stored in
y
1
-
n
-
i
×
incy
, for
i
=
1
,
2
,
…
,
n
.
Intermediate elements of
y
are not referenced.
8:
incy
– Integer
Input
On entry
: the increment in the subscripts of
y
between successive elements of
y
.
6
Error Indicators and Warnings
None.
7
Accuracy
Not applicable.
8
Parallelism and Performance
f06faf
is not threaded in any implementation.
9
Further Comments
None.
10
Example
None.
f06faf (PDF version)
F06 (blas) Chapter Contents
F06 (blas) Chapter Introduction
NAG Library Manual
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017