source: sasview/realSpaceModeling/iqPy/libiqPy/iq.cc @ be756f3

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since be756f3 was f2d6445, checked in by Mathieu Doucet <doucetm@…>, 17 years ago

moving realSpaceModeling to trunk

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/** \file iq.cc */
2
3#include "iq.h"
4#include <fstream>
5#include <iostream>
6
7using namespace std;
8
9IQ::IQ(int numI){
10
11  numI_ = numI;
12
13  Array2D<double> iq1(numI, 2, 0.0);
14
15  iq_data = iq1;
16}
17
18IQ::IQ(int numI,double qmin, double qmax){
19
20  numI_ = numI;
21  qmin_ = qmin;
22  qmax_ = qmax;
23
24  Array2D<double> iq1(numI, 2, 0.0);
25
26  iq_data = iq1;
27}
28
29void IQ::SetQmin(double qmin){
30  qmin_ = qmin;
31
32}
33
34void IQ::SetQmax(double qmax){
35  qmax_ = qmax;
36}
37
38void IQ::SetContrast(double delrho){
39  delrho_ = delrho;
40}
41
42void IQ::SetVolFrac(double vol_frac){
43  vol_frac_ = vol_frac;
44}
45
46double IQ::GetQmin(){
47  return qmin_;
48}
49
50double IQ::GetQmax(){
51  return qmax_;
52}
53
54double IQ::GetContrast(){
55  return delrho_;
56}
57
58double IQ::GetVolFrac(){
59  return vol_frac_;
60}
61
62int IQ::GetNumI(){
63  return numI_;
64}
65
66void IQ::OutputIQ(string fiq){
67  ofstream outfile(fiq.c_str());
68  if (!outfile) {
69    cerr << "error: unable to open output file: "
70         << outfile << endl;
71    exit(1);
72  }
73  for (int i = 0;  i < iq_data.dim1(); ++i){
74    outfile << iq_data[i][0] << "       " << iq_data[i][1] << endl;
75  }
76    //    fprintf(fp,"%15lf%15lf%15lf\n", (j+1)*rstep, cor[j]/cormax, "0");
77
78
79
80}
Note: See TracBrowser for help on using the repository browser.