SpiceDouble vtmvg_c ( const void * v1,
const void * matrix,
const void * v2,
SpiceInt nrow,
SpiceInt ncol )
Multiply the transpose of a n-dimensional column vector,
a nxm matrix, and a m-dimensional column vector.
None.
MATRIX
VECTOR
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I n-dimensional double precision column vector.
matrix I nxm double precision matrix.
v2 I m-dimensional double porecision column vector.
nrow I Number of rows in matrix (number of rows in v1.)
ncol I Number of columns in matrix (number of rows in
v2.)
The function returns the result of (v1**t * matrix * v2 ).
v1 is an n-dimensional double precision vector.
matrix is an n x m double precision matrix.
v2 is an m-dimensional double precision vector.
nrow is the number of rows in matrix. this is also
equivalent to the number of rows in the vector v1.
ncol is the number of columns in matrix. this is also
equivalent to the number of rows in the vector v2.
The function returns the double precision value of the equation
(v1**t * matrix * v2 ).
Notice that vtmvg_c is actually the dot product of the vector
resulting from multiplying the transpose of V1 and MATRIX and the
vector V2.
None.
Error free.
None.
This routine implements the following vector/matrix/vector
multiplication:
T
vtmvg_c = [ V1 ] | | | |
| MATRIX | |V2|
| | | |
by calculating over all values of the indices k and l from 1 to
nrow and 1 to ncol, respectively, the expression
vtmvg_c = Summation of ( v1(k)*matrix(k,l)*v2(l) ) .
v1 is a column vector which becomes a row vector when transposed.
v2 is a column vector.
No check performed to determine whether floating point
overflow has occurred.
If v1 = | 1.0 | matrix = | 2.0 0.0 | v2 = | 1.0 |
| | | | | |
| 2.0 | | 1.0 2.0 | | 2.0 |
| | | |
| 3.0 | | 1.0 1.0 |
nrow = 3
ncol = 2
Then the value of the function is 21.0.
Since no error detection or recovery is implemented, the
programmer is required to insure that the inputs to this routine
are both valid and within the proper range.
None.
W.M. Owen (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.0.0, 1-JUL-1999
n-dimensional vector_transpose times matrix times vector
Link to routine vtmvg_c source file vtmvg_c.c
|