Changeset 452 for sans/XOP_Dev/SANSAnalysis/XOP/Cylinder.c
- Timestamp:
- Nov 18, 2008 3:24:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/XOP_Dev/SANSAnalysis/XOP/Cylinder.c
r357 r452 832 832 } 833 833 834 /* SpherocylinderX 835 836 */ 837 int 838 SpherocylinderX(FitParamsPtr p) 839 { 840 double *dp; // Pointer to double precision wave data. 841 float *fp; // Pointer to single precision wave data. 842 double q; //local variables of coefficient wave 843 844 if (p->waveHandle == NIL) { 845 SetNaN64(&p->result); 846 return NON_EXISTENT_WAVE; 847 } 848 849 q= p->x; 850 851 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 852 case NT_FP32: 853 fp= WaveData(p->waveHandle); 854 SetNaN64(&p->result); 855 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 856 case NT_FP64: 857 dp= WaveData(p->waveHandle); 858 p->result = Spherocylinder(dp,q); 859 return 0; 860 default: // We can't handle this wave data type. 861 SetNaN64(&p->result); 862 return REQUIRES_SP_OR_DP_WAVE; 863 } 864 return 0; 865 } 866 867 /* ConvexLensX 868 869 */ 870 int 871 ConvexLensX(FitParamsPtr p) 872 { 873 double *dp; // Pointer to double precision wave data. 874 float *fp; // Pointer to single precision wave data. 875 double q; //local variables of coefficient wave 876 877 if (p->waveHandle == NIL) { 878 SetNaN64(&p->result); 879 return NON_EXISTENT_WAVE; 880 } 881 882 q= p->x; 883 884 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 885 case NT_FP32: 886 fp= WaveData(p->waveHandle); 887 SetNaN64(&p->result); 888 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 889 case NT_FP64: 890 dp= WaveData(p->waveHandle); 891 p->result = ConvexLens(dp,q); 892 return 0; 893 default: // We can't handle this wave data type. 894 SetNaN64(&p->result); 895 return REQUIRES_SP_OR_DP_WAVE; 896 } 897 return 0; 898 } 899 900 /* DumbbellX 901 902 */ 903 int 904 DumbbellX(FitParamsPtr p) 905 { 906 double *dp; // Pointer to double precision wave data. 907 float *fp; // Pointer to single precision wave data. 908 double q; //local variables of coefficient wave 909 910 if (p->waveHandle == NIL) { 911 SetNaN64(&p->result); 912 return NON_EXISTENT_WAVE; 913 } 914 915 q= p->x; 916 917 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 918 case NT_FP32: 919 fp= WaveData(p->waveHandle); 920 SetNaN64(&p->result); 921 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 922 case NT_FP64: 923 dp= WaveData(p->waveHandle); 924 p->result = Dumbbell(dp,q); 925 return 0; 926 default: // We can't handle this wave data type. 927 SetNaN64(&p->result); 928 return REQUIRES_SP_OR_DP_WAVE; 929 } 930 return 0; 931 } 932 933 /* CappedCylinderX 934 935 */ 936 int 937 CappedCylinderX(FitParamsPtr p) 938 { 939 double *dp; // Pointer to double precision wave data. 940 float *fp; // Pointer to single precision wave data. 941 double q; //local variables of coefficient wave 942 943 if (p->waveHandle == NIL) { 944 SetNaN64(&p->result); 945 return NON_EXISTENT_WAVE; 946 } 947 948 q= p->x; 949 950 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 951 case NT_FP32: 952 fp= WaveData(p->waveHandle); 953 SetNaN64(&p->result); 954 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 955 case NT_FP64: 956 dp= WaveData(p->waveHandle); 957 p->result = CappedCylinder(dp,q); 958 return 0; 959 default: // We can't handle this wave data type. 960 SetNaN64(&p->result); 961 return REQUIRES_SP_OR_DP_WAVE; 962 } 963 return 0; 964 } 965 966 /* BarbellX 967 968 */ 969 int 970 BarbellX(FitParamsPtr p) 971 { 972 double *dp; // Pointer to double precision wave data. 973 float *fp; // Pointer to single precision wave data. 974 double q; //local variables of coefficient wave 975 976 if (p->waveHandle == NIL) { 977 SetNaN64(&p->result); 978 return NON_EXISTENT_WAVE; 979 } 980 981 q= p->x; 982 983 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 984 case NT_FP32: 985 fp= WaveData(p->waveHandle); 986 SetNaN64(&p->result); 987 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 988 case NT_FP64: 989 dp= WaveData(p->waveHandle); 990 p->result = Barbell(dp,q); 991 return 0; 992 default: // We can't handle this wave data type. 993 SetNaN64(&p->result); 994 return REQUIRES_SP_OR_DP_WAVE; 995 } 996 return 0; 997 } 998 999 /* Lamellar_ParaCrystalX 1000 1001 */ 1002 int 1003 Lamellar_ParaCrystalX(FitParamsPtr p) 1004 { 1005 double *dp; // Pointer to double precision wave data. 1006 float *fp; // Pointer to single precision wave data. 1007 double q; //local variables of coefficient wave 1008 1009 if (p->waveHandle == NIL) { 1010 SetNaN64(&p->result); 1011 return NON_EXISTENT_WAVE; 1012 } 1013 1014 q= p->x; 1015 1016 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 1017 case NT_FP32: 1018 fp= WaveData(p->waveHandle); 1019 SetNaN64(&p->result); 1020 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 1021 case NT_FP64: 1022 dp= WaveData(p->waveHandle); 1023 p->result = Lamellar_ParaCrystal(dp,q); 1024 return 0; 1025 default: // We can't handle this wave data type. 1026 SetNaN64(&p->result); 1027 return REQUIRES_SP_OR_DP_WAVE; 1028 } 1029 return 0; 1030 } 1031
Note: See TracChangeset
for help on using the changeset viewer.