00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #ifndef QCGGS_H
00028 #define QCGGS_H
00029 
00030 #include <string>
00031 
00032 #include "qccomplexfield.h"
00033 #include "qc2componentbec.h"
00034 
00040 class QCGGS
00041 {
00042 public:
00043     
00049     QCGGS();
00053     ~QCGGS();
00055 
00056     
00062     void setNoOfImages(int number);
00066     void setIteration(int number)
00067     {   iterationNo = number;        }
00071     void setMaxIterations(int max)
00072     {   maxIterations = max;        }
00076     void setMaxTimeSteps(int max)
00077     {   maxTimeSteps = max;        }
00081     void setFilePrefix(string prefix)
00082     {   filePrefix = prefix;        }
00086     void setSystem(QCQuantumSystem<complexType,2> &system);
00090     void setSystem(QC2ComponentBEC<2> &system);
00094     void setGuess(parameterType mag, parameterType phase);
00098     int getNoOfImages()
00099     {   return noOfImages;          }
00103     int getIterationNo()
00104     {   return iterationNo;          }
00108     int getMaxIterations()
00109     {   return maxIterations;       }
00113     int getTimeSteps()
00114     {   return maxTimeSteps;        }
00118     string getFilePrefix()
00119     {   return filePrefix;          }
00123     QCQuantumSystem<complexType,2>* getSystem()
00124     {   return ptrSystem;           }
00128     void loadImages(string extension);
00132     void writeResults(string extension);
00136     void writeOriginals(string extension);
00138 
00139     
00145     void copyField(QCComplexField<2>& dest, QCComplexField<2>& source);
00149     void copyField(QCComplexField<2>& dest, Array<complexType,2>& source);
00153     void updateMagnitude(QCComplexField<2>& image, QCComplexField<2>& result);
00157     void updateMagnitude(QCComplexField<2>& image, Array<complexType,2>& result);
00161     parameterType RMSError(QCComplexField<2>& original, QCComplexField<2>& result);
00165     parameterType RMSError(QCComplexField<2>& original, Array<complexType,2> &result);
00169     parameterType iterate(QCBEC<2> &bec);
00173     parameterType iterate(QC2ComponentBEC<2> &bec);
00175 
00176 
00177 protected:
00178     int noOfImages; 
00179     int iterationNo; 
00180     int maxIterations; 
00181     int maxTimeSteps; 
00182     parameterType rmsError; 
00183     string filePrefix; 
00184     QCQuantumSystem<complexType,2> *ptrSystem; 
00185     Array<complexType,2> *ptrField; 
00186     Array<complexType,2> *ptrField2; 
00187     Array<QCComplexField<2>,1> GSPhases; 
00188     Array<QCComplexField<2>,1> GSPhases2; 
00189     Array<QCComplexField<2>,1> Images; 
00190     Array<QCComplexField<2>,1> Images2; 
00191     bool twoCompBEC; 
00192 };
00193 
00194 #endif // QCGGS_H