Changeset 452 for sans/XOP_Dev/SANSAnalysis/XOP/Sphere.c
 Timestamp:
 Nov 18, 2008 3:24:51 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

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
Note: See TracChangeset
for help on using the changeset viewer.