Changeset 9ce41c6 in sasview for sansmodels
- Timestamp:
- Sep 9, 2009 7:06:42 PM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 3b865c1
- Parents:
- d2caa18
- Location:
- sansmodels/src/sans/models
- Files:
-
- 8 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/BaseComponent.py
r5eb9154 r9ce41c6 85 85 above, numpy arrays must be created the following way: 86 86 87 qx_prime = numpy.reshape(qx, [ 3,1])88 qy_prime = numpy.reshape(qy, [ 1,3])87 qx_prime = numpy.reshape(qx, [1,3]) 88 qy_prime = numpy.reshape(qy, [3,1]) 89 89 90 90 The method is then called the following way: … … 106 106 107 107 # Create output array 108 iq_array = numpy.zeros([qx.shape[ 0], qy.shape[1]])108 iq_array = numpy.zeros([qx.shape[1], qy.shape[0]]) 109 109 110 for i in range(qx.shape[0]):111 for j in range(qy.shape[1]):112 iq_array[ i][j] = self.runXY([qx[i][0],qy[0][j]])110 for j in range(qy.shape[0]): 111 for i in range(qx.shape[1]): 112 iq_array[j][i] = self.runXY([qx[0][i],qy[j][0]]) 113 113 return iq_array 114 114 -
sansmodels/src/sans/models/BinaryHSModel.py
r5eb9154 r9ce41c6 17 17 18 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryH S.h19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHs.h 20 20 AND RE-RUN THE GENERATOR SCRIPT 21 21 … … 28 28 class BinaryHSModel(CBinaryHSModel, BaseComponent): 29 29 """ Class that evaluates a BinaryHSModel model. 30 This file was auto-generated from ..\c_extensions\binaryH S.h.30 This file was auto-generated from ..\c_extensions\binaryHs.h. 31 31 Refer to that file and the structure it contains 32 32 for details of the model. -
sansmodels/src/sans/models/FractalModel.py
r1ed3834 r9ce41c6 30 30 """ Initialization """ 31 31 32 # Initialize BaseComponent first, then sphere32 # Initialize BaseComponent first, then fractal 33 33 BaseComponent.__init__(self) 34 34 -
sansmodels/src/sans/models/HardsphereStructure.py
r5eb9154 r9ce41c6 17 17 18 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\ hardsphere.h19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\Hardsphere.h 20 20 AND RE-RUN THE GENERATOR SCRIPT 21 21 … … 28 28 class HardsphereStructure(CHardsphereStructure, BaseComponent): 29 29 """ Class that evaluates a HardsphereStructure model. 30 This file was auto-generated from ..\c_extensions\ hardsphere.h.30 This file was auto-generated from ..\c_extensions\Hardsphere.h. 31 31 Refer to that file and the structure it contains 32 32 for details of the model. -
sansmodels/src/sans/models/LogNormal.py
r5eb9154 r9ce41c6 17 17 18 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\log normal.h19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\logNormal.h 20 20 AND RE-RUN THE GENERATOR SCRIPT 21 21 … … 28 28 class LogNormal(CLogNormal, BaseComponent): 29 29 """ Class that evaluates a LogNormal model. 30 This file was auto-generated from ..\c_extensions\log normal.h.30 This file was auto-generated from ..\c_extensions\logNormal.h. 31 31 Refer to that file and the structure it contains 32 32 for details of the model. -
sansmodels/src/sans/models/PorodModel.py
r1ed3834 r9ce41c6 11 11 """ Class that evaluates a Porod model. 12 12 13 I(q) = scale/q^4 13 I(q) = scale/q^4 +background 14 14 15 15 """ … … 29 29 self.params['background'] = 0.0 30 30 self.description= """The Porod model. 31 I(q) = scale/q^4 """31 I(q) = scale/q^4 +background""" 32 32 33 33 ## Parameter details [units, min, max] -
sansmodels/src/sans/models/PowerLawModel.py
r1ed3834 r9ce41c6 36 36 self.params['background'] = 0.0 37 37 self.description=""" The Power_Law model. 38 F(x) = scale* ( |x|)^(-m) + bkd38 F(x) = scale* (x)^(-m) + bkd 39 39 40 40 The model has three parameters: … … 51 51 def _PowerLaw(self, x): 52 52 """ 53 Evaluate F(x) = scale* ( |x|)^(-m) + bkd53 Evaluate F(x) = scale* (x)^(-m) + bkd 54 54 55 55 """ -
sansmodels/src/sans/models/SquareWellStructure.py
r5eb9154 r9ce41c6 17 17 18 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\ squarewell.h19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\SquareWell.h 20 20 AND RE-RUN THE GENERATOR SCRIPT 21 21 … … 28 28 class SquareWellStructure(CSquareWellStructure, BaseComponent): 29 29 """ Class that evaluates a SquareWellStructure model. 30 This file was auto-generated from ..\c_extensions\ squarewell.h.30 This file was auto-generated from ..\c_extensions\SquareWell.h. 31 31 Refer to that file and the structure it contains 32 32 for details of the model. -
sansmodels/src/sans/models/StickyHSStructure.py
r5eb9154 r9ce41c6 17 17 18 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\ stickyHS.h19 DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\StickyHS.h 20 20 AND RE-RUN THE GENERATOR SCRIPT 21 21 … … 28 28 class StickyHSStructure(CStickyHSStructure, BaseComponent): 29 29 """ Class that evaluates a StickyHSStructure model. 30 This file was auto-generated from ..\c_extensions\ stickyHS.h.30 This file was auto-generated from ..\c_extensions\StickyHS.h. 31 31 Refer to that file and the structure it contains 32 32 for details of the model. -
sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp
r5eb9154 r9ce41c6 18 18 * 19 19 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 20 * DO NOT MODIFY THIS FILE, MODIFY binaryH S.h20 * DO NOT MODIFY THIS FILE, MODIFY binaryHs.h 21 21 * AND RE-RUN THE GENERATOR SCRIPT 22 22 * … … 33 33 #include <math.h> 34 34 #include <time.h> 35 #include "binaryH S.h"35 #include "binaryHs.h" 36 36 } 37 37 … … 192 192 if (PyArray_Check(x) && PyArray_Check(y)) { 193 193 194 x_len = dims[1]= x->dimensions[ 0];195 y_len = dims[0]= y->dimensions[ 1];194 x_len = dims[1]= x->dimensions[1]; 195 y_len = dims[0]= y->dimensions[0]; 196 196 197 197 // Make a new double matrix of same dims … … 206 206 for ( j=0; j< y_len; j++) { 207 207 for ( i=0; i< x_len; i++) { 208 double x_value = *(double *)(x->data + i*x->strides[ 0]);209 double y_value = *(double *)(y->data + j*y->strides[ 1]);208 double x_value = *(double *)(x->data + i*x->strides[1]); 209 double y_value = *(double *)(y->data + j*y->strides[0]); 210 210 double *result_value = (double *)(result->data + 211 211 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp
r5eb9154 r9ce41c6 192 192 if (PyArray_Check(x) && PyArray_Check(y)) { 193 193 194 x_len = dims[1]= x->dimensions[ 0];195 y_len = dims[0]= y->dimensions[ 1];194 x_len = dims[1]= x->dimensions[1]; 195 y_len = dims[0]= y->dimensions[0]; 196 196 197 197 // Make a new double matrix of same dims … … 206 206 for ( j=0; j< y_len; j++) { 207 207 for ( i=0; i< x_len; i++) { 208 double x_value = *(double *)(x->data + i*x->strides[ 0]);209 double y_value = *(double *)(y->data + j*y->strides[ 1]);208 double x_value = *(double *)(x->data + i*x->strides[1]); 209 double y_value = *(double *)(y->data + j*y->strides[0]); 210 210 double *result_value = (double *)(result->data + 211 211 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp
r5eb9154 r9ce41c6 203 203 if (PyArray_Check(x) && PyArray_Check(y)) { 204 204 205 x_len = dims[1]= x->dimensions[ 0];206 y_len = dims[0]= y->dimensions[ 1];205 x_len = dims[1]= x->dimensions[1]; 206 y_len = dims[0]= y->dimensions[0]; 207 207 208 208 // Make a new double matrix of same dims … … 217 217 for ( j=0; j< y_len; j++) { 218 218 for ( i=0; i< x_len; i++) { 219 double x_value = *(double *)(x->data + i*x->strides[ 0]);220 double y_value = *(double *)(y->data + j*y->strides[ 1]);219 double x_value = *(double *)(x->data + i*x->strides[1]); 220 double y_value = *(double *)(y->data + j*y->strides[0]); 221 221 double *result_value = (double *)(result->data + 222 222 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp
r5eb9154 r9ce41c6 206 206 if (PyArray_Check(x) && PyArray_Check(y)) { 207 207 208 x_len = dims[1]= x->dimensions[ 0];209 y_len = dims[0]= y->dimensions[ 1];208 x_len = dims[1]= x->dimensions[1]; 209 y_len = dims[0]= y->dimensions[0]; 210 210 211 211 // Make a new double matrix of same dims … … 220 220 for ( j=0; j< y_len; j++) { 221 221 for ( i=0; i< x_len; i++) { 222 double x_value = *(double *)(x->data + i*x->strides[ 0]);223 double y_value = *(double *)(y->data + j*y->strides[ 1]);222 double x_value = *(double *)(x->data + i*x->strides[1]); 223 double y_value = *(double *)(y->data + j*y->strides[0]); 224 224 double *result_value = (double *)(result->data + 225 225 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CCoreShellModel.cpp
r5eb9154 r9ce41c6 191 191 if (PyArray_Check(x) && PyArray_Check(y)) { 192 192 193 x_len = dims[1]= x->dimensions[ 0];194 y_len = dims[0]= y->dimensions[ 1];193 x_len = dims[1]= x->dimensions[1]; 194 y_len = dims[0]= y->dimensions[0]; 195 195 196 196 // Make a new double matrix of same dims … … 205 205 for ( j=0; j< y_len; j++) { 206 206 for ( i=0; i< x_len; i++) { 207 double x_value = *(double *)(x->data + i*x->strides[ 0]);208 double y_value = *(double *)(y->data + j*y->strides[ 1]);207 double x_value = *(double *)(x->data + i*x->strides[1]); 208 double y_value = *(double *)(y->data + j*y->strides[0]); 209 209 double *result_value = (double *)(result->data + 210 210 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CCylinderModel.cpp
r5eb9154 r9ce41c6 197 197 if (PyArray_Check(x) && PyArray_Check(y)) { 198 198 199 x_len = dims[1]= x->dimensions[ 0];200 y_len = dims[0]= y->dimensions[ 1];199 x_len = dims[1]= x->dimensions[1]; 200 y_len = dims[0]= y->dimensions[0]; 201 201 202 202 // Make a new double matrix of same dims … … 211 211 for ( j=0; j< y_len; j++) { 212 212 for ( i=0; i< x_len; i++) { 213 double x_value = *(double *)(x->data + i*x->strides[ 0]);214 double y_value = *(double *)(y->data + j*y->strides[ 1]);213 double x_value = *(double *)(x->data + i*x->strides[1]); 214 double y_value = *(double *)(y->data + j*y->strides[0]); 215 215 double *result_value = (double *)(result->data + 216 216 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp
r5eb9154 r9ce41c6 186 186 if (PyArray_Check(x) && PyArray_Check(y)) { 187 187 188 x_len = dims[1]= x->dimensions[ 0];189 y_len = dims[0]= y->dimensions[ 1];188 x_len = dims[1]= x->dimensions[1]; 189 y_len = dims[0]= y->dimensions[0]; 190 190 191 191 // Make a new double matrix of same dims … … 200 200 for ( j=0; j< y_len; j++) { 201 201 for ( i=0; i< x_len; i++) { 202 double x_value = *(double *)(x->data + i*x->strides[ 0]);203 double y_value = *(double *)(y->data + j*y->strides[ 1]);202 double x_value = *(double *)(x->data + i*x->strides[1]); 203 double y_value = *(double *)(y->data + j*y->strides[0]); 204 204 double *result_value = (double *)(result->data + 205 205 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp
r5eb9154 r9ce41c6 186 186 if (PyArray_Check(x) && PyArray_Check(y)) { 187 187 188 x_len = dims[1]= x->dimensions[ 0];189 y_len = dims[0]= y->dimensions[ 1];188 x_len = dims[1]= x->dimensions[1]; 189 y_len = dims[0]= y->dimensions[0]; 190 190 191 191 // Make a new double matrix of same dims … … 200 200 for ( j=0; j< y_len; j++) { 201 201 for ( i=0; i< x_len; i++) { 202 double x_value = *(double *)(x->data + i*x->strides[ 0]);203 double y_value = *(double *)(y->data + j*y->strides[ 1]);202 double x_value = *(double *)(x->data + i*x->strides[1]); 203 double y_value = *(double *)(y->data + j*y->strides[0]); 204 204 double *result_value = (double *)(result->data + 205 205 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp
r5eb9154 r9ce41c6 197 197 if (PyArray_Check(x) && PyArray_Check(y)) { 198 198 199 x_len = dims[1]= x->dimensions[ 0];200 y_len = dims[0]= y->dimensions[ 1];199 x_len = dims[1]= x->dimensions[1]; 200 y_len = dims[0]= y->dimensions[0]; 201 201 202 202 // Make a new double matrix of same dims … … 211 211 for ( j=0; j< y_len; j++) { 212 212 for ( i=0; i< x_len; i++) { 213 double x_value = *(double *)(x->data + i*x->strides[ 0]);214 double y_value = *(double *)(y->data + j*y->strides[ 1]);213 double x_value = *(double *)(x->data + i*x->strides[1]); 214 double y_value = *(double *)(y->data + j*y->strides[0]); 215 215 double *result_value = (double *)(result->data + 216 216 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp
r5eb9154 r9ce41c6 205 205 if (PyArray_Check(x) && PyArray_Check(y)) { 206 206 207 x_len = dims[1]= x->dimensions[ 0];208 y_len = dims[0]= y->dimensions[ 1];207 x_len = dims[1]= x->dimensions[1]; 208 y_len = dims[0]= y->dimensions[0]; 209 209 210 210 // Make a new double matrix of same dims … … 219 219 for ( j=0; j< y_len; j++) { 220 220 for ( i=0; i< x_len; i++) { 221 double x_value = *(double *)(x->data + i*x->strides[ 0]);222 double y_value = *(double *)(y->data + j*y->strides[ 1]);221 double x_value = *(double *)(x->data + i*x->strides[1]); 222 double y_value = *(double *)(y->data + j*y->strides[0]); 223 223 double *result_value = (double *)(result->data + 224 224 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp
r5eb9154 r9ce41c6 193 193 if (PyArray_Check(x) && PyArray_Check(y)) { 194 194 195 x_len = dims[1]= x->dimensions[ 0];196 y_len = dims[0]= y->dimensions[ 1];195 x_len = dims[1]= x->dimensions[1]; 196 y_len = dims[0]= y->dimensions[0]; 197 197 198 198 // Make a new double matrix of same dims … … 207 207 for ( j=0; j< y_len; j++) { 208 208 for ( i=0; i< x_len; i++) { 209 double x_value = *(double *)(x->data + i*x->strides[ 0]);210 double y_value = *(double *)(y->data + j*y->strides[ 1]);209 double x_value = *(double *)(x->data + i*x->strides[1]); 210 double y_value = *(double *)(y->data + j*y->strides[0]); 211 211 double *result_value = (double *)(result->data + 212 212 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CGaussian.cpp
r5eb9154 r9ce41c6 181 181 if (PyArray_Check(x) && PyArray_Check(y)) { 182 182 183 x_len = dims[1]= x->dimensions[ 0];184 y_len = dims[0]= y->dimensions[ 1];183 x_len = dims[1]= x->dimensions[1]; 184 y_len = dims[0]= y->dimensions[0]; 185 185 186 186 // Make a new double matrix of same dims … … 195 195 for ( j=0; j< y_len; j++) { 196 196 for ( i=0; i< x_len; i++) { 197 double x_value = *(double *)(x->data + i*x->strides[ 0]);198 double y_value = *(double *)(y->data + j*y->strides[ 1]);197 double x_value = *(double *)(x->data + i*x->strides[1]); 198 double y_value = *(double *)(y->data + j*y->strides[0]); 199 199 double *result_value = (double *)(result->data + 200 200 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp
r5eb9154 r9ce41c6 18 18 * 19 19 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 20 * DO NOT MODIFY THIS FILE, MODIFY hardsphere.h20 * DO NOT MODIFY THIS FILE, MODIFY Hardsphere.h 21 21 * AND RE-RUN THE GENERATOR SCRIPT 22 22 * … … 33 33 #include <math.h> 34 34 #include <time.h> 35 #include " hardsphere.h"35 #include "Hardsphere.h" 36 36 } 37 37 … … 183 183 if (PyArray_Check(x) && PyArray_Check(y)) { 184 184 185 x_len = dims[1]= x->dimensions[ 0];186 y_len = dims[0]= y->dimensions[ 1];185 x_len = dims[1]= x->dimensions[1]; 186 y_len = dims[0]= y->dimensions[0]; 187 187 188 188 // Make a new double matrix of same dims … … 197 197 for ( j=0; j< y_len; j++) { 198 198 for ( i=0; i< x_len; i++) { 199 double x_value = *(double *)(x->data + i*x->strides[ 0]);200 double y_value = *(double *)(y->data + j*y->strides[ 1]);199 double x_value = *(double *)(x->data + i*x->strides[1]); 200 double y_value = *(double *)(y->data + j*y->strides[0]); 201 201 double *result_value = (double *)(result->data + 202 202 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp
r42ae1d9 r9ce41c6 187 187 if (PyArray_Check(x) && PyArray_Check(y)) { 188 188 189 x_len = dims[1]= x->dimensions[ 0];190 y_len = dims[0]= y->dimensions[ 1];189 x_len = dims[1]= x->dimensions[1]; 190 y_len = dims[0]= y->dimensions[0]; 191 191 192 192 // Make a new double matrix of same dims … … 201 201 for ( j=0; j< y_len; j++) { 202 202 for ( i=0; i< x_len; i++) { 203 double x_value = *(double *)(x->data + i*x->strides[ 0]);204 double y_value = *(double *)(y->data + j*y->strides[ 1]);203 double x_value = *(double *)(x->data + i*x->strides[1]); 204 double y_value = *(double *)(y->data + j*y->strides[0]); 205 205 double *result_value = (double *)(result->data + 206 206 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp
r5eb9154 r9ce41c6 201 201 if (PyArray_Check(x) && PyArray_Check(y)) { 202 202 203 x_len = dims[1]= x->dimensions[ 0];204 y_len = dims[0]= y->dimensions[ 1];203 x_len = dims[1]= x->dimensions[1]; 204 y_len = dims[0]= y->dimensions[0]; 205 205 206 206 // Make a new double matrix of same dims … … 215 215 for ( j=0; j< y_len; j++) { 216 216 for ( i=0; i< x_len; i++) { 217 double x_value = *(double *)(x->data + i*x->strides[ 0]);218 double y_value = *(double *)(y->data + j*y->strides[ 1]);217 double x_value = *(double *)(x->data + i*x->strides[1]); 218 double y_value = *(double *)(y->data + j*y->strides[0]); 219 219 double *result_value = (double *)(result->data + 220 220 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp
r5eb9154 r9ce41c6 191 191 if (PyArray_Check(x) && PyArray_Check(y)) { 192 192 193 x_len = dims[1]= x->dimensions[ 0];194 y_len = dims[0]= y->dimensions[ 1];193 x_len = dims[1]= x->dimensions[1]; 194 y_len = dims[0]= y->dimensions[0]; 195 195 196 196 // Make a new double matrix of same dims … … 205 205 for ( j=0; j< y_len; j++) { 206 206 for ( i=0; i< x_len; i++) { 207 double x_value = *(double *)(x->data + i*x->strides[ 0]);208 double y_value = *(double *)(y->data + j*y->strides[ 1]);207 double x_value = *(double *)(x->data + i*x->strides[1]); 208 double y_value = *(double *)(y->data + j*y->strides[0]); 209 209 double *result_value = (double *)(result->data + 210 210 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CLamellarModel.cpp
r5eb9154 r9ce41c6 186 186 if (PyArray_Check(x) && PyArray_Check(y)) { 187 187 188 x_len = dims[1]= x->dimensions[ 0];189 y_len = dims[0]= y->dimensions[ 1];188 x_len = dims[1]= x->dimensions[1]; 189 y_len = dims[0]= y->dimensions[0]; 190 190 191 191 // Make a new double matrix of same dims … … 200 200 for ( j=0; j< y_len; j++) { 201 201 for ( i=0; i< x_len; i++) { 202 double x_value = *(double *)(x->data + i*x->strides[ 0]);203 double y_value = *(double *)(y->data + j*y->strides[ 1]);202 double x_value = *(double *)(x->data + i*x->strides[1]); 203 double y_value = *(double *)(y->data + j*y->strides[0]); 204 204 double *result_value = (double *)(result->data + 205 205 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp
r5eb9154 r9ce41c6 197 197 if (PyArray_Check(x) && PyArray_Check(y)) { 198 198 199 x_len = dims[1]= x->dimensions[ 0];200 y_len = dims[0]= y->dimensions[ 1];199 x_len = dims[1]= x->dimensions[1]; 200 y_len = dims[0]= y->dimensions[0]; 201 201 202 202 // Make a new double matrix of same dims … … 211 211 for ( j=0; j< y_len; j++) { 212 212 for ( i=0; i< x_len; i++) { 213 double x_value = *(double *)(x->data + i*x->strides[ 0]);214 double y_value = *(double *)(y->data + j*y->strides[ 1]);213 double x_value = *(double *)(x->data + i*x->strides[1]); 214 double y_value = *(double *)(y->data + j*y->strides[0]); 215 215 double *result_value = (double *)(result->data + 216 216 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp
r5eb9154 r9ce41c6 191 191 if (PyArray_Check(x) && PyArray_Check(y)) { 192 192 193 x_len = dims[1]= x->dimensions[ 0];194 y_len = dims[0]= y->dimensions[ 1];193 x_len = dims[1]= x->dimensions[1]; 194 y_len = dims[0]= y->dimensions[0]; 195 195 196 196 // Make a new double matrix of same dims … … 205 205 for ( j=0; j< y_len; j++) { 206 206 for ( i=0; i< x_len; i++) { 207 double x_value = *(double *)(x->data + i*x->strides[ 0]);208 double y_value = *(double *)(y->data + j*y->strides[ 1]);207 double x_value = *(double *)(x->data + i*x->strides[1]); 208 double y_value = *(double *)(y->data + j*y->strides[0]); 209 209 double *result_value = (double *)(result->data + 210 210 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CLogNormal.cpp
r5eb9154 r9ce41c6 18 18 * 19 19 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 20 * DO NOT MODIFY THIS FILE, MODIFY log normal.h20 * DO NOT MODIFY THIS FILE, MODIFY logNormal.h 21 21 * AND RE-RUN THE GENERATOR SCRIPT 22 22 * … … 33 33 #include <math.h> 34 34 #include <time.h> 35 #include "log normal.h"35 #include "logNormal.h" 36 36 } 37 37 … … 181 181 if (PyArray_Check(x) && PyArray_Check(y)) { 182 182 183 x_len = dims[1]= x->dimensions[ 0];184 y_len = dims[0]= y->dimensions[ 1];183 x_len = dims[1]= x->dimensions[1]; 184 y_len = dims[0]= y->dimensions[0]; 185 185 186 186 // Make a new double matrix of same dims … … 195 195 for ( j=0; j< y_len; j++) { 196 196 for ( i=0; i< x_len; i++) { 197 double x_value = *(double *)(x->data + i*x->strides[ 0]);198 double y_value = *(double *)(y->data + j*y->strides[ 1]);197 double x_value = *(double *)(x->data + i*x->strides[1]); 198 double y_value = *(double *)(y->data + j*y->strides[0]); 199 199 double *result_value = (double *)(result->data + 200 200 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CLorentzian.cpp
r5eb9154 r9ce41c6 181 181 if (PyArray_Check(x) && PyArray_Check(y)) { 182 182 183 x_len = dims[1]= x->dimensions[ 0];184 y_len = dims[0]= y->dimensions[ 1];183 x_len = dims[1]= x->dimensions[1]; 184 y_len = dims[0]= y->dimensions[0]; 185 185 186 186 // Make a new double matrix of same dims … … 195 195 for ( j=0; j< y_len; j++) { 196 196 for ( i=0; i< x_len; i++) { 197 double x_value = *(double *)(x->data + i*x->strides[ 0]);198 double y_value = *(double *)(y->data + j*y->strides[ 1]);197 double x_value = *(double *)(x->data + i*x->strides[1]); 198 double y_value = *(double *)(y->data + j*y->strides[0]); 199 199 double *result_value = (double *)(result->data + 200 200 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CMultiShellModel.cpp
r5eb9154 r9ce41c6 195 195 if (PyArray_Check(x) && PyArray_Check(y)) { 196 196 197 x_len = dims[1]= x->dimensions[ 0];198 y_len = dims[0]= y->dimensions[ 1];197 x_len = dims[1]= x->dimensions[1]; 198 y_len = dims[0]= y->dimensions[0]; 199 199 200 200 // Make a new double matrix of same dims … … 209 209 for ( j=0; j< y_len; j++) { 210 210 for ( i=0; i< x_len; i++) { 211 double x_value = *(double *)(x->data + i*x->strides[ 0]);212 double y_value = *(double *)(y->data + j*y->strides[ 1]);211 double x_value = *(double *)(x->data + i*x->strides[1]); 212 double y_value = *(double *)(y->data + j*y->strides[0]); 213 213 double *result_value = (double *)(result->data + 214 214 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp
r5eb9154 r9ce41c6 205 205 if (PyArray_Check(x) && PyArray_Check(y)) { 206 206 207 x_len = dims[1]= x->dimensions[ 0];208 y_len = dims[0]= y->dimensions[ 1];207 x_len = dims[1]= x->dimensions[1]; 208 y_len = dims[0]= y->dimensions[0]; 209 209 210 210 // Make a new double matrix of same dims … … 219 219 for ( j=0; j< y_len; j++) { 220 220 for ( i=0; i< x_len; i++) { 221 double x_value = *(double *)(x->data + i*x->strides[ 0]);222 double y_value = *(double *)(y->data + j*y->strides[ 1]);221 double x_value = *(double *)(x->data + i*x->strides[1]); 222 double y_value = *(double *)(y->data + j*y->strides[0]); 223 223 double *result_value = (double *)(result->data + 224 224 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CSchulz.cpp
r5eb9154 r9ce41c6 181 181 if (PyArray_Check(x) && PyArray_Check(y)) { 182 182 183 x_len = dims[1]= x->dimensions[ 0];184 y_len = dims[0]= y->dimensions[ 1];183 x_len = dims[1]= x->dimensions[1]; 184 y_len = dims[0]= y->dimensions[0]; 185 185 186 186 // Make a new double matrix of same dims … … 195 195 for ( j=0; j< y_len; j++) { 196 196 for ( i=0; i< x_len; i++) { 197 double x_value = *(double *)(x->data + i*x->strides[ 0]);198 double y_value = *(double *)(y->data + j*y->strides[ 1]);197 double x_value = *(double *)(x->data + i*x->strides[1]); 198 double y_value = *(double *)(y->data + j*y->strides[0]); 199 199 double *result_value = (double *)(result->data + 200 200 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CSphereModel.cpp
r5eb9154 r9ce41c6 185 185 if (PyArray_Check(x) && PyArray_Check(y)) { 186 186 187 x_len = dims[1]= x->dimensions[ 0];188 y_len = dims[0]= y->dimensions[ 1];187 x_len = dims[1]= x->dimensions[1]; 188 y_len = dims[0]= y->dimensions[0]; 189 189 190 190 // Make a new double matrix of same dims … … 199 199 for ( j=0; j< y_len; j++) { 200 200 for ( i=0; i< x_len; i++) { 201 double x_value = *(double *)(x->data + i*x->strides[ 0]);202 double y_value = *(double *)(y->data + j*y->strides[ 1]);201 double x_value = *(double *)(x->data + i*x->strides[1]); 202 double y_value = *(double *)(y->data + j*y->strides[0]); 203 203 double *result_value = (double *)(result->data + 204 204 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp
r5eb9154 r9ce41c6 18 18 * 19 19 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 20 * DO NOT MODIFY THIS FILE, MODIFY squarewell.h20 * DO NOT MODIFY THIS FILE, MODIFY SquareWell.h 21 21 * AND RE-RUN THE GENERATOR SCRIPT 22 22 * … … 33 33 #include <math.h> 34 34 #include <time.h> 35 #include " squarewell.h"35 #include "SquareWell.h" 36 36 } 37 37 … … 185 185 if (PyArray_Check(x) && PyArray_Check(y)) { 186 186 187 x_len = dims[1]= x->dimensions[ 0];188 y_len = dims[0]= y->dimensions[ 1];187 x_len = dims[1]= x->dimensions[1]; 188 y_len = dims[0]= y->dimensions[0]; 189 189 190 190 // Make a new double matrix of same dims … … 199 199 for ( j=0; j< y_len; j++) { 200 200 for ( i=0; i< x_len; i++) { 201 double x_value = *(double *)(x->data + i*x->strides[ 0]);202 double y_value = *(double *)(y->data + j*y->strides[ 1]);201 double x_value = *(double *)(x->data + i*x->strides[1]); 202 double y_value = *(double *)(y->data + j*y->strides[0]); 203 203 double *result_value = (double *)(result->data + 204 204 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp
r5eb9154 r9ce41c6 205 205 if (PyArray_Check(x) && PyArray_Check(y)) { 206 206 207 x_len = dims[1]= x->dimensions[ 0];208 y_len = dims[0]= y->dimensions[ 1];207 x_len = dims[1]= x->dimensions[1]; 208 y_len = dims[0]= y->dimensions[0]; 209 209 210 210 // Make a new double matrix of same dims … … 219 219 for ( j=0; j< y_len; j++) { 220 220 for ( i=0; i< x_len; i++) { 221 double x_value = *(double *)(x->data + i*x->strides[ 0]);222 double y_value = *(double *)(y->data + j*y->strides[ 1]);221 double x_value = *(double *)(x->data + i*x->strides[1]); 222 double y_value = *(double *)(y->data + j*y->strides[0]); 223 223 double *result_value = (double *)(result->data + 224 224 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp
r5eb9154 r9ce41c6 18 18 * 19 19 * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 20 * DO NOT MODIFY THIS FILE, MODIFY stickyHS.h20 * DO NOT MODIFY THIS FILE, MODIFY StickyHS.h 21 21 * AND RE-RUN THE GENERATOR SCRIPT 22 22 * … … 33 33 #include <math.h> 34 34 #include <time.h> 35 #include " stickyHS.h"35 #include "StickyHS.h" 36 36 } 37 37 … … 185 185 if (PyArray_Check(x) && PyArray_Check(y)) { 186 186 187 x_len = dims[1]= x->dimensions[ 0];188 y_len = dims[0]= y->dimensions[ 1];187 x_len = dims[1]= x->dimensions[1]; 188 y_len = dims[0]= y->dimensions[0]; 189 189 190 190 // Make a new double matrix of same dims … … 199 199 for ( j=0; j< y_len; j++) { 200 200 for ( i=0; i< x_len; i++) { 201 double x_value = *(double *)(x->data + i*x->strides[ 0]);202 double y_value = *(double *)(y->data + j*y->strides[ 1]);201 double x_value = *(double *)(x->data + i*x->strides[1]); 202 double y_value = *(double *)(y->data + j*y->strides[0]); 203 203 double *result_value = (double *)(result->data + 204 204 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
r5eb9154 r9ce41c6 196 196 if (PyArray_Check(x) && PyArray_Check(y)) { 197 197 198 x_len = dims[1]= x->dimensions[ 0];199 y_len = dims[0]= y->dimensions[ 1];198 x_len = dims[1]= x->dimensions[1]; 199 y_len = dims[0]= y->dimensions[0]; 200 200 201 201 // Make a new double matrix of same dims … … 210 210 for ( j=0; j< y_len; j++) { 211 211 for ( i=0; i< x_len; i++) { 212 double x_value = *(double *)(x->data + i*x->strides[ 0]);213 double y_value = *(double *)(y->data + j*y->strides[ 1]);212 double x_value = *(double *)(x->data + i*x->strides[1]); 213 double y_value = *(double *)(y->data + j*y->strides[0]); 214 214 double *result_value = (double *)(result->data + 215 215 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/CVesicleModel.cpp
r5eb9154 r9ce41c6 190 190 if (PyArray_Check(x) && PyArray_Check(y)) { 191 191 192 x_len = dims[1]= x->dimensions[ 0];193 y_len = dims[0]= y->dimensions[ 1];192 x_len = dims[1]= x->dimensions[1]; 193 y_len = dims[0]= y->dimensions[0]; 194 194 195 195 // Make a new double matrix of same dims … … 204 204 for ( j=0; j< y_len; j++) { 205 205 for ( i=0; i< x_len; i++) { 206 double x_value = *(double *)(x->data + i*x->strides[ 0]);207 double y_value = *(double *)(y->data + j*y->strides[ 1]);206 double x_value = *(double *)(x->data + i*x->strides[1]); 207 double y_value = *(double *)(y->data + j*y->strides[0]); 208 208 double *result_value = (double *)(result->data + 209 209 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/c_models/classTemplate.txt
r5eb9154 r9ce41c6 171 171 if (PyArray_Check(x) && PyArray_Check(y)) { 172 172 173 x_len = dims[1]= x->dimensions[ 0];174 y_len = dims[0]= y->dimensions[ 1];173 x_len = dims[1]= x->dimensions[1]; 174 y_len = dims[0]= y->dimensions[0]; 175 175 176 176 // Make a new double matrix of same dims … … 185 185 for ( j=0; j< y_len; j++) { 186 186 for ( i=0; i< x_len; i++) { 187 double x_value = *(double *)(x->data + i*x->strides[ 0]);188 double y_value = *(double *)(y->data + j*y->strides[ 1]);187 double x_value = *(double *)(x->data + i*x->strides[1]); 188 double y_value = *(double *)(y->data + j*y->strides[0]); 189 189 double *result_value = (double *)(result->data + 190 190 j*result->strides[0] + i*result->strides[1]); -
sansmodels/src/sans/models/test/TriaxialEllipsoidModel_avg.txt
r861a2d3 r9ce41c6 22 22 0.21 0.352447 0.35239 23 23 0.22 0.318321 0.319034 24 0.23 0.286235 0.2868325 0.24 0.253276 0.25329626 0.25 0.215823 0.21668927 0.26 0.175608 0.17659628 0.27 0.142021 0.14155529 0.28 0.117013 0.11595530 0.29 0.097918 0.097873531 0.3 0.0857748 0.086936332 0.31 0.0797341 0.081027133 0.32 0.0751376 0.07547534 0.33 0.069484 0.068812635 0.34 0.0623802 0.061429536 0.35 0.0534721 0.053027537 0.36 0.0443903 0.044814338 0.37 0.0376499 0.038491839 0.38 0.0332545 0.033996640 0.39 0.030798 0.031047 -
sansmodels/src/sans/models/test/utest_models.py
r26e4a24 r9ce41c6 24 24 def test1D(self): 25 25 """ Test 1D model for a sphere """ 26 self.assertAlmostEqual(self.comp.run(1.0), 5 6.3878, 4)26 self.assertAlmostEqual(self.comp.run(1.0), 5.6387e-5, 4) 27 27 28 28 def test1D_2(self): 29 29 """ Test 2D model for a sphere """ 30 self.assertAlmostEqual(self.comp.run([1.0, 1.3]), 5 6.3878, 4)30 self.assertAlmostEqual(self.comp.run([1.0, 1.3]), 5.6387e-5, 4) 31 31 32 32 class TestCyl(unittest.TestCase):
Note: See TracChangeset
for help on using the changeset viewer.