Ejemplo n.º 1
0
        /********************************************************************************************
        * Constructors
        ********************************************************************************************/

        public QQDataSet(
            int n,
            int l,
            ColorState colorState,
            PotentialType potentialType,
            double temperature,
            double debyeMass,
            double displacementRMS,
            double softScale,
            double ultraSoftScale,
            double boundMass,
            double energy,
            double gammaDamp,
            double gammaDiss,
            double gammaTot
            )
        {
            N               = n;
            L               = l;
            ColorState      = colorState;
            PotentialType   = potentialType;
            Temperature     = temperature;
            DebyeMass       = debyeMass;
            DisplacementRMS = displacementRMS;
            SoftScale       = softScale;
            UltraSoftScale  = ultraSoftScale;
            BoundMass       = boundMass;
            Energy          = energy;
            GammaDamp       = gammaDamp;
            GammaDiss       = gammaDiss;
            GammaTot        = gammaTot;
        }
        public void Test(string methodName, PotentialType expectedType)
        {
            var method = typeof (TestTarget.IL.CallParameterTypesRecorderTarget).GetMethod(methodName);

            var instructions = method.GetInstructions();

            var recorder = new CallParameterTypesRecorder();

            recorder.Initialize(method);

            var takeWhile = instructions.TakeWhile(x => x.OpCode != OpCodes.Nop);
            var state = recorder.Visit(TypeAnalysisState.Empty,  takeWhile);

            Assert.That(state.StackTop, Is.EqualTo(expectedType));
        }
Ejemplo n.º 3
0
        private void CreatePotentialPlotFile()
        {
            StringBuilder plotFile = new StringBuilder();

            plotFile.AppendLine("reset");
            plotFile.AppendLine("set terminal windows enhanced size 1000,500");
            plotFile.AppendLine();
            plotFile.AppendLine("set title 'Potential (V): " + PotentialType.ToString() + "'");
            plotFile.AppendLine("set xlabel 'Radius (fm)'");
            plotFile.AppendLine("set ylabel 'Re V, Im V (MeV)'");
            plotFile.AppendLine();

            AppendPlotCommands(plotFile, style: "lines", titles: new string[] { "Re V", "Im V" });

            WritePlotFile(plotFile);
        }
 public Type GetExecutedCommandType(PotentialType[] actualParameterTypes)
 {
     return actualParameterTypes[0].Type;
 }
Ejemplo n.º 5
0
        private static int FindLineIndex(
            List <string> allLines,
            int n,
            int l,
            ColorState colorState,
            PotentialType potentialType,
            double temperature,
            out bool lineFound
            )
        {
            lineFound = false;

            int lineIndex;

            for (lineIndex = 0; lineIndex < allLines.Count; lineIndex++)
            {
                // skip commentary
                if (IsCommentaryLine(allLines[lineIndex]))
                {
                    continue;
                }

                string[] values = SplitLineIntoValues(allLines[lineIndex]);

                int nComparison = int.Parse(values[(int)QQDataColumn.N]) - n;
                if (nComparison < 0)
                {
                    continue;
                }
                else if (nComparison > 0)
                {
                    // new N value - insert new line here...
                    return(lineIndex);
                }

                int lComparison = int.Parse(values[(int)QQDataColumn.L]) - l;
                if (lComparison < 0)
                {
                    continue;
                }
                else if (lComparison > 0)
                {
                    // new L value - insert new line here...
                    return(lineIndex);
                }

                int colorStateComparison = (int)Enum.Parse(typeof(ColorState), values[(int)QQDataColumn.ColorState]) - (int)colorState;
                if (colorStateComparison < 0)
                {
                    continue;
                }
                else if (colorStateComparison > 0)
                {
                    // new ColorState value - insert new line here...
                    return(lineIndex);
                }

                double temperatureComparison = double.Parse(values[(int)QQDataColumn.Temperature]) - temperature;
                if (temperatureComparison < 0)
                {
                    continue;
                }
                if (temperatureComparison > 0)
                {
                    // new temperature value - insert new line here...
                    return(lineIndex);
                }

                int potentialTypeComparison = (int)Enum.Parse(typeof(PotentialType), values[(int)QQDataColumn.PotentialType]) - (int)potentialType;
                if (potentialTypeComparison < 0)
                {
                    continue;
                }
                else if (potentialTypeComparison > 0)
                {
                    // new PotentialType value - insert new line here...
                    return(lineIndex);
                }

                // all values match - update this line...
                lineFound = true;
                return(lineIndex);
            }

            return(lineIndex);
        }
 public MethodCallLink(Type[] genericMethodArguments, PotentialType[][] actualParameterTypes)
 {
     this.GenericMethodArguments = genericMethodArguments;
     this.ActualParameterTypes = actualParameterTypes;
 }