Changeset 452
- Timestamp:
- Nov 18, 2008 3:24:51 PM (14 years ago)
- Location:
- sans/XOP_Dev/SANSAnalysis/XOP
- Files:
-
- 8 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 -
sans/XOP_Dev/SANSAnalysis/XOP/Cylinder.h
r154 r452 28 28 int LamellarPSX(FitParamsPtr p); 29 29 int LamellarPS_HGX(FitParamsPtr p); 30 int SpherocylinderX(FitParamsPtr p); 31 int ConvexLensX(FitParamsPtr p); 32 int DumbbellX(FitParamsPtr p); 33 int CappedCylinderX(FitParamsPtr p); 34 int BarbellX(FitParamsPtr p); 35 int Lamellar_ParaCrystalX(FitParamsPtr p); -
sans/XOP_Dev/SANSAnalysis/XOP/SANSAnalysis.c
r231 r452 244 244 return((long)Sphere_2D); // This function is called using the direct method. 245 245 break; 246 246 /// new models added in 2008 247 case 68: // y = f(c,y,x) 248 return((long)SpherocylinderX); // This function is called using the direct method. 249 break; 250 case 69: // y = f(c,y,x) 251 return((long)ConvexLensX); // This function is called using the direct method. 252 break; 253 case 70: // y = f(c,y,x) 254 return((long)DumbbellX); // This function is called using the direct method. 255 break; 256 case 71: // y = f(c,y,x) 257 return((long)CappedCylinderX); // This function is called using the direct method. 258 break; 259 case 72: // y = f(c,y,x) 260 return((long)BarbellX); // This function is called using the direct method. 261 break; 262 case 73: // y = f(c,y,x) 263 return((long)Lamellar_ParaCrystalX); // This function is called using the direct method. 264 break; 265 // 266 case 74: // y = f(c,y,x) 267 return((long)BCC_ParaCrystalX); // This function is called using the direct method. 268 break; 269 case 75: // y = f(c,y,x) 270 return((long)FCC_ParaCrystalX); // This function is called using the direct method. 271 break; 272 case 76: // y = f(c,y,x) 273 return((long)SC_ParaCrystalX); // This function is called using the direct method. 274 break; 275 case 77: // y = f(c,y,x) 276 return((long)OneShellX); // This function is called using the direct method. 277 break; 278 case 78: // y = f(c,y,x) 279 return((long)TwoShellX); // This function is called using the direct method. 280 break; 281 case 79: // y = f(c,y,x) 282 return((long)ThreeShellX); // This function is called using the direct method. 283 break; 284 case 80: // y = f(c,y,x) 285 return((long)FourShellX); // This function is called using the direct method. 286 break; 287 case 81: // y = f(c,y,x) 288 return((long)PolyOneShellX); // This function is called using the direct method. 289 break; 290 case 82: // y = f(c,y,x) 291 return((long)PolyTwoShellX); // This function is called using the direct method. 292 break; 293 case 83: // y = f(c,y,x) 294 return((long)PolyThreeShellX); // This function is called using the direct method. 295 break; 296 case 84: // y = f(c,y,x) 297 return((long)PolyFourShellX); // This function is called using the direct method. 298 break; 299 // 300 case 85: // y = f(c,y,x) 301 return((long)BroadPeakX); // This function is called using the direct method. 302 break; 303 case 86: // y = f(c,y,x) 304 return((long)CorrLengthX); // This function is called using the direct method. 305 break; 306 case 87: // y = f(c,y,x) 307 return((long)TwoLorentzianX); // This function is called using the direct method. 308 break; 309 case 88: // y = f(c,y,x) 310 return((long)TwoPowerLawX); // This function is called using the direct method. 311 break; 312 case 89: // y = f(c,y,x) 313 return((long)PolyGaussCoilX); // This function is called using the direct method. 314 break; 315 case 90: // y = f(c,y,x) 316 return((long)GaussLorentzGelX); // This function is called using the direct method. 317 break; 318 case 91: // y = f(c,y,x) 319 return((long)GaussianShellX); // This function is called using the direct method. 320 break; 247 321 } 248 322 return NIL; -
sans/XOP_Dev/SANSAnalysis/XOP/SANSAnalysis.r
r231 r452 622 622 NT_FP64, /* double precision x */ 623 623 }, 624 625 /// new models in 2008 (starts index 68) 626 627 "SpherocylinderX", 628 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 629 NT_FP64, /* return value type */ 630 { 631 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 632 NT_FP64, /* double precision x */ 633 }, 634 635 "ConvexLensX", 636 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 637 NT_FP64, /* return value type */ 638 { 639 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 640 NT_FP64, /* double precision x */ 641 }, 642 643 "DumbbellX", 644 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 645 NT_FP64, /* return value type */ 646 { 647 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 648 NT_FP64, /* double precision x */ 649 }, 650 651 "CappedCylinderX", 652 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 653 NT_FP64, /* return value type */ 654 { 655 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 656 NT_FP64, /* double precision x */ 657 }, 658 659 "BarbellX", 660 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 661 NT_FP64, /* return value type */ 662 { 663 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 664 NT_FP64, /* double precision x */ 665 }, 666 // index # 73 is Lamellar_ParaCrystalX 667 "Lamellar_ParaCrystalX", 668 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 669 NT_FP64, /* return value type */ 670 { 671 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 672 NT_FP64, /* double precision x */ 673 }, 674 675 "BCC_ParaCrystalX", 676 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 677 NT_FP64, /* return value type */ 678 { 679 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 680 NT_FP64, /* double precision x */ 681 }, 682 683 "FCC_ParaCrystalX", 684 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 685 NT_FP64, /* return value type */ 686 { 687 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 688 NT_FP64, /* double precision x */ 689 }, 690 691 "SC_ParaCrystalX", 692 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 693 NT_FP64, /* return value type */ 694 { 695 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 696 NT_FP64, /* double precision x */ 697 }, 698 699 "OneShellX", 700 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 701 NT_FP64, /* return value type */ 702 { 703 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 704 NT_FP64, /* double precision x */ 705 }, 706 707 "TwoShellX", 708 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 709 NT_FP64, /* return value type */ 710 { 711 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 712 NT_FP64, /* double precision x */ 713 }, 714 715 "ThreeShellX", 716 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 717 NT_FP64, /* return value type */ 718 { 719 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 720 NT_FP64, /* double precision x */ 721 }, 722 723 "FourShellX", 724 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 725 NT_FP64, /* return value type */ 726 { 727 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 728 NT_FP64, /* double precision x */ 729 }, 730 731 "PolyOneShellX", 732 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 733 NT_FP64, /* return value type */ 734 { 735 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 736 NT_FP64, /* double precision x */ 737 }, 738 739 "PolyTwoShellX", 740 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 741 NT_FP64, /* return value type */ 742 { 743 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 744 NT_FP64, /* double precision x */ 745 }, 746 747 "PolyThreeShellX", 748 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 749 NT_FP64, /* return value type */ 750 { 751 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 752 NT_FP64, /* double precision x */ 753 }, 754 755 "PolyFourShellX", //case # 84 756 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 757 NT_FP64, /* return value type */ 758 { 759 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 760 NT_FP64, /* double precision x */ 761 }, 762 763 "BroadPeakX", //case # 85 764 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 765 NT_FP64, /* return value type */ 766 { 767 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 768 NT_FP64, /* double precision x */ 769 }, 770 771 "CorrLengthX", //case # 86 772 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 773 NT_FP64, /* return value type */ 774 { 775 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 776 NT_FP64, /* double precision x */ 777 }, 778 779 "TwoLorentzianX", //case # 87 780 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 781 NT_FP64, /* return value type */ 782 { 783 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 784 NT_FP64, /* double precision x */ 785 }, 786 787 "TwoPowerLawX", //case # 88 788 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 789 NT_FP64, /* return value type */ 790 { 791 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 792 NT_FP64, /* double precision x */ 793 }, 794 795 "PolyGaussCoilX", //case # 89 796 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 797 NT_FP64, /* return value type */ 798 { 799 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 800 NT_FP64, /* double precision x */ 801 }, 802 803 "GaussLorentzGelX", //case # 90 804 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 805 NT_FP64, /* return value type */ 806 { 807 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 808 NT_FP64, /* double precision x */ 809 }, 810 811 "GaussianShellX", //case # 91 812 F_UTIL | F_THREADSAFE | F_EXTERNAL, /* function category == UTILITY */ 813 NT_FP64, /* return value type */ 814 { 815 NT_FP64 + WAVE_TYPE, /* double precision wave (coefficient wave) */ 816 NT_FP64, /* double precision x */ 817 }, 624 818 625 819 -
sans/XOP_Dev/SANSAnalysis/XOP/Sphere.c
r188 r452 603 603 } 604 604 605 606 ///////////end of XOP 607 608 605 // new models, 2008.... 606 607 int 608 OneShellX(FitParamsPtr p) 609 { 610 double *dp; // Pointer to double precision wave data. 611 float *fp; // Pointer to single precision wave data. 612 double q; //local variables of coefficient wave 613 614 if (p->waveHandle == NIL) { 615 SetNaN64(&p->result); 616 return NON_EXISTENT_WAVE; 617 } 618 619 q= p->x; 620 621 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 622 case NT_FP32: 623 fp= WaveData(p->waveHandle); 624 SetNaN64(&p->result); 625 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 626 case NT_FP64: 627 dp= WaveData(p->waveHandle); 628 p->result = OneShell(dp,q); 629 return 0; 630 default: // We can't handle this wave data type. 631 SetNaN64(&p->result); 632 return REQUIRES_SP_OR_DP_WAVE; 633 } 634 return 0; 635 } 636 637 int 638 TwoShellX(FitParamsPtr p) 639 { 640 double *dp; // Pointer to double precision wave data. 641 float *fp; // Pointer to single precision wave data. 642 double q; //local variables of coefficient wave 643 644 if (p->waveHandle == NIL) { 645 SetNaN64(&p->result); 646 return NON_EXISTENT_WAVE; 647 } 648 649 q= p->x; 650 651 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 652 case NT_FP32: 653 fp= WaveData(p->waveHandle); 654 SetNaN64(&p->result); 655 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 656 case NT_FP64: 657 dp= WaveData(p->waveHandle); 658 p->result = TwoShell(dp,q); 659 return 0; 660 default: // We can't handle this wave data type. 661 SetNaN64(&p->result); 662 return REQUIRES_SP_OR_DP_WAVE; 663 } 664 return 0; 665 } 666 667 int 668 ThreeShellX(FitParamsPtr p) 669 { 670 double *dp; // Pointer to double precision wave data. 671 float *fp; // Pointer to single precision wave data. 672 double q; //local variables of coefficient wave 673 674 if (p->waveHandle == NIL) { 675 SetNaN64(&p->result); 676 return NON_EXISTENT_WAVE; 677 } 678 679 q= p->x; 680 681 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 682 case NT_FP32: 683 fp= WaveData(p->waveHandle); 684 SetNaN64(&p->result); 685 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 686 case NT_FP64: 687 dp= WaveData(p->waveHandle); 688 p->result = ThreeShell(dp,q); 689 return 0; 690 default: // We can't handle this wave data type. 691 SetNaN64(&p->result); 692 return REQUIRES_SP_OR_DP_WAVE; 693 } 694 return 0; 695 } 696 697 int 698 FourShellX(FitParamsPtr p) 699 { 700 double *dp; // Pointer to double precision wave data. 701 float *fp; // Pointer to single precision wave data. 702 double q; //local variables of coefficient wave 703 704 if (p->waveHandle == NIL) { 705 SetNaN64(&p->result); 706 return NON_EXISTENT_WAVE; 707 } 708 709 q= p->x; 710 711 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 712 case NT_FP32: 713 fp= WaveData(p->waveHandle); 714 SetNaN64(&p->result); 715 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 716 case NT_FP64: 717 dp= WaveData(p->waveHandle); 718 p->result = FourShell(dp,q); 719 return 0; 720 default: // We can't handle this wave data type. 721 SetNaN64(&p->result); 722 return REQUIRES_SP_OR_DP_WAVE; 723 } 724 return 0; 725 } 726 727 // 728 729 int 730 PolyOneShellX(FitParamsPtr p) 731 { 732 double *dp; // Pointer to double precision wave data. 733 float *fp; // Pointer to single precision wave data. 734 double q; //local variables of coefficient wave 735 736 if (p->waveHandle == NIL) { 737 SetNaN64(&p->result); 738 return NON_EXISTENT_WAVE; 739 } 740 741 q= p->x; 742 743 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 744 case NT_FP32: 745 fp= WaveData(p->waveHandle); 746 SetNaN64(&p->result); 747 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 748 case NT_FP64: 749 dp= WaveData(p->waveHandle); 750 p->result = PolyOneShell(dp,q); 751 return 0; 752 default: // We can't handle this wave data type. 753 SetNaN64(&p->result); 754 return REQUIRES_SP_OR_DP_WAVE; 755 } 756 return 0; 757 } 758 759 int 760 PolyTwoShellX(FitParamsPtr p) 761 { 762 double *dp; // Pointer to double precision wave data. 763 float *fp; // Pointer to single precision wave data. 764 double q; //local variables of coefficient wave 765 766 if (p->waveHandle == NIL) { 767 SetNaN64(&p->result); 768 return NON_EXISTENT_WAVE; 769 } 770 771 q= p->x; 772 773 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 774 case NT_FP32: 775 fp= WaveData(p->waveHandle); 776 SetNaN64(&p->result); 777 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 778 case NT_FP64: 779 dp= WaveData(p->waveHandle); 780 p->result = PolyTwoShell(dp,q); 781 return 0; 782 default: // We can't handle this wave data type. 783 SetNaN64(&p->result); 784 return REQUIRES_SP_OR_DP_WAVE; 785 } 786 return 0; 787 } 788 789 int 790 PolyThreeShellX(FitParamsPtr p) 791 { 792 double *dp; // Pointer to double precision wave data. 793 float *fp; // Pointer to single precision wave data. 794 double q; //local variables of coefficient wave 795 796 if (p->waveHandle == NIL) { 797 SetNaN64(&p->result); 798 return NON_EXISTENT_WAVE; 799 } 800 801 q= p->x; 802 803 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 804 case NT_FP32: 805 fp= WaveData(p->waveHandle); 806 SetNaN64(&p->result); 807 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 808 case NT_FP64: 809 dp= WaveData(p->waveHandle); 810 p->result = PolyThreeShell(dp,q); 811 return 0; 812 default: // We can't handle this wave data type. 813 SetNaN64(&p->result); 814 return REQUIRES_SP_OR_DP_WAVE; 815 } 816 return 0; 817 } 818 819 int 820 PolyFourShellX(FitParamsPtr p) 821 { 822 double *dp; // Pointer to double precision wave data. 823 float *fp; // Pointer to single precision wave data. 824 double q; //local variables of coefficient wave 825 826 if (p->waveHandle == NIL) { 827 SetNaN64(&p->result); 828 return NON_EXISTENT_WAVE; 829 } 830 831 q= p->x; 832 833 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 834 case NT_FP32: 835 fp= WaveData(p->waveHandle); 836 SetNaN64(&p->result); 837 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 838 case NT_FP64: 839 dp= WaveData(p->waveHandle); 840 p->result = PolyFourShell(dp,q); 841 return 0; 842 default: // We can't handle this wave data type. 843 SetNaN64(&p->result); 844 return REQUIRES_SP_OR_DP_WAVE; 845 } 846 return 0; 847 } 848 849 // paracrystal models, 2008 850 int 851 BCC_ParaCrystalX(FitParamsPtr p) 852 { 853 double *dp; // Pointer to double precision wave data. 854 float *fp; // Pointer to single precision wave data. 855 double q; //local variables of coefficient wave 856 857 if (p->waveHandle == NIL) { 858 SetNaN64(&p->result); 859 return NON_EXISTENT_WAVE; 860 } 861 862 q= p->x; 863 864 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 865 case NT_FP32: 866 fp= WaveData(p->waveHandle); 867 SetNaN64(&p->result); 868 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 869 case NT_FP64: 870 dp= WaveData(p->waveHandle); 871 p->result = BCC_ParaCrystal(dp,q); 872 return 0; 873 default: // We can't handle this wave data type. 874 SetNaN64(&p->result); 875 return REQUIRES_SP_OR_DP_WAVE; 876 } 877 return 0; 878 } 879 880 881 int 882 FCC_ParaCrystalX(FitParamsPtr p) 883 { 884 double *dp; // Pointer to double precision wave data. 885 float *fp; // Pointer to single precision wave data. 886 double q; //local variables of coefficient wave 887 888 if (p->waveHandle == NIL) { 889 SetNaN64(&p->result); 890 return NON_EXISTENT_WAVE; 891 } 892 893 q= p->x; 894 895 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 896 case NT_FP32: 897 fp= WaveData(p->waveHandle); 898 SetNaN64(&p->result); 899 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 900 case NT_FP64: 901 dp= WaveData(p->waveHandle); 902 p->result = FCC_ParaCrystal(dp,q); 903 return 0; 904 default: // We can't handle this wave data type. 905 SetNaN64(&p->result); 906 return REQUIRES_SP_OR_DP_WAVE; 907 } 908 return 0; 909 } 910 911 912 int 913 SC_ParaCrystalX(FitParamsPtr p) 914 { 915 double *dp; // Pointer to double precision wave data. 916 float *fp; // Pointer to single precision wave data. 917 double q; //local variables of coefficient wave 918 919 if (p->waveHandle == NIL) { 920 SetNaN64(&p->result); 921 return NON_EXISTENT_WAVE; 922 } 923 924 q= p->x; 925 926 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 927 case NT_FP32: 928 fp= WaveData(p->waveHandle); 929 SetNaN64(&p->result); 930 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 931 case NT_FP64: 932 dp= WaveData(p->waveHandle); 933 p->result = SC_ParaCrystal(dp,q); 934 return 0; 935 default: // We can't handle this wave data type. 936 SetNaN64(&p->result); 937 return REQUIRES_SP_OR_DP_WAVE; 938 } 939 return 0; 940 } 941 -
sans/XOP_Dev/SANSAnalysis/XOP/Sphere.h
r154 r452 19 19 int BinaryHS_PSF12X(FitParamsPtr p); 20 20 int BinaryHS_PSF22X(FitParamsPtr p); 21 // 22 int OneShellX(FitParamsPtr p); 23 int TwoShellX(FitParamsPtr p); 24 int ThreeShellX(FitParamsPtr p); 25 int FourShellX(FitParamsPtr p); 26 int PolyOneShellX(FitParamsPtr p); 27 int PolyTwoShellX(FitParamsPtr p); 28 int PolyThreeShellX(FitParamsPtr p); 29 int PolyFourShellX(FitParamsPtr p); 30 int BCC_ParaCrystalX(FitParamsPtr p); 31 int FCC_ParaCrystalX(FitParamsPtr p); 32 int SC_ParaCrystalX(FitParamsPtr p); -
sans/XOP_Dev/SANSAnalysis/XOP/TwoPhase.c
r188 r452 360 360 } 361 361 362 int 363 BroadPeakX(FitParamsPtr p) 364 { 365 double *dp; // Pointer to double precision wave data. 366 float *fp; // Pointer to single precision wave data. 367 double q; 368 369 if (p->waveHandle == NIL) { 370 SetNaN64(&p->result); 371 return NON_EXISTENT_WAVE; 372 } 373 374 q= p->x; 375 376 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 377 case NT_FP32: 378 fp= WaveData(p->waveHandle); 379 SetNaN64(&p->result); 380 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 381 case NT_FP64: 382 dp= WaveData(p->waveHandle); 383 p->result = BroadPeak(dp,q); 384 return 0; 385 default: // We can't handle this wave data type. 386 SetNaN64(&p->result); 387 return REQUIRES_SP_OR_DP_WAVE; 388 } 389 390 return 0; 391 } 392 393 int 394 CorrLengthX(FitParamsPtr p) 395 { 396 double *dp; // Pointer to double precision wave data. 397 float *fp; // Pointer to single precision wave data. 398 double q; 399 400 if (p->waveHandle == NIL) { 401 SetNaN64(&p->result); 402 return NON_EXISTENT_WAVE; 403 } 404 405 q= p->x; 406 407 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 408 case NT_FP32: 409 fp= WaveData(p->waveHandle); 410 SetNaN64(&p->result); 411 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 412 case NT_FP64: 413 dp= WaveData(p->waveHandle); 414 p->result = CorrLength(dp,q); 415 return 0; 416 default: // We can't handle this wave data type. 417 SetNaN64(&p->result); 418 return REQUIRES_SP_OR_DP_WAVE; 419 } 420 421 return 0; 422 } 423 424 int 425 TwoLorentzianX(FitParamsPtr p) 426 { 427 double *dp; // Pointer to double precision wave data. 428 float *fp; // Pointer to single precision wave data. 429 double q; 430 431 if (p->waveHandle == NIL) { 432 SetNaN64(&p->result); 433 return NON_EXISTENT_WAVE; 434 } 435 436 q= p->x; 437 438 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 439 case NT_FP32: 440 fp= WaveData(p->waveHandle); 441 SetNaN64(&p->result); 442 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 443 case NT_FP64: 444 dp= WaveData(p->waveHandle); 445 p->result = TwoLorentzian(dp,q); 446 return 0; 447 default: // We can't handle this wave data type. 448 SetNaN64(&p->result); 449 return REQUIRES_SP_OR_DP_WAVE; 450 } 451 452 return 0; 453 } 454 455 int 456 TwoPowerLawX(FitParamsPtr p) 457 { 458 double *dp; // Pointer to double precision wave data. 459 float *fp; // Pointer to single precision wave data. 460 double q; 461 462 if (p->waveHandle == NIL) { 463 SetNaN64(&p->result); 464 return NON_EXISTENT_WAVE; 465 } 466 467 q= p->x; 468 469 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 470 case NT_FP32: 471 fp= WaveData(p->waveHandle); 472 SetNaN64(&p->result); 473 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 474 case NT_FP64: 475 dp= WaveData(p->waveHandle); 476 p->result = TwoPowerLaw(dp,q); 477 return 0; 478 default: // We can't handle this wave data type. 479 SetNaN64(&p->result); 480 return REQUIRES_SP_OR_DP_WAVE; 481 } 482 483 return 0; 484 } 485 486 int 487 PolyGaussCoilX(FitParamsPtr p) 488 { 489 double *dp; // Pointer to double precision wave data. 490 float *fp; // Pointer to single precision wave data. 491 double q; 492 493 if (p->waveHandle == NIL) { 494 SetNaN64(&p->result); 495 return NON_EXISTENT_WAVE; 496 } 497 498 q= p->x; 499 500 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 501 case NT_FP32: 502 fp= WaveData(p->waveHandle); 503 SetNaN64(&p->result); 504 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 505 case NT_FP64: 506 dp= WaveData(p->waveHandle); 507 p->result = PolyGaussCoil(dp,q); 508 return 0; 509 default: // We can't handle this wave data type. 510 SetNaN64(&p->result); 511 return REQUIRES_SP_OR_DP_WAVE; 512 } 513 514 return 0; 515 } 516 517 int 518 GaussLorentzGelX(FitParamsPtr p) 519 { 520 double *dp; // Pointer to double precision wave data. 521 float *fp; // Pointer to single precision wave data. 522 double q; 523 524 if (p->waveHandle == NIL) { 525 SetNaN64(&p->result); 526 return NON_EXISTENT_WAVE; 527 } 528 529 q= p->x; 530 531 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 532 case NT_FP32: 533 fp= WaveData(p->waveHandle); 534 SetNaN64(&p->result); 535 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 536 case NT_FP64: 537 dp= WaveData(p->waveHandle); 538 p->result = GaussLorentzGel(dp,q); 539 return 0; 540 default: // We can't handle this wave data type. 541 SetNaN64(&p->result); 542 return REQUIRES_SP_OR_DP_WAVE; 543 } 544 545 return 0; 546 } 547 548 int 549 GaussianShellX(FitParamsPtr p) 550 { 551 double *dp; // Pointer to double precision wave data. 552 float *fp; // Pointer to single precision wave data. 553 double q; 554 555 if (p->waveHandle == NIL) { 556 SetNaN64(&p->result); 557 return NON_EXISTENT_WAVE; 558 } 559 560 q= p->x; 561 562 switch(WaveType(p->waveHandle)){ // We can handle single and double precision coefficient waves. 563 case NT_FP32: 564 fp= WaveData(p->waveHandle); 565 SetNaN64(&p->result); 566 return REQUIRES_SP_OR_DP_WAVE; //not quite true, but good enough for now AJJ 4/23/07 567 case NT_FP64: 568 dp= WaveData(p->waveHandle); 569 p->result = GaussianShell(dp,q); 570 return 0; 571 default: // We can't handle this wave data type. 572 SetNaN64(&p->result); 573 return REQUIRES_SP_OR_DP_WAVE; 574 } 575 576 return 0; 577 } 362 578 363 579 ///////////end of XOP -
sans/XOP_Dev/SANSAnalysis/XOP/TwoPhase.h
r97 r452 14 14 int ThreeLevelX(FitParamsPtr p); 15 15 int FourLevelX(FitParamsPtr p); 16 16 // 17 int BroadPeakX(FitParamsPtr p); 18 int CorrLengthX(FitParamsPtr p); 19 int TwoLorentzianX(FitParamsPtr p); 20 int TwoPowerLawX(FitParamsPtr p); 21 int PolyGaussCoilX(FitParamsPtr p); 22 int GaussLorentzGelX(FitParamsPtr p); 23 int GaussianShellX(FitParamsPtr p);
Note: See TracChangeset
for help on using the changeset viewer.