Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_mxm

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_MXM calculates the product of two 3x3 matrices
   using the classic definition of matrix multiplication,
   returning a 3x3 matrix as output.

I/O


   Given:

      m1       an arbitrary 3x3 double precision matrix.

               help, m1
                  DOUBLE = Array[3,3]

      m2       an arbitrary 3x3 double precision matrix.

               help, m2
                  DOUBLE = Array[3,3]

   the call:

      cspice_mxm, m1, m2, mout

   returns:

      mout     a 3x3 double precision matrix.

               help, mout
                  DOUBLE = Array[3,3]

               `mout' is the product m1*m2.

Parameters


   None.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   1) Given two 3x3 double precision matrices, compute their
      product.


      Example code begins here.


      PRO mxm_ex1

         ;;
         ;; Define `m1' and `m2'.
         ;;
         m1 = [ [  1.D0,  1.D0,  0.D0 ],                                     $
                [ -1.D0,  1.D0,  0.D0 ],                                     $
                [  0.D0,  0.D0,  1.D0 ] ]

         m2 = [ [ 1.D0,   0.D0,  0.D0 ],                                     $
                [ 0.D0,   1.D0,  1.D0 ],                                     $
                [ 0.D0,  -1.D0,  1.D0 ] ]

         ;;
         ;; Compute `m1' times `m2'.
         ;;
         cspice_mxm, m1, m2, mout

         print, format='(A)', 'M1:'
         print, format='(3F16.7)', m1

         print
         print, format='(A)', 'M2:'
         print, format='(3F16.7)', m2

         print
         print, format='(A)', 'M1 times M2:'
         print, format='(3F16.7)', mout

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      M1:
             1.0000000       1.0000000       0.0000000
            -1.0000000       1.0000000       0.0000000
             0.0000000       0.0000000       1.0000000

      M2:
             1.0000000       0.0000000       0.0000000
             0.0000000       1.0000000       1.0000000
             0.0000000      -1.0000000       1.0000000

      M1 times M2:
             1.0000000       1.0000000       1.0000000
            -1.0000000       1.0000000       1.0000000
             0.0000000      -1.0000000       1.0000000


Particulars


   The code reflects precisely the following mathematical expression

      For each value of the subscripts `i' and `j' from 0 to 2:

                        2
                     .-----
                      \
         mout[i,j] =   )  m1[i,k] * m2[k,j]
                      /
                     '-----
                       k=0

   Native IDL code to calculate the same matrix result:

      c = a ## b

Exceptions


   1)  If any of the input arguments, `m1' or `m2', is undefined, an
       error is signaled by the IDL error handling system.

   2)  If any of the input arguments, `m1' or `m2', is not of the
       expected type, or it does not have the expected dimensions and
       size, an error is signaled by the Icy interface.

   3)  If the output argument `mout' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.3, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added complete
       code example based on existing example.

       Changed the argument names in order to match those given within the
       IDL bridge code.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

   -Icy Version 1.0.2, 13-JUN-2011 (EDW)

       Edits to comply with NAIF standard for Icy headers.

   -Icy Version 1.0.1, 09-DEC-2005 (EDW)

       Added -Examples section.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   matrix times matrix 3x3_case



Fri Dec 31 18:43:06 2021