CIRProcess.CIR2.Parse C# (CSharp) Method

Parse() public method

Ensure the parameters are correct.
public Parse ( IProject context ) : bool
context IProject /// The underlying project. ///
return bool
        public bool Parse(IProject context)
        {
            bool errors = false;
            errors = BoolHelper.AddBool(errors, this.startingValue1.Parse(context));
            errors = BoolHelper.AddBool(errors, this.startingValue2.Parse(context));
            errors = BoolHelper.AddBool(errors, this.k1.Parse(context));
            errors = BoolHelper.AddBool(errors, this.k2.Parse(context));
            errors = BoolHelper.AddBool(errors, this.theta1.Parse(context));
            errors = BoolHelper.AddBool(errors, this.theta2.Parse(context));
            errors = BoolHelper.AddBool(errors, this.sigma1.Parse(context));
            errors = BoolHelper.AddBool(errors, this.sigma2.Parse(context));

            errors = BoolHelper.AddBool(errors, this.ZRReference.Parse(context));

            // Stores some temporary parameters derived from the main model parameters.
            if (!errors)
            {
                this.zr = (Function)this.ZRReference.fVRef();

                // In this way they are not stochastic.
                this.k12 = Math.Pow(this.k1.fV(), 2);
                this.k22 = Math.Pow(this.k2.fV(), 2);
                this.sigma12 = Math.Pow(this.sigma1.fV(), 2);
                this.sigma22 = Math.Pow(this.sigma2.fV(), 2);
                this.gamma1 = Math.Sqrt(this.k12 + 2 * this.sigma12);
                this.gamma2 = Math.Sqrt(this.k22 + 2 * this.sigma22);
            }

            return errors;
        }