00001 /* 00002 * Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with with program; see the file COPYING. If not, write to the 00016 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00017 * MA 02111-1307 USA 00018 */ 00019 00020 /* <lalVerbatim file="LALMatrixTransformCV"> 00021 Author: Sathyaprakash, B. S. 00022 $Id: LALMatrixTransform.c,v 1.10 2007/06/08 14:41:42 bema Exp $ 00023 </lalVerbatim> */ 00024 00025 /* <lalLaTeX> 00026 00027 \subsection{Module \texttt{LALMatrixTransform.c}} 00028 A routine to transform a second rank tensor under a given transformation. 00029 00030 \subsubsection*{Prototypes} 00031 \vspace{0.1in} 00032 \input{LALMatrixTransformCP} 00033 \idx{LALMatrixTransform()} 00034 \begin{itemize} 00035 \item \texttt{n,} Input, dimension of the matrix (currently, and possibly always, only 3) 00036 \item \texttt{data1,} Input, transformation matrix 00037 \item \texttt{data2,} Input, matrix whose transformation is required 00038 \item \texttt{data3,} Output, transformed matrix 00039 \end{itemize} 00040 00041 \subsubsection*{Description} 00042 Given the matrix of transformation in \texttt{data1} and a second rank tensor 00043 \texttt{data2}, this routine computes the transformed tensor in \texttt{data3}. 00044 00045 \subsubsection*{Algorithm} 00046 $$ C_{ij} = A_{im} A_{jl} B_{ml}.$$ 00047 00048 \subsubsection*{Uses} 00049 None. 00050 00051 \subsubsection*{Notes} 00052 00053 \vfill{\footnotesize\input{LALMatrixTransformCV}} 00054 00055 </lalLaTeX> */ 00056 00057 00058 00059 #include <lal/LALInspiralBank.h> 00060 00061 NRCSID(LALMATRIXTRANSFORMC, "$Id: LALMatrixTransform.c,v 1.10 2007/06/08 14:41:42 bema Exp $"); 00062 00063 /* <lalVerbatim file="LALMatrixTransformCP"> */ 00064 00065 void LALMatrixTransform (LALStatus *status, 00066 INT4 n, 00067 REAL8 **data1, 00068 REAL8 **data2, 00069 REAL8 **data3) 00070 { /* </lalVerbatim> */ 00071 00072 INT4 i, j, l, m; 00073 00074 INITSTATUS(status, "LALMatrixTransform", LALMATRIXTRANSFORMC); 00075 ATTATCHSTATUSPTR(status); 00076 ASSERT (data1, status, LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL); 00077 ASSERT (data2, status, LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL); 00078 ASSERT (data3, status, LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL); 00079 00080 for (i=0; i<n; i++) { 00081 for (j=0; j<n; j++) { 00082 data3[i][j] = 0.0; 00083 for (l=0; l<n; l++) { 00084 for (m=0; m<n; m++) { 00085 data3[i][j] += data1[i][m]*data2[m][l]*data1[j][l]; 00086 }} 00087 }} 00088 DETATCHSTATUSPTR(status); 00089 RETURN(status); 00090 }
1.5.2