[cig-commits] r4834 - in long/3D/Gale/trunk/src/StGermain: .
Discretisation/Geometry/src
walter at geodynamics.org
walter at geodynamics.org
Wed Oct 11 13:46:32 PDT 2006
Author: walter
Date: 2006-10-11 13:46:32 -0700 (Wed, 11 Oct 2006)
New Revision: 4834
Modified:
long/3D/Gale/trunk/src/StGermain/
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.h
Log:
r2891 at earth: boo | 2006-10-11 13:42:33 -0700
r2807 at earth (orig r3795): KathleenHumble | 2006-09-13 18:14:44 -0700
Broke up the function:
NonSquareMatrix_MatrixVectorMultiplication
so that it is now a wrapper around
another function:
NonSquareMatrix_CumulativeMatrixVectorMultiplication
as the original function assumed that the
solutionVector was initialised. This allowed
the multiplication to be added to the solution vector
but created spurious errors when
the function was assumed to be a standard
vector -matrix multiplication function, with
uninitialised solutionVector.
The new wrapper initialises the solutionVector
before passing it to the original function
Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
- 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2890
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3794
+ 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2891
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3795
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.c 2006-10-11 20:46:29 UTC (rev 4833)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.c 2006-10-11 20:46:32 UTC (rev 4834)
@@ -607,8 +607,19 @@
dimensions of the matrix and the row dimension. Columns In Matrix A = Rows In Vector B
resultMatrix_ij = AMatrix_ij x BVector_j */
void NonSquareMatrix_MatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
- double* BVec, int rowsInB,
- double* resultVector ) {
+ double* BVec, int rowsInB,double* resultVector ) {
+ //This assumes the resultVector is of the correct length.
+ memset(resultVector,0,sizeof(double)* rowsInA);
+ NonSquareMatrix_CumulativeMatrixVectorMultiplication( AMatrix, rowsInA, colsInA,
+ BVec, rowsInB, resultVector);
+}
+/**This function multiplies a M x N matrices by a N vector, and then adds this result
+to the passed in 'solution Vector'. It requires the column
+ dimensions of the matrix and the row dimension. Columns In Matrix A = Rows In Vector B
+ resultMatrix_ij = AMatrix_ij x BVector_j
+*/
+void NonSquareMatrix_CumulativeMatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
+ double* BVec, int rowsInB, double* resultVector ) {
int row_I, col_I; // counters through matrix rows and columns respectively
Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
Journal_Firewall( ( colsInA == rowsInB ), error,
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.h 2006-10-11 20:46:29 UTC (rev 4833)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/TensorMultMath.h 2006-10-11 20:46:32 UTC (rev 4834)
@@ -86,8 +86,9 @@
double** resultMatrix );
void NonSquareMatrix_MatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
- double* BVec, int rowsInB,
- double* resultVector );
+ double* BVec, int rowsInB, double* resultVector );
+void NonSquareMatrix_CumulativeMatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
+ double* BVec, int rowsInB, double* resultVector );
/** Print a named NonSquareMatrix */
#define Journal_PrintNonSquareMatrix(stream, matrix, rowDim, colDim) \
do { \
More information about the cig-commits
mailing list