public void ExactShouldReturnTrueWhenEqualStringAndDouble() { var func = new Exact(); var result = func.Execute(FunctionsHelper.CreateArgs("1", 1d), _parsingContext); Assert.IsTrue((bool)result.Result); }
public void ExactShouldReturnFalseWhenStringAndNull() { var func = new Exact(); var result = func.Execute(FunctionsHelper.CreateArgs("1", null), _parsingContext); Assert.IsFalse((bool)result.Result); }
public void ExactShouldReturnTrueWhenTwoEqualStrings() { var func = new Exact(); var result = func.Execute(FunctionsHelper.CreateArgs("abc", "abc"), this.ParsingContext); Assert.IsTrue((bool)result.Result); }
static void Main(string[] args) { bool isGraphsChecker = IsValidGraphsChecker(args); bool isComplexityChecker = IsValidComplexityChecker(args); if (!(isGraphsChecker ^ isComplexityChecker)) { ShowHelp(args); return; } bool exact = args[0] == "exact"; if (isGraphsChecker) { var G = GraphLoader.FromCSV(args[1]); var H = GraphLoader.FromCSV(args[2]); var modularGraph = ModularGraph.Create(G, H); if (exact) { var exactResult = new Exact(G, H, modularGraph).Run(); GraphLoader.ToCSV(exactResult, "Examples/exact.csv"); } else { var approximateResult = new Approximate(G, H, modularGraph).Run(); GraphLoader.ToCSV(approximateResult, "Examples/approximate.csv"); } } else { new ComplexityChecker(args[2], exact).Run(); } }
public void ExactShouldReturnFalseWhenTwoEqualStringsWithDifferentCase() { var func = new Exact(); var result = func.Execute(FunctionsHelper.CreateArgs("abc", "Abc"), _parsingContext); Assert.IsFalse((bool)result.Result); }
public override int GetHashCode() { int hash = 1; if (FieldPath.Length != 0) { hash ^= FieldPath.GetHashCode(); } if (valueCase_ == ValueOneofCase.Exact) { hash ^= Exact.GetHashCode(); } if (valueCase_ == ValueOneofCase.Prefix) { hash ^= Prefix.GetHashCode(); } if (valueCase_ == ValueOneofCase.Suffix) { hash ^= Suffix.GetHashCode(); } hash ^= (int)valueCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 1; if (matchPatternCase_ == MatchPatternOneofCase.Exact) { hash ^= Exact.GetHashCode(); } if (matchPatternCase_ == MatchPatternOneofCase.Prefix) { hash ^= Prefix.GetHashCode(); } if (matchPatternCase_ == MatchPatternOneofCase.Suffix) { hash ^= Suffix.GetHashCode(); } if (matchPatternCase_ == MatchPatternOneofCase.Regex) { hash ^= Regex.GetHashCode(); } if (matchPatternCase_ == MatchPatternOneofCase.SafeRegex) { hash ^= SafeRegex.GetHashCode(); } hash ^= (int)matchPatternCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void ExactWithInvalidArgumentReturnsPoundValue() { var func = new Exact(); var args = FunctionsHelper.CreateArgs(); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public override int go() { int i, j, k, m; int iglob, jglob; double xi, eta, zeta; double pxi, peta, pzeta; double[,,,] ue_1jk = new double[1, 1, 1, 5]; double[,,,] ue_nx0jk = new double[1, 1, 1, 5]; double[,,,] ue_i1k = new double[1, 1, 1, 5]; double[,,,] ue_iny0k = new double[1, 1, 1, 5]; double[,,,] ue_ij1 = new double[1, 1, 1, 5]; double[,,,] ue_ijnz = new double[1, 1, 1, 5]; for (k = 2; k <= nz - 1; k++) { zeta = ((double)(k - 1)) / (nz - 1); for (j = 1; j <= ny; j++) { jglob = jpt + j; if (jglob != 1 && jglob != ny0) { eta = ((double)(jglob - 1)) / (ny0 - 1); for (i = 1; i <= nx; i++) { iglob = ipt + i; if (iglob != 1 && iglob != nx0) { xi = ((double)(iglob - 1)) / (nx0 - 1); Exact.setParameters(1, jglob, k, ue_1jk, 0, 0, 0); Exact.go(); Exact.setParameters(nx0, jglob, k, ue_nx0jk, 0, 0, 0); Exact.go(); Exact.setParameters(iglob, 1, k, ue_i1k, 0, 0, 0); Exact.go(); Exact.setParameters(iglob, ny0, k, ue_iny0k, 0, 0, 0); Exact.go(); Exact.setParameters(iglob, jglob, 1, ue_ij1, 0, 0, 0); Exact.go(); Exact.setParameters(iglob, jglob, nz, ue_ijnz, 0, 0, 0); Exact.go(); for (m = 0; m < 5; m++) { pxi = (1.0d - xi) * ue_1jk[0, 0, 0, m] + xi * ue_nx0jk[0, 0, 0, m]; peta = (1.0d - eta) * ue_i1k[0, 0, 0, m] + eta * ue_iny0k[0, 0, 0, m]; pzeta = (1.0d - zeta) * ue_ij1[0, 0, 0, m] + zeta * ue_ijnz[0, 0, 0, m]; u[k - 1, j + 1, i + 1, m] = pxi + peta + pzeta - pxi * peta - peta * pzeta - pzeta * pxi + pxi * peta * pzeta; } } } } } } return(0); }
/// <summary> /// Determines whether the specified value is a match. /// </summary> /// <param name="value">The value to match.</param> /// <returns> /// <c>true</c> if the specified value is a match; otherwise, <c>false</c>. /// </returns> public bool IsMatch(string value) { if (Exact.HasValue()) { return(string.Equals(value, Exact)); } if (Expression.HasValue()) { return(Regex.IsMatch(value, Expression)); } return(false); }
public override int GetHashCode() { int hashCode = -1444472756; if (Exact != null) { hashCode += Exact.GetHashCode(); } if (Fuzzy != null) { hashCode += Fuzzy.GetHashCode(); } return(hashCode); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is CustomerTextFilter other && ((Exact == null && other.Exact == null) || (Exact?.Equals(other.Exact) == true)) && ((Fuzzy == null && other.Fuzzy == null) || (Fuzzy?.Equals(other.Fuzzy) == true))); }
public override int go() { int i, j, k, m, iglob, jglob; double tmp; double[,,,] u000ijk = new double[1, 1, 1, 5]; double[] dummy = new double[5]; errnm = new double[5]; for (m = 0; m < 5; m++) { errnm[m] = 0.0d; dummy[m] = 0.0d; } for (k = 2; k <= nz - 1; k++) { for (j = jst; j <= jend; j++) { jglob = jpt + j; for (i = ist; i <= iend; i++) { iglob = ipt + i; Exact.setParameters(iglob, jglob, k, u000ijk, 0, 0, 0); Exact.go(); for (m = 0; m < 5; m++) { tmp = (u000ijk[0, 0, 0, m] - u[k - 1, j + 1, i + 1, m]); dummy[m] = dummy[m] + pow2(tmp); } } } } worldcomm.Allreduce <double>(dummy, MPI.Operation <double> .Add, ref errnm); for (m = 0; m < 5; m++) { errnm[m] = Math.Sqrt(errnm[m] / ((nx0 - 2) * (ny0 - 2) * (nz0 - 2))); } return(0); }
/// <summary> /// Calculates the interest portion of a payment on a loan. /// </summary> /// <param name="rate">The periodic interest rate (applied every period). This must be greater than or equal to zero.</param> /// <param name="numberOfPeriods">The total number of periods.</param> /// <param name="currentBalance">The current balance of the loan. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="period">The period for which to calculate the principal portion. This must be in the range <c>[1,<paramref name="numberOfPeriods"/>]</c> and defaults to <c>1</c>.</param> /// <param name="futureBalance">The future balance of the loan. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="payAtBeginningOfPeriod">Set to <c>true</c> to indicate payments are made at the beginning of the period; by default, payments are made at the end of the period.</param> /// <returns>The interest portion of the specific payment.</returns> /// <exception cref="InvalidOperationException">The interest portion of the payment could not be calculated.</exception> public static decimal InterestPayment(decimal rate, uint numberOfPeriods, decimal currentBalance, int period = 1, decimal futureBalance = decimal.Zero, bool payAtBeginningOfPeriod = false) { Contract.Requires <ArgumentOutOfRangeException>(rate >= 0, "Rate may not be less than zero."); VerifyMoneyArgument(currentBalance, "currentBalance"); VerifyMoneyArgument(futureBalance, "futureBalance"); var result = -Exact.InterestPayment(rate, numberOfPeriods, currentBalance, period, futureBalance, payAtBeginningOfPeriod); if (result < decimal.Zero) { var e = new InvalidOperationException("The interest portion of the payment could not be calculated."); e.Data["rate"] = rate; e.Data["numberOfPeriods"] = numberOfPeriods; e.Data["currentBalance"] = currentBalance; e.Data["period"] = period; e.Data["futureBalance"] = futureBalance; e.Data["payAtBeginningOfPeriod"] = payAtBeginningOfPeriod; e.Data["result"] = result; throw e; } try { return(checked (Math.Floor(result * 100) / 100)); } catch (OverflowException ex) { var e = new InvalidOperationException("The interest portion of the payment could not be calculated.", ex); e.Data["rate"] = rate; e.Data["numberOfPeriods"] = numberOfPeriods; e.Data["currentBalance"] = currentBalance; e.Data["period"] = period; e.Data["futureBalance"] = futureBalance; e.Data["payAtBeginningOfPeriod"] = payAtBeginningOfPeriod; e.Data["result"] = result; throw e; } }
/// <summary> /// Calculates the number of periods remaining on a loan. /// </summary> /// <param name="rate">The periodic interest rate (applied every period). This must be greater than or equal to zero.</param> /// <param name="payment">The payment made each period. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="currentBalance">The current balance of the loan. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="futureBalance">The future balance of the loan. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="payAtBeginningOfPeriod">Set to <c>true</c> to indicate payments are made at the beginning of the period; by default, payments are made at the end of the period.</param> /// <returns>The number of periods remaining on the loan.</returns> /// <exception cref="InvalidOperationException">The number of periods could not be calculated.</exception> public static uint NumberOfPeriods(decimal rate, decimal payment, decimal currentBalance, decimal futureBalance = decimal.Zero, bool payAtBeginningOfPeriod = false) { Contract.Requires <ArgumentOutOfRangeException>(rate >= 0, "Rate may not be less than zero."); VerifyMoneyArgument(payment, "payment"); VerifyMoneyArgument(currentBalance, "currentBalance"); VerifyMoneyArgument(futureBalance, "futureBalance"); var result = Exact.NumberOfPeriods(rate, -payment, currentBalance, futureBalance, payAtBeginningOfPeriod); if (result < decimal.Zero) { var e = new InvalidOperationException("The number of periods could not be calculated."); e.Data["rate"] = rate; e.Data["payment"] = payment; e.Data["currentBalance"] = currentBalance; e.Data["futureBalance"] = futureBalance; e.Data["payAtBeginningOfPeriod"] = payAtBeginningOfPeriod; e.Data["result"] = result; throw e; } try { return(checked ((uint)Math.Ceiling(result))); } catch (OverflowException ex) { var e = new InvalidOperationException("The number of periods could not be calculated.", ex); e.Data["rate"] = rate; e.Data["payment"] = payment; e.Data["currentBalance"] = currentBalance; e.Data["futureBalance"] = futureBalance; e.Data["payAtBeginningOfPeriod"] = payAtBeginningOfPeriod; e.Data["result"] = result; throw e; } }
/// <summary> /// Calculates the future balance of a loan. /// </summary> /// <param name="rate">The periodic interest rate (applied every period). This must be greater than or equal to zero.</param> /// <param name="numberOfPeriods">The total number of periods.</param> /// <param name="payment">The payment made each period. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="currentBalance">The current balance of the loan. This must be greater than or equal to zero and not contain fractional pennies.</param> /// <param name="payAtBeginningOfPeriod">Set to <c>true</c> to indicate payments are made at the beginning of the period; by default, payments are made at the end of the period.</param> /// <returns>The future balance of the loan.</returns> /// <exception cref="InvalidOperationException">The future balance could not be calculated.</exception> public static decimal FutureBalance(decimal rate, uint numberOfPeriods, decimal payment, decimal currentBalance, bool payAtBeginningOfPeriod = false) { Contract.Requires <ArgumentOutOfRangeException>(rate >= 0, "Rate may not be less than zero."); VerifyMoneyArgument(payment, "payment"); VerifyMoneyArgument(currentBalance, "currentBalance"); var result = Exact.FutureValue(rate, numberOfPeriods, -payment, currentBalance, payAtBeginningOfPeriod); try { return(checked (Math.Ceiling(result * 100) / 100)); } catch (OverflowException ex) { var e = new InvalidOperationException("The future balance could not be calculated.", ex); e.Data["rate"] = rate; e.Data["numberOfPeriods"] = numberOfPeriods; e.Data["payment"] = payment; e.Data["currentBalance"] = currentBalance; e.Data["payAtBeginningOfPeriod"] = payAtBeginningOfPeriod; e.Data["result"] = result; throw e; } }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["rept"] = new Rept(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["char"] = new CharFunction(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["fixed"] = new Fixed(); Functions["proper"] = new Proper(); Functions["search"] = new Search(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); Functions["hyperlink"] = new Hyperlink(); Functions["value"] = new Value(); // Numbers Functions["int"] = new CInt(); // Math Functions["abs"] = new Abs(); Functions["asin"] = new Asin(); Functions["asinh"] = new Asinh(); Functions["cos"] = new Cos(); Functions["cosh"] = new Cosh(); Functions["power"] = new Power(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countblank"] = new CountBlank(); Functions["countif"] = new CountIf(); Functions["countifs"] = new CountIfs(); Functions["fact"] = new Fact(); Functions["floor"] = new Floor(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumifs"] = new SumIfs(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["stdev"] = new Stdev(); Functions["stdevp"] = new StdevP(); Functions["stdev.s"] = new Stdev(); Functions["stdev.p"] = new StdevP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["median"] = new Median(); Functions["min"] = new Min(); Functions["mina"] = new Mina(); Functions["mod"] = new Mod(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["averageifs"] = new AverageIfs(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["rank"] = new Rank(); Functions["rank.eq"] = new Rank(); Functions["rank.avg"] = new Rank(true); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["atanh"] = new Atanh(); Functions["acos"] = new Acos(); Functions["acosh"] = new Acosh(); Functions["var"] = new Var(); Functions["varp"] = new VarP(); Functions["large"] = new Large(); Functions["small"] = new Small(); Functions["degrees"] = new Degrees(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["isnontext"] = new IsNonText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["error.type"] = new ErrorType(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); // Logical Functions["if"] = new If(); Functions["iferror"] = new IfError(); Functions["ifna"] = new IfNa(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); Functions["false"] = new False(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows(); Functions["column"] = new Column(); Functions["columns"] = new Columns(); Functions["choose"] = new Choose(); Functions["index"] = new RefAndLookup.Index(); Functions["indirect"] = new Indirect(); Functions["offset"] = new Offset(); // Date Functions["date"] = new Date(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); Functions["networkdays"] = new Networkdays(); Functions["networkdays.intl"] = new NetworkdaysIntl(); Functions["datevalue"] = new DateValue(); Functions["timevalue"] = new TimeValue(); // Database Functions["dget"] = new Dget(); Functions["dcount"] = new Dcount(); Functions["dcounta"] = new DcountA(); Functions["dmax"] = new Dmax(); Functions["dmin"] = new Dmin(); Functions["dsum"] = new Dsum(); Functions["daverage"] = new Daverage(); Functions["dvar"] = new Dvar(); Functions["dvarp"] = new Dvarp(); //Finance Functions["pmt"] = new Pmt(); }
private List <TocGroup> LoadTocGroups(Renderer renderer, SwatchMaker swatchMaker, bool includeImages) { List <TocGroup> tocGroups = new List <TocGroup>(); switch (renderer.GetType().Name) { case "SimpleRenderer": tocGroups.Add(new TocGroup()); SimpleRenderer sr = (SimpleRenderer)renderer; tocGroups[0].Add(LoadTocClass(sr.Symbol, swatchMaker, includeImages)); break; case "ValueMapRenderer": tocGroups.Add(new TocGroup()); ValueMapRenderer vmr = (ValueMapRenderer)renderer; foreach (Classification classification in vmr.Classifications) { string label = ""; switch (classification.GetType().Name) { case "Exact": Exact exact = (Exact)classification; label = !String.IsNullOrEmpty(exact.Label) ? exact.Label : exact.Value; break; case "Range": Range range = (Range)classification; label = !String.IsNullOrEmpty(range.Label) ? range.Label : range.Lower + " to " + range.Upper; break; case "Other": label = "(other)"; break; } tocGroups[0].Add(LoadTocClass(classification.Symbol, swatchMaker, label, includeImages)); } break; case "ScaleDependentRenderer": ScaleDependentRenderer scd = (ScaleDependentRenderer)renderer; tocGroups = LoadTocGroups(scd.Renderer, swatchMaker, includeImages); foreach (TocGroup tocGroup in tocGroups) { if (!String.IsNullOrEmpty(scd.Lower)) { tocGroup.MinScale = Convert.ToDouble(scd.Lower); } if (!String.IsNullOrEmpty(scd.Upper)) { tocGroup.MaxScale = Convert.ToDouble(scd.Upper); } } break; case "GroupRenderer": foreach (Renderer subRenderer in (GroupRenderer)renderer) { List <TocGroup> subGroups = LoadTocGroups(subRenderer, swatchMaker, includeImages); foreach (TocGroup tocGroup in subGroups) { tocGroups.Add(tocGroup); } } break; } return(tocGroups); }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["proper"] = new Proper(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); // Numbers Functions["int"] = new CInt(); // Math Functions["abs"] = new Abs(); Functions["cos"] = new Cos(); Functions["cosh"] = new Cosh(); Functions["power"] = new Power(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countif"] = new CountIf(); Functions["fact"] = new Fact(); Functions["floor"] = new Floor(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["stdev"] = new Stdev(); Functions["stdevp"] = new StdevP(); Functions["stdev.s"] = new Stdev(); Functions["stdev.p"] = new StdevP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["min"] = new Min(); Functions["mod"] = new Mod(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["var"] = new Var(); Functions["varp"] = new VarP(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); // Logical Functions["if"] = new If(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows() { SkipArgumentEvaluation = true }; Functions["column"] = new Column(); Functions["columns"] = new Columns() { SkipArgumentEvaluation = true }; Functions["choose"] = new Choose(); Functions["index"] = new Index(); Functions["indirect"] = new Indirect(); // Date Functions["date"] = new Date(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); }
public BuiltInFunctions() { // Text Functions["len"] = new Len(); Functions["lower"] = new Lower(); Functions["upper"] = new Upper(); Functions["left"] = new Left(); Functions["right"] = new Right(); Functions["mid"] = new Mid(); Functions["replace"] = new Replace(); Functions["rept"] = new Rept(); Functions["substitute"] = new Substitute(); Functions["concatenate"] = new Concatenate(); Functions["concat"] = new Concat(); Functions["textjoin"] = new Textjoin(); Functions["char"] = new CharFunction(); Functions["exact"] = new Exact(); Functions["find"] = new Find(); Functions["fixed"] = new Fixed(); Functions["proper"] = new Proper(); Functions["search"] = new Search(); Functions["text"] = new Text.Text(); Functions["t"] = new T(); Functions["hyperlink"] = new Hyperlink(); Functions["value"] = new Value(CultureInfo.CurrentCulture); Functions["trim"] = new Trim(); Functions["clean"] = new Clean(); Functions["unicode"] = new Unicode(); Functions["unichar"] = new Unichar(); Functions["numbervalue"] = new NumberValue(); Functions["dollar"] = new Dollar(); // Numbers Functions["int"] = new CInt(); // Math Functions["aggregate"] = new Aggregate(); Functions["abs"] = new Abs(); Functions["asin"] = new Asin(); Functions["asinh"] = new Asinh(); Functions["acot"] = new Acot(); Functions["acoth"] = new Acoth(); Functions["cos"] = new Cos(); Functions["cot"] = new Cot(); Functions["coth"] = new Coth(); Functions["cosh"] = new Cosh(); Functions["csc"] = new Csc(); Functions["csch"] = new Csch(); Functions["power"] = new Power(); Functions["gcd"] = new Gcd(); Functions["lcm"] = new Lcm(); Functions["sec"] = new Sec(); Functions["sech"] = new SecH(); Functions["sign"] = new Sign(); Functions["sqrt"] = new Sqrt(); Functions["sqrtpi"] = new SqrtPi(); Functions["pi"] = new Pi(); Functions["product"] = new Product(); Functions["ceiling"] = new Ceiling(); Functions["ceiling.precise"] = new CeilingPrecise(); Functions["ceiling.math"] = new CeilingMath(); Functions["iso.ceiling"] = new IsoCeiling(); Functions["combin"] = new Combin(); Functions["combina"] = new Combina(); Functions["permut"] = new Permut(); Functions["permutationa"] = new Permutationa(); Functions["count"] = new Count(); Functions["counta"] = new CountA(); Functions["countblank"] = new CountBlank(); Functions["countif"] = new CountIf(); Functions["countifs"] = new CountIfs(); Functions["fact"] = new Fact(); Functions["factdouble"] = new FactDouble(); Functions["floor"] = new Floor(); Functions["floor.precise"] = new FloorPrecise(); Functions["floor.math"] = new FloorMath(); Functions["radians"] = new Radians(); Functions["roman"] = new Roman(); Functions["sin"] = new Sin(); Functions["sinh"] = new Sinh(); Functions["sum"] = new Sum(); Functions["sumif"] = new SumIf(); Functions["sumifs"] = new SumIfs(); Functions["sumproduct"] = new SumProduct(); Functions["sumsq"] = new Sumsq(); Functions["sumxmy2"] = new Sumxmy2(); Functions["sumx2my2"] = new SumX2mY2(); Functions["sumx2py2"] = new SumX2pY2(); Functions["seriessum"] = new Seriessum(); Functions["stdev"] = new Stdev(); Functions["stdeva"] = new Stdeva(); Functions["stdevp"] = new StdevP(); Functions["stdevpa"] = new Stdevpa(); Functions["stdev.s"] = new StdevDotS(); Functions["stdev.p"] = new StdevDotP(); Functions["subtotal"] = new Subtotal(); Functions["exp"] = new Exp(); Functions["log"] = new Log(); Functions["log10"] = new Log10(); Functions["ln"] = new Ln(); Functions["max"] = new Max(); Functions["maxa"] = new Maxa(); Functions["median"] = new Median(); Functions["min"] = new Min(); Functions["mina"] = new Mina(); Functions["mod"] = new Mod(); Functions["mode"] = new Mode(); Functions["mode.sngl"] = new ModeSngl(); Functions["mround"] = new Mround(); Functions["multinomial"] = new Multinomial(); Functions["average"] = new Average(); Functions["averagea"] = new AverageA(); Functions["averageif"] = new AverageIf(); Functions["averageifs"] = new AverageIfs(); Functions["round"] = new Round(); Functions["rounddown"] = new Rounddown(); Functions["roundup"] = new Roundup(); Functions["rand"] = new Rand(); Functions["randbetween"] = new RandBetween(); Functions["rank"] = new Rank(); Functions["rank.eq"] = new RankEq(); Functions["rank.avg"] = new RankAvg(); Functions["percentile"] = new Percentile(); Functions["percentile.inc"] = new PercentileInc(); Functions["percentile.exc"] = new PercentileExc(); Functions["quartile"] = new Quartile(); Functions["quartile.inc"] = new QuartileInc(); Functions["quartile.exc"] = new QuartileExc(); Functions["percentrank"] = new Percentrank(); Functions["percentrank.inc"] = new PercentrankInc(); Functions["percentrank.exc"] = new PercentrankExc(); Functions["quotient"] = new Quotient(); Functions["trunc"] = new Trunc(); Functions["tan"] = new Tan(); Functions["tanh"] = new Tanh(); Functions["atan"] = new Atan(); Functions["atan2"] = new Atan2(); Functions["atanh"] = new Atanh(); Functions["acos"] = new Acos(); Functions["acosh"] = new Acosh(); Functions["covar"] = new Covar(); Functions["covariance.p"] = new CovarianceP(); Functions["covariance.s"] = new CovarianceS(); Functions["var"] = new Var(); Functions["vara"] = new Vara(); Functions["var.s"] = new VarDotS(); Functions["varp"] = new VarP(); Functions["varpa"] = new Varpa(); Functions["var.p"] = new VarDotP(); Functions["large"] = new Large(); Functions["small"] = new Small(); Functions["degrees"] = new Degrees(); Functions["odd"] = new Odd(); Functions["even"] = new Even(); // Information Functions["isblank"] = new IsBlank(); Functions["isnumber"] = new IsNumber(); Functions["istext"] = new IsText(); Functions["isnontext"] = new IsNonText(); Functions["iserror"] = new IsError(); Functions["iserr"] = new IsErr(); Functions["error.type"] = new ErrorType(); Functions["iseven"] = new IsEven(); Functions["isodd"] = new IsOdd(); Functions["islogical"] = new IsLogical(); Functions["isna"] = new IsNa(); Functions["na"] = new Na(); Functions["n"] = new N(); Functions["type"] = new TypeFunction(); // Logical Functions["if"] = new If(); Functions["ifs"] = new Ifs(); Functions["maxifs"] = new MaxIfs(); Functions["minifs"] = new MinIfs(); Functions["iferror"] = new IfError(); Functions["ifna"] = new IfNa(); Functions["not"] = new Not(); Functions["and"] = new And(); Functions["or"] = new Or(); Functions["true"] = new True(); Functions["false"] = new False(); Functions["switch"] = new Switch(); Functions["xor"] = new Xor(); // Reference and lookup Functions["address"] = new Address(); Functions["hlookup"] = new HLookup(); Functions["vlookup"] = new VLookup(); Functions["lookup"] = new Lookup(); Functions["match"] = new Match(); Functions["row"] = new Row(); Functions["rows"] = new Rows(); Functions["column"] = new Column(); Functions["columns"] = new Columns(); Functions["choose"] = new Choose(); Functions["index"] = new RefAndLookup.Index(); Functions["indirect"] = new Indirect(); Functions["offset"] = new Offset(); // Date Functions["date"] = new Date(); Functions["datedif"] = new DateDif(); Functions["today"] = new Today(); Functions["now"] = new Now(); Functions["day"] = new Day(); Functions["month"] = new Month(); Functions["year"] = new Year(); Functions["time"] = new Time(); Functions["hour"] = new Hour(); Functions["minute"] = new Minute(); Functions["second"] = new Second(); Functions["weeknum"] = new Weeknum(); Functions["weekday"] = new Weekday(); Functions["days"] = new Days(); Functions["days360"] = new Days360(); Functions["yearfrac"] = new Yearfrac(); Functions["edate"] = new Edate(); Functions["eomonth"] = new Eomonth(); Functions["isoweeknum"] = new IsoWeekNum(); Functions["workday"] = new Workday(); Functions["workday.intl"] = new WorkdayIntl(); Functions["networkdays"] = new Networkdays(); Functions["networkdays.intl"] = new NetworkdaysIntl(); Functions["datevalue"] = new DateValue(); Functions["timevalue"] = new TimeValue(); // Database Functions["dget"] = new Dget(); Functions["dcount"] = new Dcount(); Functions["dcounta"] = new DcountA(); Functions["dmax"] = new Dmax(); Functions["dmin"] = new Dmin(); Functions["dsum"] = new Dsum(); Functions["daverage"] = new Daverage(); Functions["dvar"] = new Dvar(); Functions["dvarp"] = new Dvarp(); //Finance Functions["cumipmt"] = new Cumipmt(); Functions["cumprinc"] = new Cumprinc(); Functions["dollarde"] = new DollarDe(); Functions["dollarfr"] = new DollarFr(); Functions["ddb"] = new Ddb(); Functions["effect"] = new Effect(); Functions["fvschedule"] = new FvSchedule(); Functions["pduration"] = new Pduration(); Functions["rri"] = new Rri(); Functions["pmt"] = new Pmt(); Functions["ppmt"] = new Ppmt(); Functions["ipmt"] = new Ipmt(); Functions["ispmt"] = new IsPmt(); Functions["pv"] = new Pv(); Functions["fv"] = new Fv(); Functions["npv"] = new Npv(); Functions["rate"] = new Rate(); Functions["nper"] = new Nper(); Functions["nominal"] = new Nominal(); Functions["irr"] = new Irr(); Functions["mirr"] = new Mirr(); Functions["xirr"] = new Xirr(); Functions["sln"] = new Sln(); Functions["syd"] = new Syd(); Functions["xnpv"] = new Xnpv(); Functions["coupdays"] = new Coupdays(); Functions["coupdaysnc"] = new Coupdaysnc(); Functions["coupdaybs"] = new Coupdaybs(); Functions["coupnum"] = new Coupnum(); Functions["coupncd"] = new Coupncd(); Functions["couppcd"] = new Couppcd(); Functions["price"] = new Price(); Functions["yield"] = new Yield(); Functions["yieldmat"] = new Yieldmat(); Functions["duration"] = new Duration(); Functions["disc"] = new Disc(); //Engineering Functions["bitand"] = new BitAnd(); Functions["bitor"] = new BitOr(); Functions["bitxor"] = new BitXor(); Functions["bitlshift"] = new BitLshift(); Functions["bitrshift"] = new BitRshift(); Functions["convert"] = new ConvertFunction(); Functions["bin2dec"] = new Bin2Dec(); Functions["bin2hex"] = new Bin2Hex(); Functions["bin2oct"] = new Bin2Oct(); Functions["dec2bin"] = new Dec2Bin(); Functions["dec2hex"] = new Dec2Hex(); Functions["dec2oct"] = new Dec2Oct(); Functions["hex2bin"] = new Hex2Bin(); Functions["hex2dec"] = new Hex2Dec(); Functions["hex2oct"] = new Hex2Oct(); Functions["oct2bin"] = new Oct2Bin(); Functions["oct2dec"] = new Oct2Dec(); Functions["oct2hex"] = new Oct2Hex(); Functions["delta"] = new Delta(); Functions["erf"] = new Erf(); Functions["erf.precise"] = new ErfPrecise(); Functions["erfc"] = new Erfc(); Functions["erfc.precise"] = new ErfcPrecise(); Functions["besseli"] = new BesselI(); Functions["besselj"] = new BesselJ(); Functions["besselk"] = new BesselK(); Functions["bessely"] = new BesselY(); }
public override int go() { int i, j, k, iglob, jglob; for (j = 1; j <= ny; j++) { jglob = jpt + j; for (i = 1; i <= nx; i++) { iglob = ipt + i; Exact.setParameters(iglob, jglob, 1, u, 0, j + 1, i + 1); Exact.go(); Exact.setParameters(iglob, jglob, nz, u, nz - 1, j + 1, i + 1); Exact.go(); } } if (west == -1) { for (k = 1; k <= nz; k++) { for (i = 1; i <= nx; i++) { iglob = ipt + i; Exact.setParameters(iglob, 1, k, u, k - 1, 1 + 1, i + 1); Exact.go(); } } } if (east == -1) { for (k = 1; k <= nz; k++) { for (i = 1; i <= nx; i++) { iglob = ipt + i; Exact.setParameters(iglob, ny0, k, u, k - 1, ny + 1, i + 1); Exact.go(); } } } if (north == -1) { for (k = 1; k <= nz; k++) { for (j = 1; j <= ny; j++) { jglob = jpt + j; Exact.setParameters(1, jglob, k, u, k - 1, j + 1, 1 + 1); Exact.go(); } } } if (south == -1) { for (k = 1; k <= nz; k++) { for (j = 1; j <= ny; j++) { jglob = jpt + j; Exact.setParameters(nx0, jglob, k, u, k - 1, j + 1, nx + 1); Exact.go(); } } } return(0); }
protected override Node CloneCore() { return(new Extend(Exact.Select(e => (Selector)e.Clone()).ToList(), Partial.Select(e => (Selector)e.Clone()).ToList())); }