[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/extragear/kde3/graphics/kst/src/plugins/fits
From: Andrew Walker <arwalker () sumusltd ! com>
Date: 2010-01-25 18:49:28
Message-ID: 1264445368.025883.15680.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1080160 by arwalker:
cleanup white space
M +17 -18 linear_weighted.h
M +4 -4 polynomial_weighted/kstfit_polynomial_weighted.cpp
--- branches/extragear/kde3/graphics/kst/src/plugins/fits/linear_weighted.h \
#1080159:1080160 @@ -48,7 +48,7 @@
int iStatus = 0;
int iLength;
int iReturn = -1;
-
+
if (inArrayLens[YVALUES] >= 2 &&
inArrayLens[XVALUES] >= 2 &&
inArrayLens[WEIGHTS] >= 2) {
@@ -56,7 +56,7 @@
if( inArrayLens[XVALUES] > iLength ) {
iLength = inArrayLens[XVALUES];
}
-
+
//
// first do some sanity checks...
//
@@ -72,7 +72,7 @@
pResult[i] = outArrays[i];
}
}
-
+
//
// now the output parameter array...
//
@@ -83,7 +83,7 @@
pResult[i] = outArrays[i];
}
}
-
+
//
// now the covariance matrix...
//
@@ -93,8 +93,8 @@
} else {
pResult[i] = outArrays[i];
}
- }
-
+ }
+
if( pResult[0] != NULL &&
pResult[1] != NULL &&
pResult[2] != NULL &&
@@ -112,7 +112,7 @@
outArrays[i] = pResult[i];
outArrayLens[i] = iNumParams * iNumParams;
}
-
+
//
// create the matrices and vectors...
//
@@ -128,7 +128,7 @@
if( pWork != NULL ) {
pVectorWeights = gsl_vector_alloc( iLength );
if( pVectorWeights != NULL ) {
-
+
//
// fill in the matrices and vectors...
//
@@ -140,8 +140,7 @@
gsl_matrix_set( pMatrixX, i, j, dX );
}
}
-
-
+
iStatus = gsl_multifit_wlinear( pMatrixX,
pVectorWeights,
pVectorY,
@@ -162,33 +161,33 @@
outArrays[YFIT][i] = dY;
outArrays[YRESIDUALS][i] = interpolate(i, iLength, \
inArrays[YVALUES], inArrayLens[YVALUES]) - dY; }
-
+
for( i=0; i<iNumParams; i++ ) {
outArrays[PARAMETERS][i] = gsl_vector_get( \
pVectorParameters, i ); for( j=0; j<iNumParams; j++ ) {
outArrays[COVARIANCE][(i*iNumParams)+j] = gsl_matrix_get( \
pMatrixCovariance, i, j ); }
}
-
+
outScalars[0] = dChiSq / ( (double)iLength - \
(double)iNumParams );
-
+
iReturn = 0;
}
gsl_vector_free( pVectorWeights );
}
gsl_multifit_linear_free( pWork );
}
- gsl_matrix_free( pMatrixCovariance );
+ gsl_matrix_free( pMatrixCovariance );
}
- gsl_vector_free( pVectorParameters );
+ gsl_vector_free( pVectorParameters );
}
- gsl_vector_free( pVectorY );
+ gsl_vector_free( pVectorY );
}
- gsl_matrix_free( pMatrixX );
+ gsl_matrix_free( pMatrixX );
}
}
}
}
-
+
return iReturn;
}
--- branches/extragear/kde3/graphics/kst/src/plugins/fits/polynomial_weighted/kstfit_polynomial_weighted.cpp \
#1080159:1080160 @@ -18,9 +18,9 @@
double calculate_matrix_entry( double dX, int iPos ) {
double dY;
-
+
dY = pow( dX, (double)iPos );
-
+
return dY;
}
@@ -41,14 +41,14 @@
{
int iRetVal = -1;
int iNumParams;
-
+
iNumParams = 1 + (int)floor( inScalars[0] );
if( iNumParams > 0 ) {
iRetVal = kstfit_linear_weighted( inArrays, inArrayLens,
outArrays, outArrayLens,
outScalars, iNumParams );
}
-
+
return iRetVal;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic