source: sasview/src/sas/sascalc/simulation/iqPy/libiqPy/iq.cc @ dc7eedb1

Last change on this file since dc7eedb1 was d85c194, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago

Remaining modules refactored

  • 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.