@danielsimonjr/mathts-expression 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2248 -1
- package/dist/index.js +3725 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2842,6 +2842,3730 @@ var createHelpClass = /* @__PURE__ */ factory(
|
|
|
2842
2842
|
{ isClass: true }
|
|
2843
2843
|
);
|
|
2844
2844
|
|
|
2845
|
+
// src/embeddedDocs/constants/e.ts
|
|
2846
|
+
var eDocs = {
|
|
2847
|
+
name: "e",
|
|
2848
|
+
category: "Constants",
|
|
2849
|
+
syntax: ["e"],
|
|
2850
|
+
description: "Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",
|
|
2851
|
+
examples: ["e", "e ^ 2", "exp(2)", "log(e)"],
|
|
2852
|
+
seealso: ["exp"]
|
|
2853
|
+
};
|
|
2854
|
+
|
|
2855
|
+
// src/embeddedDocs/constants/false.ts
|
|
2856
|
+
var falseDocs = {
|
|
2857
|
+
name: "false",
|
|
2858
|
+
category: "Constants",
|
|
2859
|
+
syntax: ["false"],
|
|
2860
|
+
description: "Boolean value false",
|
|
2861
|
+
examples: ["false"],
|
|
2862
|
+
seealso: ["true"]
|
|
2863
|
+
};
|
|
2864
|
+
|
|
2865
|
+
// src/embeddedDocs/constants/i.ts
|
|
2866
|
+
var iDocs = {
|
|
2867
|
+
name: "i",
|
|
2868
|
+
category: "Constants",
|
|
2869
|
+
syntax: ["i"],
|
|
2870
|
+
description: "Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",
|
|
2871
|
+
examples: ["i", "i * i", "sqrt(-1)"],
|
|
2872
|
+
seealso: []
|
|
2873
|
+
};
|
|
2874
|
+
|
|
2875
|
+
// src/embeddedDocs/constants/Infinity.ts
|
|
2876
|
+
var InfinityDocs = {
|
|
2877
|
+
name: "Infinity",
|
|
2878
|
+
category: "Constants",
|
|
2879
|
+
syntax: ["Infinity"],
|
|
2880
|
+
description: "Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",
|
|
2881
|
+
examples: ["Infinity", "1 / 0"],
|
|
2882
|
+
seealso: []
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2885
|
+
// src/embeddedDocs/constants/LN10.ts
|
|
2886
|
+
var LN10Docs = {
|
|
2887
|
+
name: "LN10",
|
|
2888
|
+
category: "Constants",
|
|
2889
|
+
syntax: ["LN10"],
|
|
2890
|
+
description: "Returns the natural logarithm of 10, approximately equal to 2.302",
|
|
2891
|
+
examples: ["LN10", "log(10)"],
|
|
2892
|
+
seealso: []
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2895
|
+
// src/embeddedDocs/constants/LN2.ts
|
|
2896
|
+
var LN2Docs = {
|
|
2897
|
+
name: "LN2",
|
|
2898
|
+
category: "Constants",
|
|
2899
|
+
syntax: ["LN2"],
|
|
2900
|
+
description: "Returns the natural logarithm of 2, approximately equal to 0.693",
|
|
2901
|
+
examples: ["LN2", "log(2)"],
|
|
2902
|
+
seealso: []
|
|
2903
|
+
};
|
|
2904
|
+
|
|
2905
|
+
// src/embeddedDocs/constants/LOG10E.ts
|
|
2906
|
+
var LOG10EDocs = {
|
|
2907
|
+
name: "LOG10E",
|
|
2908
|
+
category: "Constants",
|
|
2909
|
+
syntax: ["LOG10E"],
|
|
2910
|
+
description: "Returns the base-10 logarithm of E, approximately equal to 0.434",
|
|
2911
|
+
examples: ["LOG10E", "log(e, 10)"],
|
|
2912
|
+
seealso: []
|
|
2913
|
+
};
|
|
2914
|
+
|
|
2915
|
+
// src/embeddedDocs/constants/LOG2E.ts
|
|
2916
|
+
var LOG2EDocs = {
|
|
2917
|
+
name: "LOG2E",
|
|
2918
|
+
category: "Constants",
|
|
2919
|
+
syntax: ["LOG2E"],
|
|
2920
|
+
description: "Returns the base-2 logarithm of E, approximately equal to 1.442",
|
|
2921
|
+
examples: ["LOG2E", "log(e, 2)"],
|
|
2922
|
+
seealso: []
|
|
2923
|
+
};
|
|
2924
|
+
|
|
2925
|
+
// src/embeddedDocs/constants/NaN.ts
|
|
2926
|
+
var NaNDocs = {
|
|
2927
|
+
name: "NaN",
|
|
2928
|
+
category: "Constants",
|
|
2929
|
+
syntax: ["NaN"],
|
|
2930
|
+
description: "Not a number",
|
|
2931
|
+
examples: ["NaN", "0 / 0"],
|
|
2932
|
+
seealso: []
|
|
2933
|
+
};
|
|
2934
|
+
|
|
2935
|
+
// src/embeddedDocs/constants/null.ts
|
|
2936
|
+
var nullDocs = {
|
|
2937
|
+
name: "null",
|
|
2938
|
+
category: "Constants",
|
|
2939
|
+
syntax: ["null"],
|
|
2940
|
+
description: "Value null",
|
|
2941
|
+
examples: ["null"],
|
|
2942
|
+
seealso: ["true", "false"]
|
|
2943
|
+
};
|
|
2944
|
+
|
|
2945
|
+
// src/embeddedDocs/constants/phi.ts
|
|
2946
|
+
var phiDocs = {
|
|
2947
|
+
name: "phi",
|
|
2948
|
+
category: "Constants",
|
|
2949
|
+
syntax: ["phi"],
|
|
2950
|
+
description: "Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",
|
|
2951
|
+
examples: ["phi"],
|
|
2952
|
+
seealso: []
|
|
2953
|
+
};
|
|
2954
|
+
|
|
2955
|
+
// src/embeddedDocs/constants/pi.ts
|
|
2956
|
+
var piDocs = {
|
|
2957
|
+
name: "pi",
|
|
2958
|
+
category: "Constants",
|
|
2959
|
+
syntax: ["pi"],
|
|
2960
|
+
description: "The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",
|
|
2961
|
+
examples: ["pi", "sin(pi/2)"],
|
|
2962
|
+
seealso: ["tau"]
|
|
2963
|
+
};
|
|
2964
|
+
|
|
2965
|
+
// src/embeddedDocs/constants/SQRT1_2.ts
|
|
2966
|
+
var SQRT12Docs = {
|
|
2967
|
+
name: "SQRT1_2",
|
|
2968
|
+
category: "Constants",
|
|
2969
|
+
syntax: ["SQRT1_2"],
|
|
2970
|
+
description: "Returns the square root of 1/2, approximately equal to 0.707",
|
|
2971
|
+
examples: ["SQRT1_2", "sqrt(1/2)"],
|
|
2972
|
+
seealso: []
|
|
2973
|
+
};
|
|
2974
|
+
|
|
2975
|
+
// src/embeddedDocs/constants/SQRT2.ts
|
|
2976
|
+
var SQRT2Docs = {
|
|
2977
|
+
name: "SQRT2",
|
|
2978
|
+
category: "Constants",
|
|
2979
|
+
syntax: ["SQRT2"],
|
|
2980
|
+
description: "Returns the square root of 2, approximately equal to 1.414",
|
|
2981
|
+
examples: ["SQRT2", "sqrt(2)"],
|
|
2982
|
+
seealso: []
|
|
2983
|
+
};
|
|
2984
|
+
|
|
2985
|
+
// src/embeddedDocs/constants/tau.ts
|
|
2986
|
+
var tauDocs = {
|
|
2987
|
+
name: "tau",
|
|
2988
|
+
category: "Constants",
|
|
2989
|
+
syntax: ["tau"],
|
|
2990
|
+
description: "Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",
|
|
2991
|
+
examples: ["tau", "2 * pi"],
|
|
2992
|
+
seealso: ["pi"]
|
|
2993
|
+
};
|
|
2994
|
+
|
|
2995
|
+
// src/embeddedDocs/constants/true.ts
|
|
2996
|
+
var trueDocs = {
|
|
2997
|
+
name: "true",
|
|
2998
|
+
category: "Constants",
|
|
2999
|
+
syntax: ["true"],
|
|
3000
|
+
description: "Boolean value true",
|
|
3001
|
+
examples: ["true"],
|
|
3002
|
+
seealso: ["false"]
|
|
3003
|
+
};
|
|
3004
|
+
|
|
3005
|
+
// src/embeddedDocs/constants/version.ts
|
|
3006
|
+
var versionDocs = {
|
|
3007
|
+
name: "version",
|
|
3008
|
+
category: "Constants",
|
|
3009
|
+
syntax: ["version"],
|
|
3010
|
+
description: "A string with the version number of math.js",
|
|
3011
|
+
examples: ["version"],
|
|
3012
|
+
seealso: []
|
|
3013
|
+
};
|
|
3014
|
+
|
|
3015
|
+
// src/embeddedDocs/construction/bignumber.ts
|
|
3016
|
+
var bignumberDocs = {
|
|
3017
|
+
name: "bignumber",
|
|
3018
|
+
category: "Construction",
|
|
3019
|
+
syntax: ["bignumber(x)"],
|
|
3020
|
+
description: "Create a big number from a number or string.",
|
|
3021
|
+
examples: [
|
|
3022
|
+
"0.1 + 0.2",
|
|
3023
|
+
"bignumber(0.1) + bignumber(0.2)",
|
|
3024
|
+
'bignumber("7.2")',
|
|
3025
|
+
'bignumber("7.2e500")',
|
|
3026
|
+
"bignumber([0.1, 0.2, 0.3])"
|
|
3027
|
+
],
|
|
3028
|
+
seealso: ["boolean", "bigint", "complex", "fraction", "index", "matrix", "string", "unit"]
|
|
3029
|
+
};
|
|
3030
|
+
|
|
3031
|
+
// src/embeddedDocs/construction/bigint.ts
|
|
3032
|
+
var bigintDocs = {
|
|
3033
|
+
name: "bigint",
|
|
3034
|
+
category: "Construction",
|
|
3035
|
+
syntax: ["bigint(x)"],
|
|
3036
|
+
description: "Create a bigint, an integer with an arbitrary number of digits, from a number or string.",
|
|
3037
|
+
examples: [
|
|
3038
|
+
"123123123123123123 # a large number will lose digits",
|
|
3039
|
+
'bigint("123123123123123123")',
|
|
3040
|
+
'bignumber(["1", "3", "5"])'
|
|
3041
|
+
],
|
|
3042
|
+
seealso: [
|
|
3043
|
+
"boolean",
|
|
3044
|
+
"bignumber",
|
|
3045
|
+
"number",
|
|
3046
|
+
"complex",
|
|
3047
|
+
"fraction",
|
|
3048
|
+
"index",
|
|
3049
|
+
"matrix",
|
|
3050
|
+
"string",
|
|
3051
|
+
"unit"
|
|
3052
|
+
]
|
|
3053
|
+
};
|
|
3054
|
+
|
|
3055
|
+
// src/embeddedDocs/construction/boolean.ts
|
|
3056
|
+
var booleanDocs = {
|
|
3057
|
+
name: "boolean",
|
|
3058
|
+
category: "Construction",
|
|
3059
|
+
syntax: ["x", "boolean(x)"],
|
|
3060
|
+
description: "Convert a string or number into a boolean.",
|
|
3061
|
+
examples: [
|
|
3062
|
+
"boolean(0)",
|
|
3063
|
+
"boolean(1)",
|
|
3064
|
+
"boolean(3)",
|
|
3065
|
+
'boolean("true")',
|
|
3066
|
+
'boolean("false")',
|
|
3067
|
+
"boolean([1, 0, 1, 1])"
|
|
3068
|
+
],
|
|
3069
|
+
seealso: ["bignumber", "complex", "index", "matrix", "number", "string", "unit"]
|
|
3070
|
+
};
|
|
3071
|
+
|
|
3072
|
+
// src/embeddedDocs/construction/complex.ts
|
|
3073
|
+
var complexDocs = {
|
|
3074
|
+
name: "complex",
|
|
3075
|
+
category: "Construction",
|
|
3076
|
+
syntax: ["complex()", "complex(re, im)", "complex(string)"],
|
|
3077
|
+
description: "Create a complex number.",
|
|
3078
|
+
examples: ["complex()", "complex(2, 3)", 'complex("7 - 2i")'],
|
|
3079
|
+
seealso: ["bignumber", "boolean", "index", "matrix", "number", "string", "unit"]
|
|
3080
|
+
};
|
|
3081
|
+
|
|
3082
|
+
// src/embeddedDocs/construction/createUnit.ts
|
|
3083
|
+
var createUnitDocs = {
|
|
3084
|
+
name: "createUnit",
|
|
3085
|
+
category: "Construction",
|
|
3086
|
+
syntax: ["createUnit(definitions)", "createUnit(name, definition)"],
|
|
3087
|
+
description: "Create a user-defined unit and register it with the Unit type.",
|
|
3088
|
+
examples: [
|
|
3089
|
+
'createUnit("foo")',
|
|
3090
|
+
'createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})',
|
|
3091
|
+
'createUnit("mph", "1 mile/hour")'
|
|
3092
|
+
],
|
|
3093
|
+
seealso: ["unit", "splitUnit"]
|
|
3094
|
+
};
|
|
3095
|
+
|
|
3096
|
+
// src/embeddedDocs/construction/fraction.ts
|
|
3097
|
+
var fractionDocs = {
|
|
3098
|
+
name: "fraction",
|
|
3099
|
+
category: "Construction",
|
|
3100
|
+
syntax: ["fraction(num)", "fraction(matrix)", "fraction(num,den)", "fraction({n: num, d: den})"],
|
|
3101
|
+
description: "Create a fraction from a number or from integer numerator and denominator.",
|
|
3102
|
+
examples: [
|
|
3103
|
+
"fraction(0.125)",
|
|
3104
|
+
"fraction(1, 3) + fraction(2, 5)",
|
|
3105
|
+
"fraction({n: 333, d: 53})",
|
|
3106
|
+
"fraction([sqrt(9), sqrt(10), sqrt(11)])"
|
|
3107
|
+
],
|
|
3108
|
+
seealso: ["bignumber", "boolean", "complex", "index", "matrix", "string", "unit"]
|
|
3109
|
+
};
|
|
3110
|
+
|
|
3111
|
+
// src/embeddedDocs/construction/index.ts
|
|
3112
|
+
var indexDocs = {
|
|
3113
|
+
name: "index",
|
|
3114
|
+
category: "Construction",
|
|
3115
|
+
syntax: [
|
|
3116
|
+
"[start]",
|
|
3117
|
+
"[start:end]",
|
|
3118
|
+
"[start:step:end]",
|
|
3119
|
+
"[start1, start 2, ...]",
|
|
3120
|
+
"[start1:end1, start2:end2, ...]",
|
|
3121
|
+
"[start1:step1:end1, start2:step2:end2, ...]"
|
|
3122
|
+
],
|
|
3123
|
+
description: "Create an index to get or replace a subset of a matrix",
|
|
3124
|
+
examples: [
|
|
3125
|
+
"A = [1, 2, 3; 4, 5, 6]",
|
|
3126
|
+
"A[1, :]",
|
|
3127
|
+
"A[1, 2] = 50",
|
|
3128
|
+
"A[1:2, 1:2] = 1",
|
|
3129
|
+
"B = [1, 2, 3]",
|
|
3130
|
+
"B[B>1 and B<3]"
|
|
3131
|
+
],
|
|
3132
|
+
seealso: ["bignumber", "boolean", "complex", "matrix", "number", "range", "string", "unit"]
|
|
3133
|
+
};
|
|
3134
|
+
|
|
3135
|
+
// src/embeddedDocs/construction/matrix.ts
|
|
3136
|
+
var matrixDocs = {
|
|
3137
|
+
name: "matrix",
|
|
3138
|
+
category: "Construction",
|
|
3139
|
+
syntax: ["[]", "[a1, b1, ...; a2, b2, ...]", "matrix()", 'matrix("dense")', "matrix([...])"],
|
|
3140
|
+
description: "Create a matrix.",
|
|
3141
|
+
examples: [
|
|
3142
|
+
"[]",
|
|
3143
|
+
"[1, 2, 3]",
|
|
3144
|
+
"[1, 2, 3; 4, 5, 6]",
|
|
3145
|
+
"matrix()",
|
|
3146
|
+
"matrix([3, 4])",
|
|
3147
|
+
'matrix([3, 4; 5, 6], "sparse")',
|
|
3148
|
+
'matrix([3, 4; 5, 6], "sparse", "number")'
|
|
3149
|
+
],
|
|
3150
|
+
seealso: ["bignumber", "boolean", "complex", "index", "number", "string", "unit", "sparse"]
|
|
3151
|
+
};
|
|
3152
|
+
|
|
3153
|
+
// src/embeddedDocs/construction/number.ts
|
|
3154
|
+
var numberDocs = {
|
|
3155
|
+
name: "number",
|
|
3156
|
+
category: "Construction",
|
|
3157
|
+
syntax: ["x", "number(x)", "number(unit, valuelessUnit)"],
|
|
3158
|
+
description: "Create a number or convert a string or boolean into a number.",
|
|
3159
|
+
examples: [
|
|
3160
|
+
"2",
|
|
3161
|
+
"2e3",
|
|
3162
|
+
"4.05",
|
|
3163
|
+
"number(2)",
|
|
3164
|
+
'number("7.2")',
|
|
3165
|
+
"number(true)",
|
|
3166
|
+
"number([true, false, true, true])",
|
|
3167
|
+
'number(unit("52cm"), "m")'
|
|
3168
|
+
],
|
|
3169
|
+
seealso: [
|
|
3170
|
+
"bignumber",
|
|
3171
|
+
"bigint",
|
|
3172
|
+
"boolean",
|
|
3173
|
+
"complex",
|
|
3174
|
+
"fraction",
|
|
3175
|
+
"index",
|
|
3176
|
+
"matrix",
|
|
3177
|
+
"string",
|
|
3178
|
+
"unit"
|
|
3179
|
+
]
|
|
3180
|
+
};
|
|
3181
|
+
|
|
3182
|
+
// src/embeddedDocs/construction/sparse.ts
|
|
3183
|
+
var sparseDocs = {
|
|
3184
|
+
name: "sparse",
|
|
3185
|
+
category: "Construction",
|
|
3186
|
+
syntax: [
|
|
3187
|
+
"sparse()",
|
|
3188
|
+
"sparse([a1, b1, ...; a1, b2, ...])",
|
|
3189
|
+
'sparse([a1, b1, ...; a1, b2, ...], "number")'
|
|
3190
|
+
],
|
|
3191
|
+
description: "Create a sparse matrix.",
|
|
3192
|
+
examples: ["sparse()", "sparse([3, 4; 5, 6])", 'sparse([3, 0; 5, 0], "number")'],
|
|
3193
|
+
seealso: ["bignumber", "boolean", "complex", "index", "number", "string", "unit", "matrix"]
|
|
3194
|
+
};
|
|
3195
|
+
|
|
3196
|
+
// src/embeddedDocs/construction/splitUnit.ts
|
|
3197
|
+
var splitUnitDocs = {
|
|
3198
|
+
name: "splitUnit",
|
|
3199
|
+
category: "Construction",
|
|
3200
|
+
syntax: ["splitUnit(unit: Unit, parts: Unit[])"],
|
|
3201
|
+
description: "Split a unit in an array of units whose sum is equal to the original unit.",
|
|
3202
|
+
examples: ['splitUnit(1 m, ["feet", "inch"])'],
|
|
3203
|
+
seealso: ["unit", "createUnit"]
|
|
3204
|
+
};
|
|
3205
|
+
|
|
3206
|
+
// src/embeddedDocs/construction/string.ts
|
|
3207
|
+
var stringDocs = {
|
|
3208
|
+
name: "string",
|
|
3209
|
+
category: "Construction",
|
|
3210
|
+
syntax: ['"text"', "string(x)"],
|
|
3211
|
+
description: "Create a string or convert a value to a string",
|
|
3212
|
+
examples: ['"Hello World!"', "string(4.2)", "string(3 + 2i)"],
|
|
3213
|
+
seealso: ["bignumber", "boolean", "complex", "index", "matrix", "number", "unit"]
|
|
3214
|
+
};
|
|
3215
|
+
|
|
3216
|
+
// src/embeddedDocs/construction/unit.ts
|
|
3217
|
+
var unitDocs = {
|
|
3218
|
+
name: "unit",
|
|
3219
|
+
category: "Construction",
|
|
3220
|
+
syntax: ["value unit", "unit(value, unit)", "unit(string)"],
|
|
3221
|
+
description: "Create a unit.",
|
|
3222
|
+
examples: ["5.5 mm", "3 inch", 'unit(7.1, "kilogram")', 'unit("23 deg")'],
|
|
3223
|
+
seealso: ["bignumber", "boolean", "complex", "index", "matrix", "number", "string"]
|
|
3224
|
+
};
|
|
3225
|
+
|
|
3226
|
+
// src/embeddedDocs/core/config.ts
|
|
3227
|
+
var configDocs = {
|
|
3228
|
+
name: "config",
|
|
3229
|
+
category: "Core",
|
|
3230
|
+
syntax: ["config()", "config(options)"],
|
|
3231
|
+
description: "Get configuration or change configuration.",
|
|
3232
|
+
examples: ["config()", "1/3 + 1/4", 'config({number: "Fraction"})', "1/3 + 1/4"],
|
|
3233
|
+
seealso: []
|
|
3234
|
+
};
|
|
3235
|
+
|
|
3236
|
+
// src/embeddedDocs/core/import.ts
|
|
3237
|
+
var importDocs = {
|
|
3238
|
+
name: "import",
|
|
3239
|
+
category: "Core",
|
|
3240
|
+
syntax: ["import(functions)", "import(functions, options)"],
|
|
3241
|
+
description: "Import functions or constants from an object.",
|
|
3242
|
+
examples: ["import({myFn: f(x)=x^2, myConstant: 32 })", "myFn(2)", "myConstant"],
|
|
3243
|
+
seealso: []
|
|
3244
|
+
};
|
|
3245
|
+
|
|
3246
|
+
// src/embeddedDocs/core/typed.ts
|
|
3247
|
+
var typedDocs = {
|
|
3248
|
+
name: "typed",
|
|
3249
|
+
category: "Core",
|
|
3250
|
+
syntax: ["typed(signatures)", "typed(name, signatures)"],
|
|
3251
|
+
description: "Create a typed function.",
|
|
3252
|
+
examples: [
|
|
3253
|
+
'double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',
|
|
3254
|
+
"double(2)",
|
|
3255
|
+
'double("hello")'
|
|
3256
|
+
],
|
|
3257
|
+
seealso: []
|
|
3258
|
+
};
|
|
3259
|
+
|
|
3260
|
+
// src/embeddedDocs/function/algebra/derivative.ts
|
|
3261
|
+
var derivativeDocs = {
|
|
3262
|
+
name: "derivative",
|
|
3263
|
+
category: "Algebra",
|
|
3264
|
+
syntax: ["derivative(expr, variable)", "derivative(expr, variable, {simplify: boolean})"],
|
|
3265
|
+
description: "Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",
|
|
3266
|
+
examples: [
|
|
3267
|
+
'derivative("2x^3", "x")',
|
|
3268
|
+
'derivative("2x^3", "x", {simplify: false})',
|
|
3269
|
+
'derivative("2x^2 + 3x + 4", "x")',
|
|
3270
|
+
'derivative("sin(2x)", "x")',
|
|
3271
|
+
'f = parse("x^2 + x")',
|
|
3272
|
+
'x = parse("x")',
|
|
3273
|
+
"df = derivative(f, x)",
|
|
3274
|
+
"df.evaluate({x: 3})"
|
|
3275
|
+
],
|
|
3276
|
+
seealso: ["simplify", "parse", "evaluate"]
|
|
3277
|
+
};
|
|
3278
|
+
|
|
3279
|
+
// src/embeddedDocs/function/algebra/leafCount.ts
|
|
3280
|
+
var leafCountDocs = {
|
|
3281
|
+
name: "leafCount",
|
|
3282
|
+
category: "Algebra",
|
|
3283
|
+
syntax: ["leafCount(expr)"],
|
|
3284
|
+
description: "Computes the number of leaves in the parse tree of the given expression",
|
|
3285
|
+
examples: ['leafCount("e^(i*pi)-1")', 'leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],
|
|
3286
|
+
seealso: ["simplify"]
|
|
3287
|
+
};
|
|
3288
|
+
|
|
3289
|
+
// src/embeddedDocs/function/algebra/lsolve.ts
|
|
3290
|
+
var lsolveDocs = {
|
|
3291
|
+
name: "lsolve",
|
|
3292
|
+
category: "Algebra",
|
|
3293
|
+
syntax: ["x=lsolve(L, b)"],
|
|
3294
|
+
description: "Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",
|
|
3295
|
+
examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lsolve(a, b)"],
|
|
3296
|
+
seealso: ["lsolveAll", "lup", "lusolve", "usolve", "matrix", "sparse"]
|
|
3297
|
+
};
|
|
3298
|
+
|
|
3299
|
+
// src/embeddedDocs/function/algebra/lsolveAll.ts
|
|
3300
|
+
var lsolveAllDocs = {
|
|
3301
|
+
name: "lsolveAll",
|
|
3302
|
+
category: "Algebra",
|
|
3303
|
+
syntax: ["x=lsolveAll(L, b)"],
|
|
3304
|
+
description: "Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",
|
|
3305
|
+
examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lsolve(a, b)"],
|
|
3306
|
+
seealso: ["lsolve", "lup", "lusolve", "usolve", "matrix", "sparse"]
|
|
3307
|
+
};
|
|
3308
|
+
|
|
3309
|
+
// src/embeddedDocs/function/algebra/lup.ts
|
|
3310
|
+
var lupDocs = {
|
|
3311
|
+
name: "lup",
|
|
3312
|
+
category: "Algebra",
|
|
3313
|
+
syntax: ["lup(m)"],
|
|
3314
|
+
description: "Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",
|
|
3315
|
+
examples: [
|
|
3316
|
+
"lup([[2, 1], [1, 4]])",
|
|
3317
|
+
"lup(matrix([[2, 1], [1, 4]]))",
|
|
3318
|
+
"lup(sparse([[2, 1], [1, 4]]))"
|
|
3319
|
+
],
|
|
3320
|
+
seealso: ["lusolve", "lsolve", "usolve", "matrix", "sparse", "slu", "qr"]
|
|
3321
|
+
};
|
|
3322
|
+
|
|
3323
|
+
// src/embeddedDocs/function/algebra/lusolve.ts
|
|
3324
|
+
var lusolveDocs = {
|
|
3325
|
+
name: "lusolve",
|
|
3326
|
+
category: "Algebra",
|
|
3327
|
+
syntax: ["x=lusolve(A, b)", "x=lusolve(lu, b)"],
|
|
3328
|
+
description: "Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",
|
|
3329
|
+
examples: ["a = [-2, 3; 2, 1]", "b = [11, 9]", "x = lusolve(a, b)"],
|
|
3330
|
+
seealso: ["lup", "slu", "lsolve", "usolve", "matrix", "sparse"]
|
|
3331
|
+
};
|
|
3332
|
+
|
|
3333
|
+
// src/embeddedDocs/function/algebra/polynomialRoot.ts
|
|
3334
|
+
var polynomialRootDocs = {
|
|
3335
|
+
name: "polynomialRoot",
|
|
3336
|
+
category: "Algebra",
|
|
3337
|
+
syntax: [
|
|
3338
|
+
"x=polynomialRoot(-6, 3)",
|
|
3339
|
+
"x=polynomialRoot(4, -4, 1)",
|
|
3340
|
+
"x=polynomialRoot(-8, 12, -6, 1)"
|
|
3341
|
+
],
|
|
3342
|
+
description: "Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",
|
|
3343
|
+
examples: ["a = polynomialRoot(-6, 11, -6, 1)"],
|
|
3344
|
+
seealso: ["cbrt", "sqrt"]
|
|
3345
|
+
};
|
|
3346
|
+
|
|
3347
|
+
// src/embeddedDocs/function/algebra/qr.ts
|
|
3348
|
+
var qrDocs = {
|
|
3349
|
+
name: "qr",
|
|
3350
|
+
category: "Algebra",
|
|
3351
|
+
syntax: ["qr(A)"],
|
|
3352
|
+
description: "Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",
|
|
3353
|
+
examples: ["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],
|
|
3354
|
+
seealso: ["lup", "slu", "matrix"]
|
|
3355
|
+
};
|
|
3356
|
+
|
|
3357
|
+
// src/embeddedDocs/function/algebra/rationalize.ts
|
|
3358
|
+
var rationalizeDocs = {
|
|
3359
|
+
name: "rationalize",
|
|
3360
|
+
category: "Algebra",
|
|
3361
|
+
syntax: ["rationalize(expr)", "rationalize(expr, scope)", "rationalize(expr, scope, detailed)"],
|
|
3362
|
+
description: "Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",
|
|
3363
|
+
examples: ['rationalize("2x/y - y/(x+1)")', 'rationalize("2x/y - y/(x+1)", true)'],
|
|
3364
|
+
seealso: ["simplify"]
|
|
3365
|
+
};
|
|
3366
|
+
|
|
3367
|
+
// src/embeddedDocs/function/algebra/resolve.ts
|
|
3368
|
+
var resolveDocs = {
|
|
3369
|
+
name: "resolve",
|
|
3370
|
+
category: "Algebra",
|
|
3371
|
+
syntax: ["resolve(node, scope)"],
|
|
3372
|
+
description: "Recursively substitute variables in an expression tree.",
|
|
3373
|
+
examples: [
|
|
3374
|
+
'resolve(parse("1 + x"), { x: 7 })',
|
|
3375
|
+
'resolve(parse("size(text)"), { text: "Hello World" })',
|
|
3376
|
+
'resolve(parse("x + y"), { x: parse("3z") })',
|
|
3377
|
+
'resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'
|
|
3378
|
+
],
|
|
3379
|
+
seealso: ["simplify", "evaluate"],
|
|
3380
|
+
mayThrow: ["ReferenceError"]
|
|
3381
|
+
};
|
|
3382
|
+
|
|
3383
|
+
// src/embeddedDocs/function/algebra/simplify.ts
|
|
3384
|
+
var simplifyDocs = {
|
|
3385
|
+
name: "simplify",
|
|
3386
|
+
category: "Algebra",
|
|
3387
|
+
syntax: ["simplify(expr)", "simplify(expr, rules)"],
|
|
3388
|
+
description: "Simplify an expression tree.",
|
|
3389
|
+
examples: [
|
|
3390
|
+
'simplify("3 + 2 / 4")',
|
|
3391
|
+
'simplify("2x + x")',
|
|
3392
|
+
'f = parse("x * (x + 2 + x)")',
|
|
3393
|
+
"simplified = simplify(f)",
|
|
3394
|
+
"simplified.evaluate({x: 2})"
|
|
3395
|
+
],
|
|
3396
|
+
seealso: ["simplifyCore", "derivative", "evaluate", "parse", "rationalize", "resolve"]
|
|
3397
|
+
};
|
|
3398
|
+
|
|
3399
|
+
// src/embeddedDocs/function/algebra/simplifyConstant.ts
|
|
3400
|
+
var simplifyConstantDocs = {
|
|
3401
|
+
name: "simplifyConstant",
|
|
3402
|
+
category: "Algebra",
|
|
3403
|
+
syntax: ["simplifyConstant(expr)", "simplifyConstant(expr, options)"],
|
|
3404
|
+
description: "Replace constant subexpressions of node with their values.",
|
|
3405
|
+
examples: ['simplifyConstant("(3-3)*x")', 'simplifyConstant(parse("z-cos(tau/8)"))'],
|
|
3406
|
+
seealso: ["simplify", "simplifyCore", "evaluate"]
|
|
3407
|
+
};
|
|
3408
|
+
|
|
3409
|
+
// src/embeddedDocs/function/algebra/simplifyCore.ts
|
|
3410
|
+
var simplifyCoreDocs = {
|
|
3411
|
+
name: "simplifyCore",
|
|
3412
|
+
category: "Algebra",
|
|
3413
|
+
syntax: ["simplifyCore(node)"],
|
|
3414
|
+
description: "Perform simple one-pass simplifications on an expression tree.",
|
|
3415
|
+
examples: ['simplifyCore(parse("0*x"))', 'simplifyCore(parse("(x+0)*2"))'],
|
|
3416
|
+
seealso: ["simplify", "simplifyConstant", "evaluate"]
|
|
3417
|
+
};
|
|
3418
|
+
|
|
3419
|
+
// src/embeddedDocs/function/algebra/slu.ts
|
|
3420
|
+
var sluDocs = {
|
|
3421
|
+
name: "slu",
|
|
3422
|
+
category: "Algebra",
|
|
3423
|
+
syntax: ["slu(A, order, threshold)"],
|
|
3424
|
+
description: "Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",
|
|
3425
|
+
examples: [
|
|
3426
|
+
"slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"
|
|
3427
|
+
],
|
|
3428
|
+
seealso: ["lusolve", "lsolve", "usolve", "matrix", "sparse", "lup", "qr"]
|
|
3429
|
+
};
|
|
3430
|
+
|
|
3431
|
+
// src/embeddedDocs/function/algebra/symbolicEqual.ts
|
|
3432
|
+
var symbolicEqualDocs = {
|
|
3433
|
+
name: "symbolicEqual",
|
|
3434
|
+
category: "Algebra",
|
|
3435
|
+
syntax: ["symbolicEqual(expr1, expr2)", "symbolicEqual(expr1, expr2, options)"],
|
|
3436
|
+
description: "Returns true if the difference of the expressions simplifies to 0",
|
|
3437
|
+
examples: [
|
|
3438
|
+
'symbolicEqual("x*y","y*x")',
|
|
3439
|
+
'symbolicEqual("abs(x^2)", "x^2")',
|
|
3440
|
+
'symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'
|
|
3441
|
+
],
|
|
3442
|
+
seealso: ["simplify", "evaluate"]
|
|
3443
|
+
};
|
|
3444
|
+
|
|
3445
|
+
// src/embeddedDocs/function/algebra/usolve.ts
|
|
3446
|
+
var usolveDocs = {
|
|
3447
|
+
name: "usolve",
|
|
3448
|
+
category: "Algebra",
|
|
3449
|
+
syntax: ["x=usolve(U, b)"],
|
|
3450
|
+
description: "Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",
|
|
3451
|
+
examples: ["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],
|
|
3452
|
+
seealso: ["usolveAll", "lup", "lusolve", "lsolve", "matrix", "sparse"]
|
|
3453
|
+
};
|
|
3454
|
+
|
|
3455
|
+
// src/embeddedDocs/function/algebra/usolveAll.ts
|
|
3456
|
+
var usolveAllDocs = {
|
|
3457
|
+
name: "usolveAll",
|
|
3458
|
+
category: "Algebra",
|
|
3459
|
+
syntax: ["x=usolve(U, b)"],
|
|
3460
|
+
description: "Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",
|
|
3461
|
+
examples: ["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],
|
|
3462
|
+
seealso: ["usolve", "lup", "lusolve", "lsolve", "matrix", "sparse"]
|
|
3463
|
+
};
|
|
3464
|
+
|
|
3465
|
+
// src/embeddedDocs/function/arithmetic/abs.ts
|
|
3466
|
+
var absDocs = {
|
|
3467
|
+
name: "abs",
|
|
3468
|
+
category: "Arithmetic",
|
|
3469
|
+
syntax: ["abs(x)"],
|
|
3470
|
+
description: "Compute the absolute value.",
|
|
3471
|
+
examples: ["abs(3.5)", "abs(-4.2)"],
|
|
3472
|
+
seealso: ["sign"]
|
|
3473
|
+
};
|
|
3474
|
+
|
|
3475
|
+
// src/embeddedDocs/function/arithmetic/add.ts
|
|
3476
|
+
var addDocs = {
|
|
3477
|
+
name: "add",
|
|
3478
|
+
category: "Operators",
|
|
3479
|
+
syntax: ["x + y", "add(x, y)"],
|
|
3480
|
+
description: "Add two values.",
|
|
3481
|
+
examples: ["a = 2.1 + 3.6", "a - 3.6", "3 + 2i", "3 cm + 2 inch", '"2.3" + "4"'],
|
|
3482
|
+
seealso: ["subtract"]
|
|
3483
|
+
};
|
|
3484
|
+
|
|
3485
|
+
// src/embeddedDocs/function/arithmetic/cbrt.ts
|
|
3486
|
+
var cbrtDocs = {
|
|
3487
|
+
name: "cbrt",
|
|
3488
|
+
category: "Arithmetic",
|
|
3489
|
+
syntax: ["cbrt(x)", "cbrt(x, allRoots)"],
|
|
3490
|
+
description: "Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",
|
|
3491
|
+
examples: [
|
|
3492
|
+
"cbrt(64)",
|
|
3493
|
+
"cube(4)",
|
|
3494
|
+
"cbrt(-8)",
|
|
3495
|
+
"cbrt(2 + 3i)",
|
|
3496
|
+
"cbrt(8i)",
|
|
3497
|
+
"cbrt(8i, true)",
|
|
3498
|
+
"cbrt(27 m^3)"
|
|
3499
|
+
],
|
|
3500
|
+
seealso: ["square", "sqrt", "cube", "multiply"]
|
|
3501
|
+
};
|
|
3502
|
+
|
|
3503
|
+
// src/embeddedDocs/function/arithmetic/ceil.ts
|
|
3504
|
+
var ceilDocs = {
|
|
3505
|
+
name: "ceil",
|
|
3506
|
+
category: "Arithmetic",
|
|
3507
|
+
syntax: ["ceil(x)", "ceil(x, n)", "ceil(unit, valuelessUnit)", "ceil(unit, n, valuelessUnit)"],
|
|
3508
|
+
description: "Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",
|
|
3509
|
+
examples: ["ceil(3.2)", "ceil(3.8)", "ceil(-4.2)", "ceil(3.241cm, cm)", "ceil(3.241cm, 2, cm)"],
|
|
3510
|
+
seealso: ["floor", "fix", "round"]
|
|
3511
|
+
};
|
|
3512
|
+
|
|
3513
|
+
// src/embeddedDocs/function/arithmetic/cube.ts
|
|
3514
|
+
var cubeDocs = {
|
|
3515
|
+
name: "cube",
|
|
3516
|
+
category: "Arithmetic",
|
|
3517
|
+
syntax: ["cube(x)"],
|
|
3518
|
+
description: "Compute the cube of a value. The cube of x is x * x * x.",
|
|
3519
|
+
examples: ["cube(2)", "2^3", "2 * 2 * 2"],
|
|
3520
|
+
seealso: ["multiply", "square", "pow"]
|
|
3521
|
+
};
|
|
3522
|
+
|
|
3523
|
+
// src/embeddedDocs/function/arithmetic/divide.ts
|
|
3524
|
+
var divideDocs = {
|
|
3525
|
+
name: "divide",
|
|
3526
|
+
category: "Operators",
|
|
3527
|
+
syntax: ["x / y", "divide(x, y)"],
|
|
3528
|
+
description: "Divide two values.",
|
|
3529
|
+
examples: ["a = 2 / 3", "a * 3", "4.5 / 2", "3 + 4 / 2", "(3 + 4) / 2", "18 km / 4.5"],
|
|
3530
|
+
seealso: ["multiply"]
|
|
3531
|
+
};
|
|
3532
|
+
|
|
3533
|
+
// src/embeddedDocs/function/arithmetic/dotDivide.ts
|
|
3534
|
+
var dotDivideDocs = {
|
|
3535
|
+
name: "dotDivide",
|
|
3536
|
+
category: "Operators",
|
|
3537
|
+
syntax: ["x ./ y", "dotDivide(x, y)"],
|
|
3538
|
+
description: "Divide two values element wise.",
|
|
3539
|
+
examples: ["a = [1, 2, 3; 4, 5, 6]", "b = [2, 1, 1; 3, 2, 5]", "a ./ b"],
|
|
3540
|
+
seealso: ["multiply", "dotMultiply", "divide"]
|
|
3541
|
+
};
|
|
3542
|
+
|
|
3543
|
+
// src/embeddedDocs/function/arithmetic/dotMultiply.ts
|
|
3544
|
+
var dotMultiplyDocs = {
|
|
3545
|
+
name: "dotMultiply",
|
|
3546
|
+
category: "Operators",
|
|
3547
|
+
syntax: ["x .* y", "dotMultiply(x, y)"],
|
|
3548
|
+
description: "Multiply two values element wise.",
|
|
3549
|
+
examples: ["a = [1, 2, 3; 4, 5, 6]", "b = [2, 1, 1; 3, 2, 5]", "a .* b"],
|
|
3550
|
+
seealso: ["multiply", "divide", "dotDivide"]
|
|
3551
|
+
};
|
|
3552
|
+
|
|
3553
|
+
// src/embeddedDocs/function/arithmetic/dotPow.ts
|
|
3554
|
+
var dotPowDocs = {
|
|
3555
|
+
name: "dotPow",
|
|
3556
|
+
category: "Operators",
|
|
3557
|
+
syntax: ["x .^ y", "dotPow(x, y)"],
|
|
3558
|
+
description: "Calculates the power of x to y element wise.",
|
|
3559
|
+
examples: ["a = [1, 2, 3; 4, 5, 6]", "a .^ 2"],
|
|
3560
|
+
seealso: ["pow"]
|
|
3561
|
+
};
|
|
3562
|
+
|
|
3563
|
+
// src/embeddedDocs/function/arithmetic/exp.ts
|
|
3564
|
+
var expDocs = {
|
|
3565
|
+
name: "exp",
|
|
3566
|
+
category: "Arithmetic",
|
|
3567
|
+
syntax: ["exp(x)"],
|
|
3568
|
+
description: "Calculate the exponent of a value.",
|
|
3569
|
+
examples: [
|
|
3570
|
+
"exp(1.3)",
|
|
3571
|
+
"e ^ 1.3",
|
|
3572
|
+
"log(exp(1.3))",
|
|
3573
|
+
"x = 2.4",
|
|
3574
|
+
"(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"
|
|
3575
|
+
],
|
|
3576
|
+
seealso: ["expm", "expm1", "pow", "log"]
|
|
3577
|
+
};
|
|
3578
|
+
|
|
3579
|
+
// src/embeddedDocs/function/arithmetic/expm.ts
|
|
3580
|
+
var expmDocs = {
|
|
3581
|
+
name: "expm",
|
|
3582
|
+
category: "Arithmetic",
|
|
3583
|
+
syntax: ["exp(x)"],
|
|
3584
|
+
description: "Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",
|
|
3585
|
+
examples: ["expm([[0,2],[0,0]])"],
|
|
3586
|
+
seealso: ["exp"]
|
|
3587
|
+
};
|
|
3588
|
+
|
|
3589
|
+
// src/embeddedDocs/function/arithmetic/expm1.ts
|
|
3590
|
+
var expm1Docs = {
|
|
3591
|
+
name: "expm1",
|
|
3592
|
+
category: "Arithmetic",
|
|
3593
|
+
syntax: ["expm1(x)"],
|
|
3594
|
+
description: "Calculate the value of subtracting 1 from the exponential value.",
|
|
3595
|
+
examples: ["expm1(2)", "pow(e, 2) - 1", "log(expm1(2) + 1)"],
|
|
3596
|
+
seealso: ["exp", "pow", "log"]
|
|
3597
|
+
};
|
|
3598
|
+
|
|
3599
|
+
// src/embeddedDocs/function/arithmetic/fix.ts
|
|
3600
|
+
var fixDocs = {
|
|
3601
|
+
name: "fix",
|
|
3602
|
+
category: "Arithmetic",
|
|
3603
|
+
syntax: ["fix(x)", "fix(x, n)", "fix(unit, valuelessUnit)", "fix(unit, n, valuelessUnit)"],
|
|
3604
|
+
description: "Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",
|
|
3605
|
+
examples: [
|
|
3606
|
+
"fix(3.2)",
|
|
3607
|
+
"fix(3.8)",
|
|
3608
|
+
"fix(-4.2)",
|
|
3609
|
+
"fix(-4.8)",
|
|
3610
|
+
"fix(3.241cm, cm)",
|
|
3611
|
+
"fix(3.241cm, 2, cm)"
|
|
3612
|
+
],
|
|
3613
|
+
seealso: ["ceil", "floor", "round"]
|
|
3614
|
+
};
|
|
3615
|
+
|
|
3616
|
+
// src/embeddedDocs/function/arithmetic/floor.ts
|
|
3617
|
+
var floorDocs = {
|
|
3618
|
+
name: "floor",
|
|
3619
|
+
category: "Arithmetic",
|
|
3620
|
+
syntax: [
|
|
3621
|
+
"floor(x)",
|
|
3622
|
+
"floor(x, n)",
|
|
3623
|
+
"floor(unit, valuelessUnit)",
|
|
3624
|
+
"floor(unit, n, valuelessUnit)"
|
|
3625
|
+
],
|
|
3626
|
+
description: "Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",
|
|
3627
|
+
examples: [
|
|
3628
|
+
"floor(3.2)",
|
|
3629
|
+
"floor(3.8)",
|
|
3630
|
+
"floor(-4.2)",
|
|
3631
|
+
"floor(3.241cm, cm)",
|
|
3632
|
+
"floor(3.241cm, 2, cm)"
|
|
3633
|
+
],
|
|
3634
|
+
seealso: ["ceil", "fix", "round"]
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
// src/embeddedDocs/function/arithmetic/gcd.ts
|
|
3638
|
+
var gcdDocs = {
|
|
3639
|
+
name: "gcd",
|
|
3640
|
+
category: "Arithmetic",
|
|
3641
|
+
syntax: ["gcd(a, b)", "gcd(a, b, c, ...)"],
|
|
3642
|
+
description: "Compute the greatest common divisor.",
|
|
3643
|
+
examples: ["gcd(8, 12)", "gcd(-4, 6)", "gcd(25, 15, -10)"],
|
|
3644
|
+
seealso: ["lcm", "xgcd"]
|
|
3645
|
+
};
|
|
3646
|
+
|
|
3647
|
+
// src/embeddedDocs/function/arithmetic/hypot.ts
|
|
3648
|
+
var hypotDocs = {
|
|
3649
|
+
name: "hypot",
|
|
3650
|
+
category: "Arithmetic",
|
|
3651
|
+
syntax: ["hypot(a, b, c, ...)", "hypot([a, b, c, ...])"],
|
|
3652
|
+
description: "Calculate the hypotenuse of a list with values.",
|
|
3653
|
+
examples: ["hypot(3, 4)", "sqrt(3^2 + 4^2)", "hypot(-2)", "hypot([3, 4, 5])"],
|
|
3654
|
+
seealso: ["abs", "norm"]
|
|
3655
|
+
};
|
|
3656
|
+
|
|
3657
|
+
// src/embeddedDocs/function/arithmetic/invmod.ts
|
|
3658
|
+
var invmodDocs = {
|
|
3659
|
+
name: "invmod",
|
|
3660
|
+
category: "Arithmetic",
|
|
3661
|
+
syntax: ["invmod(a, b)"],
|
|
3662
|
+
description: "Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)",
|
|
3663
|
+
examples: ["invmod(8, 12)", "invmod(7, 13)", "invmod(15151, 15122)"],
|
|
3664
|
+
seealso: ["gcd", "xgcd"]
|
|
3665
|
+
};
|
|
3666
|
+
|
|
3667
|
+
// src/embeddedDocs/function/arithmetic/lcm.ts
|
|
3668
|
+
var lcmDocs = {
|
|
3669
|
+
name: "lcm",
|
|
3670
|
+
category: "Arithmetic",
|
|
3671
|
+
syntax: ["lcm(x, y)"],
|
|
3672
|
+
description: "Compute the least common multiple.",
|
|
3673
|
+
examples: ["lcm(4, 6)", "lcm(6, 21)", "lcm(6, 21, 5)"],
|
|
3674
|
+
seealso: ["gcd"]
|
|
3675
|
+
};
|
|
3676
|
+
|
|
3677
|
+
// src/embeddedDocs/function/arithmetic/log.ts
|
|
3678
|
+
var logDocs = {
|
|
3679
|
+
name: "log",
|
|
3680
|
+
category: "Arithmetic",
|
|
3681
|
+
syntax: ["log(x)", "log(x, base)"],
|
|
3682
|
+
description: "Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",
|
|
3683
|
+
examples: [
|
|
3684
|
+
"log(3.5)",
|
|
3685
|
+
"a = log(2.4)",
|
|
3686
|
+
"exp(a)",
|
|
3687
|
+
"10 ^ 4",
|
|
3688
|
+
"log(10000, 10)",
|
|
3689
|
+
"log(10000) / log(10)",
|
|
3690
|
+
"b = log(1024, 2)",
|
|
3691
|
+
"2 ^ b"
|
|
3692
|
+
],
|
|
3693
|
+
seealso: ["exp", "log1p", "log2", "log10"]
|
|
3694
|
+
};
|
|
3695
|
+
|
|
3696
|
+
// src/embeddedDocs/function/arithmetic/log10.ts
|
|
3697
|
+
var log10Docs = {
|
|
3698
|
+
name: "log10",
|
|
3699
|
+
category: "Arithmetic",
|
|
3700
|
+
syntax: ["log10(x)"],
|
|
3701
|
+
description: "Compute the 10-base logarithm of a value.",
|
|
3702
|
+
examples: ["log10(0.00001)", "log10(10000)", "10 ^ 4", "log(10000) / log(10)", "log(10000, 10)"],
|
|
3703
|
+
seealso: ["exp", "log"]
|
|
3704
|
+
};
|
|
3705
|
+
|
|
3706
|
+
// src/embeddedDocs/function/arithmetic/log1p.ts
|
|
3707
|
+
var log1pDocs = {
|
|
3708
|
+
name: "log1p",
|
|
3709
|
+
category: "Arithmetic",
|
|
3710
|
+
syntax: ["log1p(x)", "log1p(x, base)"],
|
|
3711
|
+
description: "Calculate the logarithm of a `value+1`",
|
|
3712
|
+
examples: [
|
|
3713
|
+
"log1p(2.5)",
|
|
3714
|
+
"exp(log1p(1.4))",
|
|
3715
|
+
"pow(10, 4)",
|
|
3716
|
+
"log1p(9999, 10)",
|
|
3717
|
+
"log1p(9999) / log(10)"
|
|
3718
|
+
],
|
|
3719
|
+
seealso: ["exp", "log", "log2", "log10"]
|
|
3720
|
+
};
|
|
3721
|
+
|
|
3722
|
+
// src/embeddedDocs/function/arithmetic/log2.ts
|
|
3723
|
+
var log2Docs = {
|
|
3724
|
+
name: "log2",
|
|
3725
|
+
category: "Arithmetic",
|
|
3726
|
+
syntax: ["log2(x)"],
|
|
3727
|
+
description: "Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",
|
|
3728
|
+
examples: ["log2(0.03125)", "log2(16)", "log2(16) / log2(2)", "pow(2, 4)"],
|
|
3729
|
+
seealso: ["exp", "log1p", "log", "log10"]
|
|
3730
|
+
};
|
|
3731
|
+
|
|
3732
|
+
// src/embeddedDocs/function/arithmetic/mod.ts
|
|
3733
|
+
var modDocs = {
|
|
3734
|
+
name: "mod",
|
|
3735
|
+
category: "Operators",
|
|
3736
|
+
syntax: ["x % y", "x mod y", "mod(x, y)"],
|
|
3737
|
+
description: "Calculates the modulus, the remainder of an integer division.",
|
|
3738
|
+
examples: ["7 % 3", "11 % 2", "10 mod 4", "isOdd(x) = x % 2", "isOdd(2)", "isOdd(3)"],
|
|
3739
|
+
seealso: ["divide"]
|
|
3740
|
+
};
|
|
3741
|
+
|
|
3742
|
+
// src/embeddedDocs/function/arithmetic/multiply.ts
|
|
3743
|
+
var multiplyDocs = {
|
|
3744
|
+
name: "multiply",
|
|
3745
|
+
category: "Operators",
|
|
3746
|
+
syntax: ["x * y", "multiply(x, y)"],
|
|
3747
|
+
description: "multiply two values.",
|
|
3748
|
+
examples: ["a = 2.1 * 3.4", "a / 3.4", "2 * 3 + 4", "2 * (3 + 4)", "3 * 2.1 km"],
|
|
3749
|
+
seealso: ["divide"]
|
|
3750
|
+
};
|
|
3751
|
+
|
|
3752
|
+
// src/embeddedDocs/function/arithmetic/norm.ts
|
|
3753
|
+
var normDocs = {
|
|
3754
|
+
name: "norm",
|
|
3755
|
+
category: "Arithmetic",
|
|
3756
|
+
syntax: ["norm(x)", "norm(x, p)"],
|
|
3757
|
+
description: "Calculate the norm of a number, vector or matrix.",
|
|
3758
|
+
examples: [
|
|
3759
|
+
"abs(-3.5)",
|
|
3760
|
+
"norm(-3.5)",
|
|
3761
|
+
"norm(3 - 4i)",
|
|
3762
|
+
"norm([1, 2, -3], Infinity)",
|
|
3763
|
+
"norm([1, 2, -3], -Infinity)",
|
|
3764
|
+
"norm([3, 4], 2)",
|
|
3765
|
+
"norm([[1, 2], [3, 4]], 1)",
|
|
3766
|
+
'norm([[1, 2], [3, 4]], "inf")',
|
|
3767
|
+
'norm([[1, 2], [3, 4]], "fro")'
|
|
3768
|
+
]
|
|
3769
|
+
};
|
|
3770
|
+
|
|
3771
|
+
// src/embeddedDocs/function/arithmetic/nthRoot.ts
|
|
3772
|
+
var nthRootDocs = {
|
|
3773
|
+
name: "nthRoot",
|
|
3774
|
+
category: "Arithmetic",
|
|
3775
|
+
syntax: ["nthRoot(a)", "nthRoot(a, root)"],
|
|
3776
|
+
description: 'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',
|
|
3777
|
+
examples: ["4 ^ 3", "nthRoot(64, 3)", "nthRoot(9, 2)", "sqrt(9)"],
|
|
3778
|
+
seealso: ["nthRoots", "pow", "sqrt"]
|
|
3779
|
+
};
|
|
3780
|
+
|
|
3781
|
+
// src/embeddedDocs/function/arithmetic/nthRoots.ts
|
|
3782
|
+
var nthRootsDocs = {
|
|
3783
|
+
name: "nthRoots",
|
|
3784
|
+
category: "Arithmetic",
|
|
3785
|
+
syntax: ["nthRoots(A)", "nthRoots(A, root)"],
|
|
3786
|
+
description: 'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',
|
|
3787
|
+
examples: ["nthRoots(1)", "nthRoots(1, 3)"],
|
|
3788
|
+
seealso: ["sqrt", "pow", "nthRoot"]
|
|
3789
|
+
};
|
|
3790
|
+
|
|
3791
|
+
// src/embeddedDocs/function/arithmetic/pow.ts
|
|
3792
|
+
var powDocs = {
|
|
3793
|
+
name: "pow",
|
|
3794
|
+
category: "Operators",
|
|
3795
|
+
syntax: ["x ^ y", "pow(x, y)"],
|
|
3796
|
+
description: "Calculates the power of x to y, x^y.",
|
|
3797
|
+
examples: [
|
|
3798
|
+
"2^3",
|
|
3799
|
+
"2*2*2",
|
|
3800
|
+
"1 + e ^ (pi * i)",
|
|
3801
|
+
"pow([[1, 2], [4, 3]], 2)",
|
|
3802
|
+
"pow([[1, 2], [4, 3]], -1)"
|
|
3803
|
+
],
|
|
3804
|
+
seealso: ["multiply", "nthRoot", "nthRoots", "sqrt"]
|
|
3805
|
+
};
|
|
3806
|
+
|
|
3807
|
+
// src/embeddedDocs/function/arithmetic/round.ts
|
|
3808
|
+
var roundDocs = {
|
|
3809
|
+
name: "round",
|
|
3810
|
+
category: "Arithmetic",
|
|
3811
|
+
syntax: [
|
|
3812
|
+
"round(x)",
|
|
3813
|
+
"round(x, n)",
|
|
3814
|
+
"round(unit, valuelessUnit)",
|
|
3815
|
+
"round(unit, n, valuelessUnit)"
|
|
3816
|
+
],
|
|
3817
|
+
description: "round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",
|
|
3818
|
+
examples: [
|
|
3819
|
+
"round(3.2)",
|
|
3820
|
+
"round(3.8)",
|
|
3821
|
+
"round(-4.2)",
|
|
3822
|
+
"round(-4.8)",
|
|
3823
|
+
"round(pi, 3)",
|
|
3824
|
+
"round(123.45678, 2)",
|
|
3825
|
+
"round(3.241cm, 2, cm)",
|
|
3826
|
+
"round([3.2, 3.8, -4.7])"
|
|
3827
|
+
],
|
|
3828
|
+
seealso: ["ceil", "floor", "fix"]
|
|
3829
|
+
};
|
|
3830
|
+
|
|
3831
|
+
// src/embeddedDocs/function/arithmetic/sign.ts
|
|
3832
|
+
var signDocs = {
|
|
3833
|
+
name: "sign",
|
|
3834
|
+
category: "Arithmetic",
|
|
3835
|
+
syntax: ["sign(x)"],
|
|
3836
|
+
description: "Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.",
|
|
3837
|
+
examples: ["sign(3.5)", "sign(-4.2)", "sign(0)"],
|
|
3838
|
+
seealso: ["abs"]
|
|
3839
|
+
};
|
|
3840
|
+
|
|
3841
|
+
// src/embeddedDocs/function/arithmetic/sqrt.ts
|
|
3842
|
+
var sqrtDocs = {
|
|
3843
|
+
name: "sqrt",
|
|
3844
|
+
category: "Arithmetic",
|
|
3845
|
+
syntax: ["sqrt(x)"],
|
|
3846
|
+
description: "Compute the square root value. If x = y * y, then y is the square root of x.",
|
|
3847
|
+
examples: ["sqrt(25)", "5 * 5", "sqrt(-1)"],
|
|
3848
|
+
seealso: ["square", "sqrtm", "multiply", "nthRoot", "nthRoots", "pow"]
|
|
3849
|
+
};
|
|
3850
|
+
|
|
3851
|
+
// src/embeddedDocs/function/arithmetic/sqrtm.ts
|
|
3852
|
+
var sqrtmDocs = {
|
|
3853
|
+
name: "sqrtm",
|
|
3854
|
+
category: "Arithmetic",
|
|
3855
|
+
syntax: ["sqrtm(x)"],
|
|
3856
|
+
description: "Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",
|
|
3857
|
+
examples: ["sqrtm([[33, 24], [48, 57]])"],
|
|
3858
|
+
seealso: ["sqrt", "abs", "square", "multiply"]
|
|
3859
|
+
};
|
|
3860
|
+
|
|
3861
|
+
// src/embeddedDocs/function/algebra/sylvester.ts
|
|
3862
|
+
var sylvesterDocs = {
|
|
3863
|
+
name: "sylvester",
|
|
3864
|
+
category: "Algebra",
|
|
3865
|
+
syntax: ["sylvester(A,B,C)"],
|
|
3866
|
+
description: "Solves the real-valued Sylvester equation AX+XB=C for X",
|
|
3867
|
+
examples: [
|
|
3868
|
+
"sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])",
|
|
3869
|
+
"A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]",
|
|
3870
|
+
"sylvester(A, B, C)"
|
|
3871
|
+
],
|
|
3872
|
+
seealso: ["schur", "lyap"]
|
|
3873
|
+
};
|
|
3874
|
+
|
|
3875
|
+
// src/embeddedDocs/function/algebra/schur.ts
|
|
3876
|
+
var schurDocs = {
|
|
3877
|
+
name: "schur",
|
|
3878
|
+
category: "Algebra",
|
|
3879
|
+
syntax: ["schur(A)"],
|
|
3880
|
+
description: "Performs a real Schur decomposition of the real matrix A = UTU'",
|
|
3881
|
+
examples: ["schur([[1, 0], [-4, 3]])", "A = [[1, 0], [-4, 3]]", "schur(A)"],
|
|
3882
|
+
seealso: ["lyap", "sylvester"]
|
|
3883
|
+
};
|
|
3884
|
+
|
|
3885
|
+
// src/embeddedDocs/function/algebra/lyap.ts
|
|
3886
|
+
var lyapDocs = {
|
|
3887
|
+
name: "lyap",
|
|
3888
|
+
category: "Algebra",
|
|
3889
|
+
syntax: ["lyap(A,Q)"],
|
|
3890
|
+
description: "Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",
|
|
3891
|
+
examples: [
|
|
3892
|
+
"lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])",
|
|
3893
|
+
"A = [[-2, 0], [1, -4]]",
|
|
3894
|
+
"Q = [[3, 1], [1, 3]]",
|
|
3895
|
+
"lyap(A,Q)"
|
|
3896
|
+
],
|
|
3897
|
+
seealso: ["schur", "sylvester"]
|
|
3898
|
+
};
|
|
3899
|
+
|
|
3900
|
+
// src/embeddedDocs/function/arithmetic/square.ts
|
|
3901
|
+
var squareDocs = {
|
|
3902
|
+
name: "square",
|
|
3903
|
+
category: "Arithmetic",
|
|
3904
|
+
syntax: ["square(x)"],
|
|
3905
|
+
description: "Compute the square of a value. The square of x is x * x.",
|
|
3906
|
+
examples: ["square(3)", "sqrt(9)", "3^2", "3 * 3"],
|
|
3907
|
+
seealso: ["multiply", "pow", "sqrt", "cube"]
|
|
3908
|
+
};
|
|
3909
|
+
|
|
3910
|
+
// src/embeddedDocs/function/arithmetic/subtract.ts
|
|
3911
|
+
var subtractDocs = {
|
|
3912
|
+
name: "subtract",
|
|
3913
|
+
category: "Operators",
|
|
3914
|
+
syntax: ["x - y", "subtract(x, y)"],
|
|
3915
|
+
description: "subtract two values.",
|
|
3916
|
+
examples: ["a = 5.3 - 2", "a + 2", "2/3 - 1/6", "2 * 3 - 3", "2.1 km - 500m"],
|
|
3917
|
+
seealso: ["add"]
|
|
3918
|
+
};
|
|
3919
|
+
|
|
3920
|
+
// src/embeddedDocs/function/arithmetic/unaryMinus.ts
|
|
3921
|
+
var unaryMinusDocs = {
|
|
3922
|
+
name: "unaryMinus",
|
|
3923
|
+
category: "Operators",
|
|
3924
|
+
syntax: ["-x", "unaryMinus(x)"],
|
|
3925
|
+
description: "Inverse the sign of a value. Converts booleans and strings to numbers.",
|
|
3926
|
+
examples: ["-4.5", "-(-5.6)", '-"22"'],
|
|
3927
|
+
seealso: ["add", "subtract", "unaryPlus"]
|
|
3928
|
+
};
|
|
3929
|
+
|
|
3930
|
+
// src/embeddedDocs/function/arithmetic/unaryPlus.ts
|
|
3931
|
+
var unaryPlusDocs = {
|
|
3932
|
+
name: "unaryPlus",
|
|
3933
|
+
category: "Operators",
|
|
3934
|
+
syntax: ["+x", "unaryPlus(x)"],
|
|
3935
|
+
description: "Converts booleans and strings to numbers.",
|
|
3936
|
+
examples: ["+true", '+"2"'],
|
|
3937
|
+
seealso: ["add", "subtract", "unaryMinus"]
|
|
3938
|
+
};
|
|
3939
|
+
|
|
3940
|
+
// src/embeddedDocs/function/arithmetic/xgcd.ts
|
|
3941
|
+
var xgcdDocs = {
|
|
3942
|
+
name: "xgcd",
|
|
3943
|
+
category: "Arithmetic",
|
|
3944
|
+
syntax: ["xgcd(a, b)"],
|
|
3945
|
+
description: "Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",
|
|
3946
|
+
examples: ["xgcd(8, 12)", "gcd(8, 12)", "xgcd(36163, 21199)"],
|
|
3947
|
+
seealso: ["gcd", "lcm"]
|
|
3948
|
+
};
|
|
3949
|
+
|
|
3950
|
+
// src/embeddedDocs/function/bitwise/bitAnd.ts
|
|
3951
|
+
var bitAndDocs = {
|
|
3952
|
+
name: "bitAnd",
|
|
3953
|
+
category: "Bitwise",
|
|
3954
|
+
syntax: ["x & y", "bitAnd(x, y)"],
|
|
3955
|
+
description: "Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",
|
|
3956
|
+
examples: ["5 & 3", "bitAnd(53, 131)", "[1, 12, 31] & 42"],
|
|
3957
|
+
seealso: ["bitNot", "bitOr", "bitXor", "leftShift", "rightArithShift", "rightLogShift"]
|
|
3958
|
+
};
|
|
3959
|
+
|
|
3960
|
+
// src/embeddedDocs/function/bitwise/bitNot.ts
|
|
3961
|
+
var bitNotDocs = {
|
|
3962
|
+
name: "bitNot",
|
|
3963
|
+
category: "Bitwise",
|
|
3964
|
+
syntax: ["~x", "bitNot(x)"],
|
|
3965
|
+
description: "Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",
|
|
3966
|
+
examples: ["~1", "~2", "bitNot([2, -3, 4])"],
|
|
3967
|
+
seealso: ["bitAnd", "bitOr", "bitXor", "leftShift", "rightArithShift", "rightLogShift"]
|
|
3968
|
+
};
|
|
3969
|
+
|
|
3970
|
+
// src/embeddedDocs/function/bitwise/bitOr.ts
|
|
3971
|
+
var bitOrDocs = {
|
|
3972
|
+
name: "bitOr",
|
|
3973
|
+
category: "Bitwise",
|
|
3974
|
+
syntax: ["x | y", "bitOr(x, y)"],
|
|
3975
|
+
description: "Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",
|
|
3976
|
+
examples: ["5 | 3", "bitOr([1, 2, 3], 4)"],
|
|
3977
|
+
seealso: ["bitAnd", "bitNot", "bitXor", "leftShift", "rightArithShift", "rightLogShift"]
|
|
3978
|
+
};
|
|
3979
|
+
|
|
3980
|
+
// src/embeddedDocs/function/bitwise/bitXor.ts
|
|
3981
|
+
var bitXorDocs = {
|
|
3982
|
+
name: "bitXor",
|
|
3983
|
+
category: "Bitwise",
|
|
3984
|
+
syntax: ["bitXor(x, y)"],
|
|
3985
|
+
description: "Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",
|
|
3986
|
+
examples: ["bitOr(1, 2)", "bitXor([2, 3, 4], 4)"],
|
|
3987
|
+
seealso: ["bitAnd", "bitNot", "bitOr", "leftShift", "rightArithShift", "rightLogShift"]
|
|
3988
|
+
};
|
|
3989
|
+
|
|
3990
|
+
// src/embeddedDocs/function/bitwise/leftShift.ts
|
|
3991
|
+
var leftShiftDocs = {
|
|
3992
|
+
name: "leftShift",
|
|
3993
|
+
category: "Bitwise",
|
|
3994
|
+
syntax: ["x << y", "leftShift(x, y)"],
|
|
3995
|
+
description: "Bitwise left logical shift of a value x by y number of bits.",
|
|
3996
|
+
examples: ["4 << 1", "8 >> 1"],
|
|
3997
|
+
seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "rightArithShift", "rightLogShift"]
|
|
3998
|
+
};
|
|
3999
|
+
|
|
4000
|
+
// src/embeddedDocs/function/bitwise/rightArithShift.ts
|
|
4001
|
+
var rightArithShiftDocs = {
|
|
4002
|
+
name: "rightArithShift",
|
|
4003
|
+
category: "Bitwise",
|
|
4004
|
+
syntax: ["x >> y", "rightArithShift(x, y)"],
|
|
4005
|
+
description: "Bitwise right arithmetic shift of a value x by y number of bits.",
|
|
4006
|
+
examples: ["8 >> 1", "4 << 1", "-12 >> 2"],
|
|
4007
|
+
seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "leftShift", "rightLogShift"]
|
|
4008
|
+
};
|
|
4009
|
+
|
|
4010
|
+
// src/embeddedDocs/function/bitwise/rightLogShift.ts
|
|
4011
|
+
var rightLogShiftDocs = {
|
|
4012
|
+
name: "rightLogShift",
|
|
4013
|
+
category: "Bitwise",
|
|
4014
|
+
syntax: ["x >>> y", "rightLogShift(x, y)"],
|
|
4015
|
+
description: "Bitwise right logical shift of a value x by y number of bits.",
|
|
4016
|
+
examples: ["8 >>> 1", "4 << 1", "-12 >>> 2"],
|
|
4017
|
+
seealso: ["bitAnd", "bitNot", "bitOr", "bitXor", "leftShift", "rightArithShift"]
|
|
4018
|
+
};
|
|
4019
|
+
|
|
4020
|
+
// src/embeddedDocs/function/combinatorics/bellNumbers.ts
|
|
4021
|
+
var bellNumbersDocs = {
|
|
4022
|
+
name: "bellNumbers",
|
|
4023
|
+
category: "Combinatorics",
|
|
4024
|
+
syntax: ["bellNumbers(n)"],
|
|
4025
|
+
description: "The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",
|
|
4026
|
+
examples: ["bellNumbers(3)", "bellNumbers(8)"],
|
|
4027
|
+
seealso: ["stirlingS2"]
|
|
4028
|
+
};
|
|
4029
|
+
|
|
4030
|
+
// src/embeddedDocs/function/combinatorics/catalan.ts
|
|
4031
|
+
var catalanDocs = {
|
|
4032
|
+
name: "catalan",
|
|
4033
|
+
category: "Combinatorics",
|
|
4034
|
+
syntax: ["catalan(n)"],
|
|
4035
|
+
description: "The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",
|
|
4036
|
+
examples: ["catalan(3)", "catalan(8)"],
|
|
4037
|
+
seealso: ["bellNumbers"]
|
|
4038
|
+
};
|
|
4039
|
+
|
|
4040
|
+
// src/embeddedDocs/function/combinatorics/composition.ts
|
|
4041
|
+
var compositionDocs = {
|
|
4042
|
+
name: "composition",
|
|
4043
|
+
category: "Combinatorics",
|
|
4044
|
+
syntax: ["composition(n, k)"],
|
|
4045
|
+
description: "The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",
|
|
4046
|
+
examples: ["composition(5, 3)"],
|
|
4047
|
+
seealso: ["combinations"]
|
|
4048
|
+
};
|
|
4049
|
+
|
|
4050
|
+
// src/embeddedDocs/function/combinatorics/stirlingS2.ts
|
|
4051
|
+
var stirlingS2Docs = {
|
|
4052
|
+
name: "stirlingS2",
|
|
4053
|
+
category: "Combinatorics",
|
|
4054
|
+
syntax: ["stirlingS2(n, k)"],
|
|
4055
|
+
description: "The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",
|
|
4056
|
+
examples: ["stirlingS2(5, 3)"],
|
|
4057
|
+
seealso: ["bellNumbers", "bernoulli"]
|
|
4058
|
+
};
|
|
4059
|
+
|
|
4060
|
+
// src/embeddedDocs/function/complex/arg.ts
|
|
4061
|
+
var argDocs = {
|
|
4062
|
+
name: "arg",
|
|
4063
|
+
category: "Complex",
|
|
4064
|
+
syntax: ["arg(x)"],
|
|
4065
|
+
description: "Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",
|
|
4066
|
+
examples: ["arg(2 + 2i)", "atan2(3, 2)", "arg(2 + 3i)"],
|
|
4067
|
+
seealso: ["re", "im", "conj", "abs"]
|
|
4068
|
+
};
|
|
4069
|
+
|
|
4070
|
+
// src/embeddedDocs/function/complex/conj.ts
|
|
4071
|
+
var conjDocs = {
|
|
4072
|
+
name: "conj",
|
|
4073
|
+
category: "Complex",
|
|
4074
|
+
syntax: ["conj(x)"],
|
|
4075
|
+
description: "Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",
|
|
4076
|
+
examples: ["conj(2 + 3i)", "conj(2 - 3i)", "conj(-5.2i)"],
|
|
4077
|
+
seealso: ["re", "im", "abs", "arg"]
|
|
4078
|
+
};
|
|
4079
|
+
|
|
4080
|
+
// src/embeddedDocs/function/complex/im.ts
|
|
4081
|
+
var imDocs = {
|
|
4082
|
+
name: "im",
|
|
4083
|
+
category: "Complex",
|
|
4084
|
+
syntax: ["im(x)"],
|
|
4085
|
+
description: "Get the imaginary part of a complex number.",
|
|
4086
|
+
examples: ["im(2 + 3i)", "re(2 + 3i)", "im(-5.2i)", "im(2.4)"],
|
|
4087
|
+
seealso: ["re", "conj", "abs", "arg"]
|
|
4088
|
+
};
|
|
4089
|
+
|
|
4090
|
+
// src/embeddedDocs/function/complex/re.ts
|
|
4091
|
+
var reDocs = {
|
|
4092
|
+
name: "re",
|
|
4093
|
+
category: "Complex",
|
|
4094
|
+
syntax: ["re(x)"],
|
|
4095
|
+
description: "Get the real part of a complex number.",
|
|
4096
|
+
examples: ["re(2 + 3i)", "im(2 + 3i)", "re(-5.2i)", "re(2.4)"],
|
|
4097
|
+
seealso: ["im", "conj", "abs", "arg"]
|
|
4098
|
+
};
|
|
4099
|
+
|
|
4100
|
+
// src/embeddedDocs/function/expression/evaluate.ts
|
|
4101
|
+
var evaluateDocs = {
|
|
4102
|
+
name: "evaluate",
|
|
4103
|
+
category: "Expression",
|
|
4104
|
+
syntax: [
|
|
4105
|
+
"evaluate(expression)",
|
|
4106
|
+
"evaluate(expression, scope)",
|
|
4107
|
+
"evaluate([expr1, expr2, expr3, ...])",
|
|
4108
|
+
"evaluate([expr1, expr2, expr3, ...], scope)"
|
|
4109
|
+
],
|
|
4110
|
+
description: "Evaluate an expression or an array with expressions.",
|
|
4111
|
+
examples: [
|
|
4112
|
+
'evaluate("2 + 3")',
|
|
4113
|
+
'evaluate("sqrt(16)")',
|
|
4114
|
+
'evaluate("2 inch to cm")',
|
|
4115
|
+
'evaluate("sin(x * pi)", { "x": 1/2 })',
|
|
4116
|
+
'evaluate(["width=2", "height=4","width*height"])'
|
|
4117
|
+
],
|
|
4118
|
+
seealso: ["parser", "parse", "compile"]
|
|
4119
|
+
};
|
|
4120
|
+
|
|
4121
|
+
// src/embeddedDocs/function/expression/parser.ts
|
|
4122
|
+
var parserDocs = {
|
|
4123
|
+
name: "parser",
|
|
4124
|
+
category: "Expression",
|
|
4125
|
+
syntax: ["parser()"],
|
|
4126
|
+
description: "Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.",
|
|
4127
|
+
examples: [
|
|
4128
|
+
"myParser = parser()",
|
|
4129
|
+
'myParser.evaluate("sqrt(3^2 + 4^2)")',
|
|
4130
|
+
'myParser.set("x", 3)',
|
|
4131
|
+
'myParser.evaluate("y = x + 3")',
|
|
4132
|
+
'myParser.evaluate(["y = x + 3", "y = y + 1"])',
|
|
4133
|
+
'myParser.get("y")'
|
|
4134
|
+
],
|
|
4135
|
+
seealso: ["evaluate", "parse", "compile"]
|
|
4136
|
+
};
|
|
4137
|
+
|
|
4138
|
+
// src/embeddedDocs/function/expression/parse.ts
|
|
4139
|
+
var parseDocs = {
|
|
4140
|
+
name: "parse",
|
|
4141
|
+
category: "Expression",
|
|
4142
|
+
syntax: [
|
|
4143
|
+
"parse(expr)",
|
|
4144
|
+
"parse(expr, options)",
|
|
4145
|
+
"parse([expr1, expr2, expr3, ...])",
|
|
4146
|
+
"parse([expr1, expr2, expr3, ...], options)"
|
|
4147
|
+
],
|
|
4148
|
+
description: "Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().",
|
|
4149
|
+
examples: [
|
|
4150
|
+
'node1 = parse("sqrt(3^2 + 4^2)")',
|
|
4151
|
+
"node1.evaluate()",
|
|
4152
|
+
"code1 = node1.compile()",
|
|
4153
|
+
"code1.evaluate()",
|
|
4154
|
+
"scope = {a: 3, b: 4}",
|
|
4155
|
+
'node2 = parse("a * b")',
|
|
4156
|
+
"node2.evaluate(scope)",
|
|
4157
|
+
"code2 = node2.compile()",
|
|
4158
|
+
"code2.evaluate(scope)"
|
|
4159
|
+
],
|
|
4160
|
+
seealso: ["parser", "evaluate", "compile"]
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4163
|
+
// src/embeddedDocs/function/expression/compile.ts
|
|
4164
|
+
var compileDocs = {
|
|
4165
|
+
name: "compile",
|
|
4166
|
+
category: "Expression",
|
|
4167
|
+
syntax: ["compile(expr) ", "compile([expr1, expr2, expr3, ...])"],
|
|
4168
|
+
description: "Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.",
|
|
4169
|
+
examples: [
|
|
4170
|
+
'code1 = compile("sqrt(3^2 + 4^2)")',
|
|
4171
|
+
"code1.evaluate() ",
|
|
4172
|
+
'code2 = compile("a * b")',
|
|
4173
|
+
"code2.evaluate({a: 3, b: 4})"
|
|
4174
|
+
],
|
|
4175
|
+
seealso: ["parser", "parse", "evaluate"]
|
|
4176
|
+
};
|
|
4177
|
+
|
|
4178
|
+
// src/embeddedDocs/function/expression/help.ts
|
|
4179
|
+
var helpDocs = {
|
|
4180
|
+
name: "help",
|
|
4181
|
+
category: "Expression",
|
|
4182
|
+
syntax: ["help(object)", "help(string)"],
|
|
4183
|
+
description: "Display documentation on a function or data type.",
|
|
4184
|
+
examples: ["help(sqrt)", 'help("complex")'],
|
|
4185
|
+
seealso: []
|
|
4186
|
+
};
|
|
4187
|
+
|
|
4188
|
+
// src/embeddedDocs/function/geometry/distance.ts
|
|
4189
|
+
var distanceDocs = {
|
|
4190
|
+
name: "distance",
|
|
4191
|
+
category: "Geometry",
|
|
4192
|
+
syntax: ["distance([x1, y1], [x2, y2])", "distance([[x1, y1], [x2, y2]])"],
|
|
4193
|
+
description: "Calculates the Euclidean distance between two points.",
|
|
4194
|
+
examples: ["distance([0,0], [4,4])", "distance([[0,0], [4,4]])"],
|
|
4195
|
+
seealso: []
|
|
4196
|
+
};
|
|
4197
|
+
|
|
4198
|
+
// src/embeddedDocs/function/geometry/intersect.ts
|
|
4199
|
+
var intersectDocs = {
|
|
4200
|
+
name: "intersect",
|
|
4201
|
+
category: "Geometry",
|
|
4202
|
+
syntax: ["intersect(expr1, expr2, expr3, expr4)", "intersect(expr1, expr2, expr3)"],
|
|
4203
|
+
description: "Computes the intersection point of lines and/or planes.",
|
|
4204
|
+
examples: [
|
|
4205
|
+
"intersect([0, 0], [10, 10], [10, 0], [0, 10])",
|
|
4206
|
+
"intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"
|
|
4207
|
+
],
|
|
4208
|
+
seealso: []
|
|
4209
|
+
};
|
|
4210
|
+
|
|
4211
|
+
// src/embeddedDocs/function/logical/and.ts
|
|
4212
|
+
var andDocs = {
|
|
4213
|
+
name: "and",
|
|
4214
|
+
category: "Logical",
|
|
4215
|
+
syntax: ["x and y", "and(x, y)"],
|
|
4216
|
+
description: "Logical and. Test whether two values are both defined with a nonzero/nonempty value.",
|
|
4217
|
+
examples: ["true and false", "true and true", "2 and 4"],
|
|
4218
|
+
seealso: ["not", "or", "xor"]
|
|
4219
|
+
};
|
|
4220
|
+
|
|
4221
|
+
// src/embeddedDocs/function/logical/not.ts
|
|
4222
|
+
var notDocs = {
|
|
4223
|
+
name: "not",
|
|
4224
|
+
category: "Logical",
|
|
4225
|
+
syntax: ["not x", "not(x)"],
|
|
4226
|
+
description: "Logical not. Flips the boolean value of given argument.",
|
|
4227
|
+
examples: ["not true", "not false", "not 2", "not 0"],
|
|
4228
|
+
seealso: ["and", "or", "xor"]
|
|
4229
|
+
};
|
|
4230
|
+
|
|
4231
|
+
// src/embeddedDocs/function/logical/nullish.ts
|
|
4232
|
+
var nullishDocs = {
|
|
4233
|
+
name: "nullish",
|
|
4234
|
+
category: "Logical",
|
|
4235
|
+
syntax: ["x ?? y", "nullish(x, y)"],
|
|
4236
|
+
description: "Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.",
|
|
4237
|
+
examples: ["null ?? 42", "undefined ?? 42", "0 ?? 42", "false ?? 42", "null ?? undefined ?? 42"],
|
|
4238
|
+
seealso: ["and", "or", "not"]
|
|
4239
|
+
};
|
|
4240
|
+
|
|
4241
|
+
// src/embeddedDocs/function/logical/or.ts
|
|
4242
|
+
var orDocs = {
|
|
4243
|
+
name: "or",
|
|
4244
|
+
category: "Logical",
|
|
4245
|
+
syntax: ["x or y", "or(x, y)"],
|
|
4246
|
+
description: "Logical or. Test if at least one value is defined with a nonzero/nonempty value.",
|
|
4247
|
+
examples: ["true or false", "false or false", "0 or 4"],
|
|
4248
|
+
seealso: ["not", "and", "xor"]
|
|
4249
|
+
};
|
|
4250
|
+
|
|
4251
|
+
// src/embeddedDocs/function/logical/xor.ts
|
|
4252
|
+
var xorDocs = {
|
|
4253
|
+
name: "xor",
|
|
4254
|
+
category: "Logical",
|
|
4255
|
+
syntax: ["x xor y", "xor(x, y)"],
|
|
4256
|
+
description: "Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",
|
|
4257
|
+
examples: ["true xor false", "false xor false", "true xor true", "0 xor 4"],
|
|
4258
|
+
seealso: ["not", "and", "or"]
|
|
4259
|
+
};
|
|
4260
|
+
|
|
4261
|
+
// src/embeddedDocs/function/matrix/mapSlices.ts
|
|
4262
|
+
var mapSlicesDocs = {
|
|
4263
|
+
name: "mapSlices",
|
|
4264
|
+
category: "Matrix",
|
|
4265
|
+
syntax: ["mapSlices(A, dim, callback)"],
|
|
4266
|
+
description: "Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.",
|
|
4267
|
+
examples: [
|
|
4268
|
+
"A = [[1, 2], [3, 4]]",
|
|
4269
|
+
"mapSlices(A, 1, sum)",
|
|
4270
|
+
// returns [4, 6]
|
|
4271
|
+
"mapSlices(A, 2, prod)"
|
|
4272
|
+
// returns [2, 12]
|
|
4273
|
+
],
|
|
4274
|
+
seealso: ["map", "forEach"]
|
|
4275
|
+
};
|
|
4276
|
+
|
|
4277
|
+
// src/embeddedDocs/function/matrix/column.ts
|
|
4278
|
+
var columnDocs = {
|
|
4279
|
+
name: "column",
|
|
4280
|
+
category: "Matrix",
|
|
4281
|
+
syntax: ["column(x, index)"],
|
|
4282
|
+
description: "Return a column from a matrix or array.",
|
|
4283
|
+
examples: ["A = [[1, 2], [3, 4]]", "column(A, 1)", "column(A, 2)"],
|
|
4284
|
+
seealso: ["row", "matrixFromColumns"]
|
|
4285
|
+
};
|
|
4286
|
+
|
|
4287
|
+
// src/embeddedDocs/function/matrix/concat.ts
|
|
4288
|
+
var concatDocs = {
|
|
4289
|
+
name: "concat",
|
|
4290
|
+
category: "Matrix",
|
|
4291
|
+
syntax: ["concat(A, B, C, ...)", "concat(A, B, C, ..., dim)"],
|
|
4292
|
+
description: "Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",
|
|
4293
|
+
examples: [
|
|
4294
|
+
"A = [1, 2; 5, 6]",
|
|
4295
|
+
"B = [3, 4; 7, 8]",
|
|
4296
|
+
"concat(A, B)",
|
|
4297
|
+
"concat(A, B, 1)",
|
|
4298
|
+
"concat(A, B, 2)"
|
|
4299
|
+
],
|
|
4300
|
+
seealso: [
|
|
4301
|
+
"det",
|
|
4302
|
+
"diag",
|
|
4303
|
+
"identity",
|
|
4304
|
+
"inv",
|
|
4305
|
+
"ones",
|
|
4306
|
+
"range",
|
|
4307
|
+
"size",
|
|
4308
|
+
"squeeze",
|
|
4309
|
+
"subset",
|
|
4310
|
+
"trace",
|
|
4311
|
+
"transpose",
|
|
4312
|
+
"zeros"
|
|
4313
|
+
]
|
|
4314
|
+
};
|
|
4315
|
+
|
|
4316
|
+
// src/embeddedDocs/function/matrix/count.ts
|
|
4317
|
+
var countDocs = {
|
|
4318
|
+
name: "count",
|
|
4319
|
+
category: "Matrix",
|
|
4320
|
+
syntax: ["count(x)"],
|
|
4321
|
+
description: "Count the number of elements of a matrix, array or string.",
|
|
4322
|
+
examples: ["a = [1, 2; 3, 4; 5, 6]", "count(a)", "size(a)", 'count("hello world")'],
|
|
4323
|
+
seealso: ["size"]
|
|
4324
|
+
};
|
|
4325
|
+
|
|
4326
|
+
// src/embeddedDocs/function/matrix/cross.ts
|
|
4327
|
+
var crossDocs = {
|
|
4328
|
+
name: "cross",
|
|
4329
|
+
category: "Matrix",
|
|
4330
|
+
syntax: ["cross(A, B)"],
|
|
4331
|
+
description: "Calculate the cross product for two vectors in three dimensional space.",
|
|
4332
|
+
examples: [
|
|
4333
|
+
"cross([1, 1, 0], [0, 1, 1])",
|
|
4334
|
+
"cross([3, -3, 1], [4, 9, 2])",
|
|
4335
|
+
"cross([2, 3, 4], [5, 6, 7])"
|
|
4336
|
+
],
|
|
4337
|
+
seealso: ["multiply", "dot"]
|
|
4338
|
+
};
|
|
4339
|
+
|
|
4340
|
+
// src/embeddedDocs/function/matrix/ctranspose.ts
|
|
4341
|
+
var ctransposeDocs = {
|
|
4342
|
+
name: "ctranspose",
|
|
4343
|
+
category: "Matrix",
|
|
4344
|
+
syntax: ["x'", "ctranspose(x)"],
|
|
4345
|
+
description: "Complex Conjugate and Transpose a matrix",
|
|
4346
|
+
examples: ["a = [1, 2, 3; 4, 5, 6]", "a'", "ctranspose(a)"],
|
|
4347
|
+
seealso: [
|
|
4348
|
+
"concat",
|
|
4349
|
+
"det",
|
|
4350
|
+
"diag",
|
|
4351
|
+
"identity",
|
|
4352
|
+
"inv",
|
|
4353
|
+
"ones",
|
|
4354
|
+
"range",
|
|
4355
|
+
"size",
|
|
4356
|
+
"squeeze",
|
|
4357
|
+
"subset",
|
|
4358
|
+
"trace",
|
|
4359
|
+
"zeros"
|
|
4360
|
+
]
|
|
4361
|
+
};
|
|
4362
|
+
|
|
4363
|
+
// src/embeddedDocs/function/matrix/det.ts
|
|
4364
|
+
var detDocs = {
|
|
4365
|
+
name: "det",
|
|
4366
|
+
category: "Matrix",
|
|
4367
|
+
syntax: ["det(x)"],
|
|
4368
|
+
description: "Calculate the determinant of a matrix",
|
|
4369
|
+
examples: ["det([1, 2; 3, 4])", "det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],
|
|
4370
|
+
seealso: [
|
|
4371
|
+
"concat",
|
|
4372
|
+
"diag",
|
|
4373
|
+
"identity",
|
|
4374
|
+
"inv",
|
|
4375
|
+
"ones",
|
|
4376
|
+
"range",
|
|
4377
|
+
"size",
|
|
4378
|
+
"squeeze",
|
|
4379
|
+
"subset",
|
|
4380
|
+
"trace",
|
|
4381
|
+
"transpose",
|
|
4382
|
+
"zeros"
|
|
4383
|
+
]
|
|
4384
|
+
};
|
|
4385
|
+
|
|
4386
|
+
// src/embeddedDocs/function/matrix/diag.ts
|
|
4387
|
+
var diagDocs = {
|
|
4388
|
+
name: "diag",
|
|
4389
|
+
category: "Matrix",
|
|
4390
|
+
syntax: ["diag(x)", "diag(x, k)"],
|
|
4391
|
+
description: "Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",
|
|
4392
|
+
examples: ["diag(1:3)", "diag(1:3, 1)", "a = [1, 2, 3; 4, 5, 6; 7, 8, 9]", "diag(a)"],
|
|
4393
|
+
seealso: [
|
|
4394
|
+
"concat",
|
|
4395
|
+
"det",
|
|
4396
|
+
"identity",
|
|
4397
|
+
"inv",
|
|
4398
|
+
"ones",
|
|
4399
|
+
"range",
|
|
4400
|
+
"size",
|
|
4401
|
+
"squeeze",
|
|
4402
|
+
"subset",
|
|
4403
|
+
"trace",
|
|
4404
|
+
"transpose",
|
|
4405
|
+
"zeros"
|
|
4406
|
+
]
|
|
4407
|
+
};
|
|
4408
|
+
|
|
4409
|
+
// src/embeddedDocs/function/matrix/diff.ts
|
|
4410
|
+
var diffDocs = {
|
|
4411
|
+
name: "diff",
|
|
4412
|
+
category: "Matrix",
|
|
4413
|
+
syntax: ["diff(arr)", "diff(arr, dim)"],
|
|
4414
|
+
description: [
|
|
4415
|
+
"Create a new matrix or array with the difference of the passed matrix or array.",
|
|
4416
|
+
"Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference",
|
|
4417
|
+
"If no dimension parameter is passed it is assumed as dimension 0",
|
|
4418
|
+
"Dimension is zero-based in javascript and one-based in the parser",
|
|
4419
|
+
"Arrays must be 'rectangular' meaning arrays like [1, 2]",
|
|
4420
|
+
"If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"
|
|
4421
|
+
],
|
|
4422
|
+
examples: [
|
|
4423
|
+
"A = [1, 2, 4, 7, 0]",
|
|
4424
|
+
"diff(A)",
|
|
4425
|
+
"diff(A, 1)",
|
|
4426
|
+
"B = [[1, 2], [3, 4]]",
|
|
4427
|
+
"diff(B)",
|
|
4428
|
+
"diff(B, 1)",
|
|
4429
|
+
"diff(B, 2)",
|
|
4430
|
+
"diff(B, bignumber(2))",
|
|
4431
|
+
"diff([[1, 2], matrix([3, 4])], 2)"
|
|
4432
|
+
],
|
|
4433
|
+
seealso: ["subtract", "partitionSelect"]
|
|
4434
|
+
};
|
|
4435
|
+
|
|
4436
|
+
// src/embeddedDocs/function/matrix/dot.ts
|
|
4437
|
+
var dotDocs = {
|
|
4438
|
+
name: "dot",
|
|
4439
|
+
category: "Matrix",
|
|
4440
|
+
syntax: ["dot(A, B)", "A * B"],
|
|
4441
|
+
description: "Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",
|
|
4442
|
+
examples: ["dot([2, 4, 1], [2, 2, 3])", "[2, 4, 1] * [2, 2, 3]"],
|
|
4443
|
+
seealso: ["multiply", "cross"]
|
|
4444
|
+
};
|
|
4445
|
+
|
|
4446
|
+
// src/embeddedDocs/function/matrix/eigs.ts
|
|
4447
|
+
var eigsDocs = {
|
|
4448
|
+
name: "eigs",
|
|
4449
|
+
category: "Matrix",
|
|
4450
|
+
syntax: ["eigs(x)"],
|
|
4451
|
+
description: "Calculate the eigenvalues and optionally eigenvectors of a square matrix",
|
|
4452
|
+
examples: [
|
|
4453
|
+
"eigs([[5, 2.3], [2.3, 1]])",
|
|
4454
|
+
"eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"
|
|
4455
|
+
],
|
|
4456
|
+
seealso: ["inv"]
|
|
4457
|
+
};
|
|
4458
|
+
|
|
4459
|
+
// src/embeddedDocs/function/matrix/filter.ts
|
|
4460
|
+
var filterDocs = {
|
|
4461
|
+
name: "filter",
|
|
4462
|
+
category: "Matrix",
|
|
4463
|
+
syntax: ["filter(x, test)"],
|
|
4464
|
+
description: "Filter items in a matrix.",
|
|
4465
|
+
examples: [
|
|
4466
|
+
"isPositive(x) = x > 0",
|
|
4467
|
+
"filter([6, -2, -1, 4, 3], isPositive)",
|
|
4468
|
+
"filter([6, -2, 0, 1, 0], x != 0)"
|
|
4469
|
+
],
|
|
4470
|
+
seealso: ["sort", "map", "forEach"]
|
|
4471
|
+
};
|
|
4472
|
+
|
|
4473
|
+
// src/embeddedDocs/function/matrix/flatten.ts
|
|
4474
|
+
var flattenDocs = {
|
|
4475
|
+
name: "flatten",
|
|
4476
|
+
category: "Matrix",
|
|
4477
|
+
syntax: ["flatten(x)"],
|
|
4478
|
+
description: "Flatten a multi dimensional matrix into a single dimensional matrix.",
|
|
4479
|
+
examples: ["a = [1, 2, 3; 4, 5, 6]", "size(a)", "b = flatten(a)", "size(b)"],
|
|
4480
|
+
seealso: ["concat", "resize", "size", "squeeze"]
|
|
4481
|
+
};
|
|
4482
|
+
|
|
4483
|
+
// src/embeddedDocs/function/matrix/forEach.ts
|
|
4484
|
+
var forEachDocs = {
|
|
4485
|
+
name: "forEach",
|
|
4486
|
+
category: "Matrix",
|
|
4487
|
+
syntax: ["forEach(x, callback)"],
|
|
4488
|
+
description: "Iterates over all elements of a matrix/array, and executes the given callback function.",
|
|
4489
|
+
examples: [
|
|
4490
|
+
"numberOfPets = {}",
|
|
4491
|
+
"addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",
|
|
4492
|
+
'forEach(["Dog","Cat","Cat"], addPet)',
|
|
4493
|
+
"numberOfPets"
|
|
4494
|
+
],
|
|
4495
|
+
seealso: ["map", "sort", "filter"]
|
|
4496
|
+
};
|
|
4497
|
+
|
|
4498
|
+
// src/embeddedDocs/function/matrix/getMatrixDataType.ts
|
|
4499
|
+
var getMatrixDataTypeDocs = {
|
|
4500
|
+
name: "getMatrixDataType",
|
|
4501
|
+
category: "Matrix",
|
|
4502
|
+
syntax: ["getMatrixDataType(x)"],
|
|
4503
|
+
description: 'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',
|
|
4504
|
+
examples: [
|
|
4505
|
+
"getMatrixDataType([1, 2, 3])",
|
|
4506
|
+
"getMatrixDataType([[5 cm], [2 inch]])",
|
|
4507
|
+
'getMatrixDataType([1, "text"])',
|
|
4508
|
+
"getMatrixDataType([1, bignumber(4)])"
|
|
4509
|
+
],
|
|
4510
|
+
seealso: ["matrix", "sparse", "typeOf"]
|
|
4511
|
+
};
|
|
4512
|
+
|
|
4513
|
+
// src/embeddedDocs/function/matrix/identity.ts
|
|
4514
|
+
var identityDocs = {
|
|
4515
|
+
name: "identity",
|
|
4516
|
+
category: "Matrix",
|
|
4517
|
+
syntax: ["identity(n)", "identity(m, n)", "identity([m, n])"],
|
|
4518
|
+
description: "Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",
|
|
4519
|
+
examples: ["identity(3)", "identity(3, 5)", "a = [1, 2, 3; 4, 5, 6]", "identity(size(a))"],
|
|
4520
|
+
seealso: [
|
|
4521
|
+
"concat",
|
|
4522
|
+
"det",
|
|
4523
|
+
"diag",
|
|
4524
|
+
"inv",
|
|
4525
|
+
"ones",
|
|
4526
|
+
"range",
|
|
4527
|
+
"size",
|
|
4528
|
+
"squeeze",
|
|
4529
|
+
"subset",
|
|
4530
|
+
"trace",
|
|
4531
|
+
"transpose",
|
|
4532
|
+
"zeros"
|
|
4533
|
+
]
|
|
4534
|
+
};
|
|
4535
|
+
|
|
4536
|
+
// src/embeddedDocs/function/matrix/inv.ts
|
|
4537
|
+
var invDocs = {
|
|
4538
|
+
name: "inv",
|
|
4539
|
+
category: "Matrix",
|
|
4540
|
+
syntax: ["inv(x)"],
|
|
4541
|
+
description: "Calculate the inverse of a matrix",
|
|
4542
|
+
examples: ["inv([1, 2; 3, 4])", "inv(4)", "1 / 4"],
|
|
4543
|
+
seealso: [
|
|
4544
|
+
"concat",
|
|
4545
|
+
"det",
|
|
4546
|
+
"diag",
|
|
4547
|
+
"identity",
|
|
4548
|
+
"ones",
|
|
4549
|
+
"range",
|
|
4550
|
+
"size",
|
|
4551
|
+
"squeeze",
|
|
4552
|
+
"subset",
|
|
4553
|
+
"trace",
|
|
4554
|
+
"transpose",
|
|
4555
|
+
"zeros"
|
|
4556
|
+
]
|
|
4557
|
+
};
|
|
4558
|
+
|
|
4559
|
+
// src/embeddedDocs/function/matrix/pinv.ts
|
|
4560
|
+
var pinvDocs = {
|
|
4561
|
+
name: "pinv",
|
|
4562
|
+
category: "Matrix",
|
|
4563
|
+
syntax: ["pinv(x)"],
|
|
4564
|
+
description: "Calculate the Moore\u2013Penrose inverse of a matrix",
|
|
4565
|
+
examples: ["pinv([1, 2; 3, 4])", "pinv([[1, 0], [0, 1], [0, 1]])", "pinv(4)"],
|
|
4566
|
+
seealso: ["inv"]
|
|
4567
|
+
};
|
|
4568
|
+
|
|
4569
|
+
// src/embeddedDocs/function/matrix/kron.ts
|
|
4570
|
+
var kronDocs = {
|
|
4571
|
+
name: "kron",
|
|
4572
|
+
category: "Matrix",
|
|
4573
|
+
syntax: ["kron(x, y)"],
|
|
4574
|
+
description: "Calculates the Kronecker product of 2 matrices or vectors.",
|
|
4575
|
+
examples: ["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])", "kron([1,1], [2,3,4])"],
|
|
4576
|
+
seealso: ["multiply", "dot", "cross"]
|
|
4577
|
+
};
|
|
4578
|
+
|
|
4579
|
+
// src/embeddedDocs/function/matrix/map.ts
|
|
4580
|
+
var mapDocs = {
|
|
4581
|
+
name: "map",
|
|
4582
|
+
category: "Matrix",
|
|
4583
|
+
syntax: ["map(x, callback)", "map(x, y, ..., callback)"],
|
|
4584
|
+
description: "Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",
|
|
4585
|
+
examples: ["map([1, 2, 3], square)", "map([1, 2], [3, 4], f(a,b) = a + b)"],
|
|
4586
|
+
seealso: ["filter", "forEach"]
|
|
4587
|
+
};
|
|
4588
|
+
|
|
4589
|
+
// src/embeddedDocs/function/matrix/matrixFromColumns.ts
|
|
4590
|
+
var matrixFromColumnsDocs = {
|
|
4591
|
+
name: "matrixFromColumns",
|
|
4592
|
+
category: "Matrix",
|
|
4593
|
+
syntax: [
|
|
4594
|
+
"matrixFromColumns(...arr)",
|
|
4595
|
+
"matrixFromColumns(row1, row2)",
|
|
4596
|
+
"matrixFromColumns(row1, row2, row3)"
|
|
4597
|
+
],
|
|
4598
|
+
description: "Create a dense matrix from vectors as individual columns.",
|
|
4599
|
+
examples: ["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],
|
|
4600
|
+
seealso: ["matrix", "matrixFromRows", "matrixFromFunction", "zeros"]
|
|
4601
|
+
};
|
|
4602
|
+
|
|
4603
|
+
// src/embeddedDocs/function/matrix/matrixFromFunction.ts
|
|
4604
|
+
var matrixFromFunctionDocs = {
|
|
4605
|
+
name: "matrixFromFunction",
|
|
4606
|
+
category: "Matrix",
|
|
4607
|
+
syntax: [
|
|
4608
|
+
"matrixFromFunction(size, fn)",
|
|
4609
|
+
"matrixFromFunction(size, fn, format)",
|
|
4610
|
+
"matrixFromFunction(size, fn, format, datatype)",
|
|
4611
|
+
"matrixFromFunction(size, format, fn)",
|
|
4612
|
+
"matrixFromFunction(size, format, datatype, fn)"
|
|
4613
|
+
],
|
|
4614
|
+
description: "Create a matrix by evaluating a generating function at each index.",
|
|
4615
|
+
examples: [
|
|
4616
|
+
"f(I) = I[1] - I[2]",
|
|
4617
|
+
"matrixFromFunction([3,3], f)",
|
|
4618
|
+
"g(I) = I[1] - I[2] == 1 ? 4 : 0",
|
|
4619
|
+
'matrixFromFunction([100, 100], "sparse", g)',
|
|
4620
|
+
"matrixFromFunction([5], random)"
|
|
4621
|
+
],
|
|
4622
|
+
seealso: ["matrix", "matrixFromRows", "matrixFromColumns", "zeros"]
|
|
4623
|
+
};
|
|
4624
|
+
|
|
4625
|
+
// src/embeddedDocs/function/matrix/matrixFromRows.ts
|
|
4626
|
+
var matrixFromRowsDocs = {
|
|
4627
|
+
name: "matrixFromRows",
|
|
4628
|
+
category: "Matrix",
|
|
4629
|
+
syntax: [
|
|
4630
|
+
"matrixFromRows(...arr)",
|
|
4631
|
+
"matrixFromRows(row1, row2)",
|
|
4632
|
+
"matrixFromRows(row1, row2, row3)"
|
|
4633
|
+
],
|
|
4634
|
+
description: "Create a dense matrix from vectors as individual rows.",
|
|
4635
|
+
examples: ["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],
|
|
4636
|
+
seealso: ["matrix", "matrixFromColumns", "matrixFromFunction", "zeros"]
|
|
4637
|
+
};
|
|
4638
|
+
|
|
4639
|
+
// src/embeddedDocs/function/matrix/ones.ts
|
|
4640
|
+
var onesDocs = {
|
|
4641
|
+
name: "ones",
|
|
4642
|
+
category: "Matrix",
|
|
4643
|
+
syntax: [
|
|
4644
|
+
"ones(m)",
|
|
4645
|
+
"ones(m, n)",
|
|
4646
|
+
"ones(m, n, p, ...)",
|
|
4647
|
+
"ones([m])",
|
|
4648
|
+
"ones([m, n])",
|
|
4649
|
+
"ones([m, n, p, ...])"
|
|
4650
|
+
],
|
|
4651
|
+
description: "Create a matrix containing ones.",
|
|
4652
|
+
examples: [
|
|
4653
|
+
"ones(3)",
|
|
4654
|
+
"ones(3, 5)",
|
|
4655
|
+
"ones([2,3]) * 4.5",
|
|
4656
|
+
"a = [1, 2, 3; 4, 5, 6]",
|
|
4657
|
+
"ones(size(a))"
|
|
4658
|
+
],
|
|
4659
|
+
seealso: [
|
|
4660
|
+
"concat",
|
|
4661
|
+
"det",
|
|
4662
|
+
"diag",
|
|
4663
|
+
"identity",
|
|
4664
|
+
"inv",
|
|
4665
|
+
"range",
|
|
4666
|
+
"size",
|
|
4667
|
+
"squeeze",
|
|
4668
|
+
"subset",
|
|
4669
|
+
"trace",
|
|
4670
|
+
"transpose",
|
|
4671
|
+
"zeros"
|
|
4672
|
+
]
|
|
4673
|
+
};
|
|
4674
|
+
|
|
4675
|
+
// src/embeddedDocs/function/matrix/partitionSelect.ts
|
|
4676
|
+
var partitionSelectDocs = {
|
|
4677
|
+
name: "partitionSelect",
|
|
4678
|
+
category: "Matrix",
|
|
4679
|
+
syntax: ["partitionSelect(x, k)", "partitionSelect(x, k, compare)"],
|
|
4680
|
+
description: "Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",
|
|
4681
|
+
examples: [
|
|
4682
|
+
"partitionSelect([5, 10, 1], 2)",
|
|
4683
|
+
'partitionSelect(["C", "B", "A", "D"], 1, compareText)',
|
|
4684
|
+
"arr = [5, 2, 1]",
|
|
4685
|
+
"partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]",
|
|
4686
|
+
"arr",
|
|
4687
|
+
"partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]",
|
|
4688
|
+
"arr"
|
|
4689
|
+
],
|
|
4690
|
+
seealso: ["sort"]
|
|
4691
|
+
};
|
|
4692
|
+
|
|
4693
|
+
// src/embeddedDocs/function/matrix/range.ts
|
|
4694
|
+
var rangeDocs = {
|
|
4695
|
+
name: "range",
|
|
4696
|
+
category: "Type",
|
|
4697
|
+
syntax: [
|
|
4698
|
+
"start:end",
|
|
4699
|
+
"start:step:end",
|
|
4700
|
+
"range(start, end)",
|
|
4701
|
+
"range(start, end, step)",
|
|
4702
|
+
"range(string)"
|
|
4703
|
+
],
|
|
4704
|
+
description: "Create a range. Lower bound of the range is included, upper bound is excluded.",
|
|
4705
|
+
examples: [
|
|
4706
|
+
"1:5",
|
|
4707
|
+
"3:-1:-3",
|
|
4708
|
+
"range(3, 7)",
|
|
4709
|
+
"range(0, 12, 2)",
|
|
4710
|
+
'range("4:10")',
|
|
4711
|
+
"range(1m, 1m, 3m)",
|
|
4712
|
+
"a = [1, 2, 3, 4; 5, 6, 7, 8]",
|
|
4713
|
+
"a[1:2, 1:2]"
|
|
4714
|
+
],
|
|
4715
|
+
seealso: [
|
|
4716
|
+
"concat",
|
|
4717
|
+
"det",
|
|
4718
|
+
"diag",
|
|
4719
|
+
"identity",
|
|
4720
|
+
"inv",
|
|
4721
|
+
"ones",
|
|
4722
|
+
"size",
|
|
4723
|
+
"squeeze",
|
|
4724
|
+
"subset",
|
|
4725
|
+
"trace",
|
|
4726
|
+
"transpose",
|
|
4727
|
+
"zeros"
|
|
4728
|
+
]
|
|
4729
|
+
};
|
|
4730
|
+
|
|
4731
|
+
// src/embeddedDocs/function/matrix/reshape.ts
|
|
4732
|
+
var reshapeDocs = {
|
|
4733
|
+
name: "reshape",
|
|
4734
|
+
category: "Matrix",
|
|
4735
|
+
syntax: ["reshape(x, sizes)"],
|
|
4736
|
+
description: "Reshape a multi dimensional array to fit the specified dimensions.",
|
|
4737
|
+
examples: [
|
|
4738
|
+
"reshape([1, 2, 3, 4, 5, 6], [2, 3])",
|
|
4739
|
+
"reshape([[1, 2], [3, 4]], [1, 4])",
|
|
4740
|
+
"reshape([[1, 2], [3, 4]], [4])",
|
|
4741
|
+
"reshape([1, 2, 3, 4], [-1, 2])"
|
|
4742
|
+
],
|
|
4743
|
+
seealso: ["size", "squeeze", "resize"]
|
|
4744
|
+
};
|
|
4745
|
+
|
|
4746
|
+
// src/embeddedDocs/function/matrix/resize.ts
|
|
4747
|
+
var resizeDocs = {
|
|
4748
|
+
name: "resize",
|
|
4749
|
+
category: "Matrix",
|
|
4750
|
+
syntax: ["resize(x, size)", "resize(x, size, defaultValue)"],
|
|
4751
|
+
description: "Resize a matrix.",
|
|
4752
|
+
examples: [
|
|
4753
|
+
"resize([1,2,3,4,5], [3])",
|
|
4754
|
+
"resize([1,2,3], [5])",
|
|
4755
|
+
"resize([1,2,3], [5], -1)",
|
|
4756
|
+
"resize(2, [2, 3])",
|
|
4757
|
+
'resize("hello", [8], "!")'
|
|
4758
|
+
],
|
|
4759
|
+
seealso: ["size", "subset", "squeeze", "reshape"]
|
|
4760
|
+
};
|
|
4761
|
+
|
|
4762
|
+
// src/embeddedDocs/function/matrix/rotate.ts
|
|
4763
|
+
var rotateDocs = {
|
|
4764
|
+
name: "rotate",
|
|
4765
|
+
category: "Matrix",
|
|
4766
|
+
syntax: ["rotate(w, theta)", "rotate(w, theta, v)"],
|
|
4767
|
+
description: "Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",
|
|
4768
|
+
examples: [
|
|
4769
|
+
"rotate([1, 0], pi / 2)",
|
|
4770
|
+
'rotate(matrix([1, 0]), unit("35deg"))',
|
|
4771
|
+
'rotate([1, 0, 0], unit("90deg"), [0, 0, 1])',
|
|
4772
|
+
'rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'
|
|
4773
|
+
],
|
|
4774
|
+
seealso: ["matrix", "rotationMatrix"]
|
|
4775
|
+
};
|
|
4776
|
+
|
|
4777
|
+
// src/embeddedDocs/function/matrix/rotationMatrix.ts
|
|
4778
|
+
var rotationMatrixDocs = {
|
|
4779
|
+
name: "rotationMatrix",
|
|
4780
|
+
category: "Matrix",
|
|
4781
|
+
syntax: ["rotationMatrix(theta)", "rotationMatrix(theta, v)", "rotationMatrix(theta, v, format)"],
|
|
4782
|
+
description: "Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",
|
|
4783
|
+
examples: [
|
|
4784
|
+
"rotationMatrix(pi / 2)",
|
|
4785
|
+
'rotationMatrix(unit("45deg"), [0, 0, 1])',
|
|
4786
|
+
'rotationMatrix(1, matrix([0, 0, 1]), "sparse")'
|
|
4787
|
+
],
|
|
4788
|
+
seealso: ["cos", "sin"]
|
|
4789
|
+
};
|
|
4790
|
+
|
|
4791
|
+
// src/embeddedDocs/function/matrix/row.ts
|
|
4792
|
+
var rowDocs = {
|
|
4793
|
+
name: "row",
|
|
4794
|
+
category: "Matrix",
|
|
4795
|
+
syntax: ["row(x, index)"],
|
|
4796
|
+
description: "Return a row from a matrix or array.",
|
|
4797
|
+
examples: ["A = [[1, 2], [3, 4]]", "row(A, 1)", "row(A, 2)"],
|
|
4798
|
+
seealso: ["column", "matrixFromRows"]
|
|
4799
|
+
};
|
|
4800
|
+
|
|
4801
|
+
// src/embeddedDocs/function/matrix/size.ts
|
|
4802
|
+
var sizeDocs = {
|
|
4803
|
+
name: "size",
|
|
4804
|
+
category: "Matrix",
|
|
4805
|
+
syntax: ["size(x)"],
|
|
4806
|
+
description: "Calculate the size of a matrix.",
|
|
4807
|
+
examples: ["size(2.3)", 'size("hello world")', "a = [1, 2; 3, 4; 5, 6]", "size(a)", "size(1:6)"],
|
|
4808
|
+
seealso: [
|
|
4809
|
+
"concat",
|
|
4810
|
+
"count",
|
|
4811
|
+
"det",
|
|
4812
|
+
"diag",
|
|
4813
|
+
"identity",
|
|
4814
|
+
"inv",
|
|
4815
|
+
"ones",
|
|
4816
|
+
"range",
|
|
4817
|
+
"squeeze",
|
|
4818
|
+
"subset",
|
|
4819
|
+
"trace",
|
|
4820
|
+
"transpose",
|
|
4821
|
+
"zeros"
|
|
4822
|
+
]
|
|
4823
|
+
};
|
|
4824
|
+
|
|
4825
|
+
// src/embeddedDocs/function/matrix/sort.ts
|
|
4826
|
+
var sortDocs = {
|
|
4827
|
+
name: "sort",
|
|
4828
|
+
category: "Matrix",
|
|
4829
|
+
syntax: ["sort(x)", "sort(x, compare)"],
|
|
4830
|
+
description: 'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',
|
|
4831
|
+
examples: [
|
|
4832
|
+
"sort([5, 10, 1])",
|
|
4833
|
+
'sort(["C", "B", "A", "D"], "natural")',
|
|
4834
|
+
"sortByLength(a, b) = size(a)[1] - size(b)[1]",
|
|
4835
|
+
'sort(["Langdon", "Tom", "Sara"], sortByLength)',
|
|
4836
|
+
'sort(["10", "1", "2"], "natural")'
|
|
4837
|
+
],
|
|
4838
|
+
seealso: ["map", "filter", "forEach"]
|
|
4839
|
+
};
|
|
4840
|
+
|
|
4841
|
+
// src/embeddedDocs/function/matrix/squeeze.ts
|
|
4842
|
+
var squeezeDocs = {
|
|
4843
|
+
name: "squeeze",
|
|
4844
|
+
category: "Matrix",
|
|
4845
|
+
syntax: ["squeeze(x)"],
|
|
4846
|
+
description: "Remove inner and outer singleton dimensions from a matrix.",
|
|
4847
|
+
examples: ["a = zeros(3,2,1)", "size(squeeze(a))", "b = zeros(1,1,3)", "size(squeeze(b))"],
|
|
4848
|
+
seealso: [
|
|
4849
|
+
"concat",
|
|
4850
|
+
"det",
|
|
4851
|
+
"diag",
|
|
4852
|
+
"identity",
|
|
4853
|
+
"inv",
|
|
4854
|
+
"ones",
|
|
4855
|
+
"range",
|
|
4856
|
+
"size",
|
|
4857
|
+
"subset",
|
|
4858
|
+
"trace",
|
|
4859
|
+
"transpose",
|
|
4860
|
+
"zeros"
|
|
4861
|
+
]
|
|
4862
|
+
};
|
|
4863
|
+
|
|
4864
|
+
// src/embeddedDocs/function/matrix/subset.ts
|
|
4865
|
+
var subsetDocs = {
|
|
4866
|
+
name: "subset",
|
|
4867
|
+
category: "Matrix",
|
|
4868
|
+
syntax: [
|
|
4869
|
+
"value(index)",
|
|
4870
|
+
"value(index) = replacement",
|
|
4871
|
+
"subset(value, [index])",
|
|
4872
|
+
"subset(value, [index], replacement)"
|
|
4873
|
+
],
|
|
4874
|
+
description: "Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",
|
|
4875
|
+
examples: [
|
|
4876
|
+
"d = [1, 2; 3, 4]",
|
|
4877
|
+
"e = []",
|
|
4878
|
+
"e[1, 1:2] = [5, 6]",
|
|
4879
|
+
"e[2, :] = [7, 8]",
|
|
4880
|
+
"f = d * e",
|
|
4881
|
+
"f[2, 1]",
|
|
4882
|
+
"f[:, 1]",
|
|
4883
|
+
"f[[1,2], [1,3]] = [9, 10; 11, 12]",
|
|
4884
|
+
"f"
|
|
4885
|
+
],
|
|
4886
|
+
seealso: [
|
|
4887
|
+
"concat",
|
|
4888
|
+
"det",
|
|
4889
|
+
"diag",
|
|
4890
|
+
"identity",
|
|
4891
|
+
"inv",
|
|
4892
|
+
"ones",
|
|
4893
|
+
"range",
|
|
4894
|
+
"size",
|
|
4895
|
+
"squeeze",
|
|
4896
|
+
"trace",
|
|
4897
|
+
"transpose",
|
|
4898
|
+
"zeros"
|
|
4899
|
+
]
|
|
4900
|
+
};
|
|
4901
|
+
|
|
4902
|
+
// src/embeddedDocs/function/matrix/trace.ts
|
|
4903
|
+
var traceDocs = {
|
|
4904
|
+
name: "trace",
|
|
4905
|
+
category: "Matrix",
|
|
4906
|
+
syntax: ["trace(A)"],
|
|
4907
|
+
description: "Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",
|
|
4908
|
+
examples: ["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]", "trace(A)"],
|
|
4909
|
+
seealso: [
|
|
4910
|
+
"concat",
|
|
4911
|
+
"det",
|
|
4912
|
+
"diag",
|
|
4913
|
+
"identity",
|
|
4914
|
+
"inv",
|
|
4915
|
+
"ones",
|
|
4916
|
+
"range",
|
|
4917
|
+
"size",
|
|
4918
|
+
"squeeze",
|
|
4919
|
+
"subset",
|
|
4920
|
+
"transpose",
|
|
4921
|
+
"zeros"
|
|
4922
|
+
]
|
|
4923
|
+
};
|
|
4924
|
+
|
|
4925
|
+
// src/embeddedDocs/function/matrix/transpose.ts
|
|
4926
|
+
var transposeDocs = {
|
|
4927
|
+
name: "transpose",
|
|
4928
|
+
category: "Matrix",
|
|
4929
|
+
syntax: ["x'", "transpose(x)"],
|
|
4930
|
+
description: "Transpose a matrix",
|
|
4931
|
+
examples: ["a = [1, 2, 3; 4, 5, 6]", "a'", "transpose(a)"],
|
|
4932
|
+
seealso: [
|
|
4933
|
+
"concat",
|
|
4934
|
+
"det",
|
|
4935
|
+
"diag",
|
|
4936
|
+
"identity",
|
|
4937
|
+
"inv",
|
|
4938
|
+
"ones",
|
|
4939
|
+
"range",
|
|
4940
|
+
"size",
|
|
4941
|
+
"squeeze",
|
|
4942
|
+
"subset",
|
|
4943
|
+
"trace",
|
|
4944
|
+
"zeros"
|
|
4945
|
+
]
|
|
4946
|
+
};
|
|
4947
|
+
|
|
4948
|
+
// src/embeddedDocs/function/matrix/zeros.ts
|
|
4949
|
+
var zerosDocs = {
|
|
4950
|
+
name: "zeros",
|
|
4951
|
+
category: "Matrix",
|
|
4952
|
+
syntax: [
|
|
4953
|
+
"zeros(m)",
|
|
4954
|
+
"zeros(m, n)",
|
|
4955
|
+
"zeros(m, n, p, ...)",
|
|
4956
|
+
"zeros([m])",
|
|
4957
|
+
"zeros([m, n])",
|
|
4958
|
+
"zeros([m, n, p, ...])"
|
|
4959
|
+
],
|
|
4960
|
+
description: "Create a matrix containing zeros.",
|
|
4961
|
+
examples: ["zeros(3)", "zeros(3, 5)", "a = [1, 2, 3; 4, 5, 6]", "zeros(size(a))"],
|
|
4962
|
+
seealso: [
|
|
4963
|
+
"concat",
|
|
4964
|
+
"det",
|
|
4965
|
+
"diag",
|
|
4966
|
+
"identity",
|
|
4967
|
+
"inv",
|
|
4968
|
+
"ones",
|
|
4969
|
+
"range",
|
|
4970
|
+
"size",
|
|
4971
|
+
"squeeze",
|
|
4972
|
+
"subset",
|
|
4973
|
+
"trace",
|
|
4974
|
+
"transpose"
|
|
4975
|
+
]
|
|
4976
|
+
};
|
|
4977
|
+
|
|
4978
|
+
// src/embeddedDocs/function/matrix/fft.ts
|
|
4979
|
+
var fftDocs = {
|
|
4980
|
+
name: "fft",
|
|
4981
|
+
category: "Matrix",
|
|
4982
|
+
syntax: ["fft(x)"],
|
|
4983
|
+
description: "Calculate N-dimensional Fourier transform",
|
|
4984
|
+
examples: ["fft([[1, 0], [1, 0]])"],
|
|
4985
|
+
seealso: ["ifft"]
|
|
4986
|
+
};
|
|
4987
|
+
|
|
4988
|
+
// src/embeddedDocs/function/matrix/ifft.ts
|
|
4989
|
+
var ifftDocs = {
|
|
4990
|
+
name: "ifft",
|
|
4991
|
+
category: "Matrix",
|
|
4992
|
+
syntax: ["ifft(x)"],
|
|
4993
|
+
description: "Calculate N-dimensional inverse Fourier transform",
|
|
4994
|
+
examples: ["ifft([[2, 2], [0, 0]])"],
|
|
4995
|
+
seealso: ["fft"]
|
|
4996
|
+
};
|
|
4997
|
+
|
|
4998
|
+
// src/embeddedDocs/function/probability/bernoulli.ts
|
|
4999
|
+
var bernoulliDocs = {
|
|
5000
|
+
name: "bernoulli",
|
|
5001
|
+
category: "Probability",
|
|
5002
|
+
syntax: ["bernoulli(n)"],
|
|
5003
|
+
description: "The nth Bernoulli number",
|
|
5004
|
+
examples: ["bernoulli(4)", "bernoulli(fraction(12))"],
|
|
5005
|
+
seealso: ["combinations", "gamma", "stirlingS2"]
|
|
5006
|
+
};
|
|
5007
|
+
|
|
5008
|
+
// src/embeddedDocs/function/probability/combinations.ts
|
|
5009
|
+
var combinationsDocs = {
|
|
5010
|
+
name: "combinations",
|
|
5011
|
+
category: "Probability",
|
|
5012
|
+
syntax: ["combinations(n, k)"],
|
|
5013
|
+
description: "Compute the number of combinations of n items taken k at a time",
|
|
5014
|
+
examples: ["combinations(7, 5)"],
|
|
5015
|
+
seealso: ["combinationsWithRep", "permutations", "factorial"]
|
|
5016
|
+
};
|
|
5017
|
+
|
|
5018
|
+
// src/embeddedDocs/function/probability/combinationsWithRep.ts
|
|
5019
|
+
var combinationsWithRepDocs = {
|
|
5020
|
+
name: "combinationsWithRep",
|
|
5021
|
+
category: "Probability",
|
|
5022
|
+
syntax: ["combinationsWithRep(n, k)"],
|
|
5023
|
+
description: "Compute the number of combinations of n items taken k at a time with replacements.",
|
|
5024
|
+
examples: ["combinationsWithRep(7, 5)"],
|
|
5025
|
+
seealso: ["combinations", "permutations", "factorial"]
|
|
5026
|
+
};
|
|
5027
|
+
|
|
5028
|
+
// src/embeddedDocs/function/probability/factorial.ts
|
|
5029
|
+
var factorialDocs = {
|
|
5030
|
+
name: "factorial",
|
|
5031
|
+
category: "Probability",
|
|
5032
|
+
syntax: ["n!", "factorial(n)"],
|
|
5033
|
+
description: "Compute the factorial of a value",
|
|
5034
|
+
examples: ["5!", "5 * 4 * 3 * 2 * 1", "3!"],
|
|
5035
|
+
seealso: ["combinations", "combinationsWithRep", "permutations", "gamma"]
|
|
5036
|
+
};
|
|
5037
|
+
|
|
5038
|
+
// src/embeddedDocs/function/probability/gamma.ts
|
|
5039
|
+
var gammaDocs = {
|
|
5040
|
+
name: "gamma",
|
|
5041
|
+
category: "Probability",
|
|
5042
|
+
syntax: ["gamma(n)"],
|
|
5043
|
+
description: "Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",
|
|
5044
|
+
examples: ["gamma(4)", "3!", "gamma(1/2)", "sqrt(pi)"],
|
|
5045
|
+
seealso: ["factorial"]
|
|
5046
|
+
};
|
|
5047
|
+
|
|
5048
|
+
// src/embeddedDocs/function/probability/lgamma.ts
|
|
5049
|
+
var lgammaDocs = {
|
|
5050
|
+
name: "lgamma",
|
|
5051
|
+
category: "Probability",
|
|
5052
|
+
syntax: ["lgamma(n)"],
|
|
5053
|
+
description: "Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",
|
|
5054
|
+
examples: ["lgamma(4)", "lgamma(1/2)", "lgamma(i)", "lgamma(complex(1.1, 2))"],
|
|
5055
|
+
seealso: ["gamma"]
|
|
5056
|
+
};
|
|
5057
|
+
|
|
5058
|
+
// src/embeddedDocs/function/probability/kldivergence.ts
|
|
5059
|
+
var kldivergenceDocs = {
|
|
5060
|
+
name: "kldivergence",
|
|
5061
|
+
category: "Probability",
|
|
5062
|
+
syntax: ["kldivergence(x, y)"],
|
|
5063
|
+
description: "Calculate the Kullback-Leibler (KL) divergence between two distributions.",
|
|
5064
|
+
examples: ["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],
|
|
5065
|
+
seealso: []
|
|
5066
|
+
};
|
|
5067
|
+
|
|
5068
|
+
// src/embeddedDocs/function/probability/multinomial.ts
|
|
5069
|
+
var multinomialDocs = {
|
|
5070
|
+
name: "multinomial",
|
|
5071
|
+
category: "Probability",
|
|
5072
|
+
syntax: ["multinomial(A)"],
|
|
5073
|
+
description: "Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",
|
|
5074
|
+
examples: ["multinomial([1, 2, 1])"],
|
|
5075
|
+
seealso: ["combinations", "factorial"]
|
|
5076
|
+
};
|
|
5077
|
+
|
|
5078
|
+
// src/embeddedDocs/function/probability/permutations.ts
|
|
5079
|
+
var permutationsDocs = {
|
|
5080
|
+
name: "permutations",
|
|
5081
|
+
category: "Probability",
|
|
5082
|
+
syntax: ["permutations(n)", "permutations(n, k)"],
|
|
5083
|
+
description: "Compute the number of permutations of n items taken k at a time",
|
|
5084
|
+
examples: ["permutations(5)", "permutations(5, 3)"],
|
|
5085
|
+
seealso: ["combinations", "combinationsWithRep", "factorial"]
|
|
5086
|
+
};
|
|
5087
|
+
|
|
5088
|
+
// src/embeddedDocs/function/probability/pickRandom.ts
|
|
5089
|
+
var pickRandomDocs = {
|
|
5090
|
+
name: "pickRandom",
|
|
5091
|
+
category: "Probability",
|
|
5092
|
+
syntax: [
|
|
5093
|
+
"pickRandom(array)",
|
|
5094
|
+
"pickRandom(array, number)",
|
|
5095
|
+
"pickRandom(array, weights)",
|
|
5096
|
+
"pickRandom(array, number, weights)",
|
|
5097
|
+
"pickRandom(array, weights, number)"
|
|
5098
|
+
],
|
|
5099
|
+
description: "Pick a random entry from a given array.",
|
|
5100
|
+
examples: [
|
|
5101
|
+
"pickRandom(0:10)",
|
|
5102
|
+
"pickRandom([1, 3, 1, 6])",
|
|
5103
|
+
"pickRandom([1, 3, 1, 6], 2)",
|
|
5104
|
+
"pickRandom([1, 3, 1, 6], [2, 3, 2, 1])",
|
|
5105
|
+
"pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])",
|
|
5106
|
+
"pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"
|
|
5107
|
+
],
|
|
5108
|
+
seealso: ["random", "randomInt"]
|
|
5109
|
+
};
|
|
5110
|
+
|
|
5111
|
+
// src/embeddedDocs/function/probability/random.ts
|
|
5112
|
+
var randomDocs = {
|
|
5113
|
+
name: "random",
|
|
5114
|
+
category: "Probability",
|
|
5115
|
+
syntax: [
|
|
5116
|
+
"random()",
|
|
5117
|
+
"random(max)",
|
|
5118
|
+
"random(min, max)",
|
|
5119
|
+
"random(size)",
|
|
5120
|
+
"random(size, max)",
|
|
5121
|
+
"random(size, min, max)"
|
|
5122
|
+
],
|
|
5123
|
+
description: "Return a random number.",
|
|
5124
|
+
examples: ["random()", "random(10, 20)", "random([2, 3])"],
|
|
5125
|
+
seealso: ["pickRandom", "randomInt"]
|
|
5126
|
+
};
|
|
5127
|
+
|
|
5128
|
+
// src/embeddedDocs/function/probability/randomInt.ts
|
|
5129
|
+
var randomIntDocs = {
|
|
5130
|
+
name: "randomInt",
|
|
5131
|
+
category: "Probability",
|
|
5132
|
+
syntax: [
|
|
5133
|
+
"randomInt(max)",
|
|
5134
|
+
"randomInt(min, max)",
|
|
5135
|
+
"randomInt(size)",
|
|
5136
|
+
"randomInt(size, max)",
|
|
5137
|
+
"randomInt(size, min, max)"
|
|
5138
|
+
],
|
|
5139
|
+
description: "Return a random integer number",
|
|
5140
|
+
examples: ["randomInt(10, 20)", "randomInt([2, 3], 10)"],
|
|
5141
|
+
seealso: ["pickRandom", "random"]
|
|
5142
|
+
};
|
|
5143
|
+
|
|
5144
|
+
// src/embeddedDocs/function/relational/compare.ts
|
|
5145
|
+
var compareDocs = {
|
|
5146
|
+
name: "compare",
|
|
5147
|
+
category: "Relational",
|
|
5148
|
+
syntax: ["compare(x, y)"],
|
|
5149
|
+
description: "Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",
|
|
5150
|
+
examples: [
|
|
5151
|
+
"compare(2, 3)",
|
|
5152
|
+
"compare(3, 2)",
|
|
5153
|
+
"compare(2, 2)",
|
|
5154
|
+
"compare(5cm, 40mm)",
|
|
5155
|
+
"compare(2, [1, 2, 3])"
|
|
5156
|
+
],
|
|
5157
|
+
seealso: [
|
|
5158
|
+
"equal",
|
|
5159
|
+
"unequal",
|
|
5160
|
+
"smaller",
|
|
5161
|
+
"smallerEq",
|
|
5162
|
+
"largerEq",
|
|
5163
|
+
"compareNatural",
|
|
5164
|
+
"compareText"
|
|
5165
|
+
]
|
|
5166
|
+
};
|
|
5167
|
+
|
|
5168
|
+
// src/embeddedDocs/function/relational/compareNatural.ts
|
|
5169
|
+
var compareNaturalDocs = {
|
|
5170
|
+
name: "compareNatural",
|
|
5171
|
+
category: "Relational",
|
|
5172
|
+
syntax: ["compareNatural(x, y)"],
|
|
5173
|
+
description: "Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",
|
|
5174
|
+
examples: [
|
|
5175
|
+
"compareNatural(2, 3)",
|
|
5176
|
+
"compareNatural(3, 2)",
|
|
5177
|
+
"compareNatural(2, 2)",
|
|
5178
|
+
"compareNatural(5cm, 40mm)",
|
|
5179
|
+
'compareNatural("2", "10")',
|
|
5180
|
+
"compareNatural(2 + 3i, 2 + 4i)",
|
|
5181
|
+
"compareNatural([1, 2, 4], [1, 2, 3])",
|
|
5182
|
+
"compareNatural([1, 5], [1, 2, 3])",
|
|
5183
|
+
"compareNatural([1, 2], [1, 2])",
|
|
5184
|
+
"compareNatural({a: 2}, {a: 4})"
|
|
5185
|
+
],
|
|
5186
|
+
seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compare", "compareText"]
|
|
5187
|
+
};
|
|
5188
|
+
|
|
5189
|
+
// src/embeddedDocs/function/relational/compareText.ts
|
|
5190
|
+
var compareTextDocs = {
|
|
5191
|
+
name: "compareText",
|
|
5192
|
+
category: "Relational",
|
|
5193
|
+
syntax: ["compareText(x, y)"],
|
|
5194
|
+
description: "Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",
|
|
5195
|
+
examples: [
|
|
5196
|
+
'compareText("B", "A")',
|
|
5197
|
+
'compareText("A", "B")',
|
|
5198
|
+
'compareText("A", "A")',
|
|
5199
|
+
'compareText("2", "10")',
|
|
5200
|
+
'compare("2", "10")',
|
|
5201
|
+
"compare(2, 10)",
|
|
5202
|
+
'compareNatural("2", "10")',
|
|
5203
|
+
'compareText("B", ["A", "B", "C"])'
|
|
5204
|
+
],
|
|
5205
|
+
seealso: ["compare", "compareNatural"]
|
|
5206
|
+
};
|
|
5207
|
+
|
|
5208
|
+
// src/embeddedDocs/function/relational/deepEqual.ts
|
|
5209
|
+
var deepEqualDocs = {
|
|
5210
|
+
name: "deepEqual",
|
|
5211
|
+
category: "Relational",
|
|
5212
|
+
syntax: ["deepEqual(x, y)"],
|
|
5213
|
+
description: "Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",
|
|
5214
|
+
examples: ["deepEqual([1,3,4], [1,3,4])", "deepEqual([1,3,4], [1,3])"],
|
|
5215
|
+
seealso: ["equal", "unequal", "smaller", "larger", "smallerEq", "largerEq", "compare"]
|
|
5216
|
+
};
|
|
5217
|
+
|
|
5218
|
+
// src/embeddedDocs/function/relational/equal.ts
|
|
5219
|
+
var equalDocs = {
|
|
5220
|
+
name: "equal",
|
|
5221
|
+
category: "Relational",
|
|
5222
|
+
syntax: ["x == y", "equal(x, y)"],
|
|
5223
|
+
description: "Check equality of two values. Returns true if the values are equal, and false if not.",
|
|
5224
|
+
examples: ["2+2 == 3", "2+2 == 4", "a = 3.2", "b = 6-2.8", "a == b", "50cm == 0.5m"],
|
|
5225
|
+
seealso: [
|
|
5226
|
+
"unequal",
|
|
5227
|
+
"smaller",
|
|
5228
|
+
"larger",
|
|
5229
|
+
"smallerEq",
|
|
5230
|
+
"largerEq",
|
|
5231
|
+
"compare",
|
|
5232
|
+
"deepEqual",
|
|
5233
|
+
"equalText"
|
|
5234
|
+
]
|
|
5235
|
+
};
|
|
5236
|
+
|
|
5237
|
+
// src/embeddedDocs/function/relational/equalText.ts
|
|
5238
|
+
var equalTextDocs = {
|
|
5239
|
+
name: "equalText",
|
|
5240
|
+
category: "Relational",
|
|
5241
|
+
syntax: ["equalText(x, y)"],
|
|
5242
|
+
description: "Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",
|
|
5243
|
+
examples: [
|
|
5244
|
+
'equalText("Hello", "Hello")',
|
|
5245
|
+
'equalText("a", "A")',
|
|
5246
|
+
'equal("2e3", "2000")',
|
|
5247
|
+
'equalText("2e3", "2000")',
|
|
5248
|
+
'equalText("B", ["A", "B", "C"])'
|
|
5249
|
+
],
|
|
5250
|
+
seealso: ["compare", "compareNatural", "compareText", "equal"]
|
|
5251
|
+
};
|
|
5252
|
+
|
|
5253
|
+
// src/embeddedDocs/function/relational/larger.ts
|
|
5254
|
+
var largerDocs = {
|
|
5255
|
+
name: "larger",
|
|
5256
|
+
category: "Relational",
|
|
5257
|
+
syntax: ["x > y", "larger(x, y)"],
|
|
5258
|
+
description: "Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.",
|
|
5259
|
+
examples: ["2 > 3", "5 > 2*2", "a = 3.3", "b = 6-2.8", "(a > b)", "(b < a)", "5 cm > 2 inch"],
|
|
5260
|
+
seealso: ["equal", "unequal", "smaller", "smallerEq", "largerEq", "compare"]
|
|
5261
|
+
};
|
|
5262
|
+
|
|
5263
|
+
// src/embeddedDocs/function/relational/largerEq.ts
|
|
5264
|
+
var largerEqDocs = {
|
|
5265
|
+
name: "largerEq",
|
|
5266
|
+
category: "Relational",
|
|
5267
|
+
syntax: ["x >= y", "largerEq(x, y)"],
|
|
5268
|
+
description: "Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",
|
|
5269
|
+
examples: ["2 >= 1+1", "2 > 1+1", "a = 3.2", "b = 6-2.8", "(a >= b)"],
|
|
5270
|
+
seealso: ["equal", "unequal", "smallerEq", "smaller", "compare"]
|
|
5271
|
+
};
|
|
5272
|
+
|
|
5273
|
+
// src/embeddedDocs/function/relational/smaller.ts
|
|
5274
|
+
var smallerDocs = {
|
|
5275
|
+
name: "smaller",
|
|
5276
|
+
category: "Relational",
|
|
5277
|
+
syntax: ["x < y", "smaller(x, y)"],
|
|
5278
|
+
description: "Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.",
|
|
5279
|
+
examples: ["2 < 3", "5 < 2*2", "a = 3.3", "b = 6-2.8", "(a < b)", "5 cm < 2 inch"],
|
|
5280
|
+
seealso: ["equal", "unequal", "larger", "smallerEq", "largerEq", "compare"]
|
|
5281
|
+
};
|
|
5282
|
+
|
|
5283
|
+
// src/embeddedDocs/function/relational/smallerEq.ts
|
|
5284
|
+
var smallerEqDocs = {
|
|
5285
|
+
name: "smallerEq",
|
|
5286
|
+
category: "Relational",
|
|
5287
|
+
syntax: ["x <= y", "smallerEq(x, y)"],
|
|
5288
|
+
description: "Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",
|
|
5289
|
+
examples: ["2 <= 1+1", "2 < 1+1", "a = 3.2", "b = 6-2.8", "(a <= b)"],
|
|
5290
|
+
seealso: ["equal", "unequal", "larger", "smaller", "largerEq", "compare"]
|
|
5291
|
+
};
|
|
5292
|
+
|
|
5293
|
+
// src/embeddedDocs/function/relational/unequal.ts
|
|
5294
|
+
var unequalDocs = {
|
|
5295
|
+
name: "unequal",
|
|
5296
|
+
category: "Relational",
|
|
5297
|
+
syntax: ["x != y", "unequal(x, y)"],
|
|
5298
|
+
description: "Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",
|
|
5299
|
+
examples: [
|
|
5300
|
+
"2+2 != 3",
|
|
5301
|
+
"2+2 != 4",
|
|
5302
|
+
"a = 3.2",
|
|
5303
|
+
"b = 6-2.8",
|
|
5304
|
+
"a != b",
|
|
5305
|
+
"50cm != 0.5m",
|
|
5306
|
+
"5 cm != 2 inch"
|
|
5307
|
+
],
|
|
5308
|
+
seealso: ["equal", "smaller", "larger", "smallerEq", "largerEq", "compare", "deepEqual"]
|
|
5309
|
+
};
|
|
5310
|
+
|
|
5311
|
+
// src/embeddedDocs/function/set/setCartesian.ts
|
|
5312
|
+
var setCartesianDocs = {
|
|
5313
|
+
name: "setCartesian",
|
|
5314
|
+
category: "Set",
|
|
5315
|
+
syntax: ["setCartesian(set1, set2)"],
|
|
5316
|
+
description: "Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",
|
|
5317
|
+
examples: ["setCartesian([1, 2], [3, 4])"],
|
|
5318
|
+
seealso: ["setUnion", "setIntersect", "setDifference", "setPowerset"]
|
|
5319
|
+
};
|
|
5320
|
+
|
|
5321
|
+
// src/embeddedDocs/function/set/setDifference.ts
|
|
5322
|
+
var setDifferenceDocs = {
|
|
5323
|
+
name: "setDifference",
|
|
5324
|
+
category: "Set",
|
|
5325
|
+
syntax: ["setDifference(set1, set2)"],
|
|
5326
|
+
description: "Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",
|
|
5327
|
+
examples: [
|
|
5328
|
+
"setDifference([1, 2, 3, 4], [3, 4, 5, 6])",
|
|
5329
|
+
"setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"
|
|
5330
|
+
],
|
|
5331
|
+
seealso: ["setUnion", "setIntersect", "setSymDifference"]
|
|
5332
|
+
};
|
|
5333
|
+
|
|
5334
|
+
// src/embeddedDocs/function/set/setDistinct.ts
|
|
5335
|
+
var setDistinctDocs = {
|
|
5336
|
+
name: "setDistinct",
|
|
5337
|
+
category: "Set",
|
|
5338
|
+
syntax: ["setDistinct(set)"],
|
|
5339
|
+
description: "Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",
|
|
5340
|
+
examples: ["setDistinct([1, 1, 1, 2, 2, 3])"],
|
|
5341
|
+
seealso: ["setMultiplicity"]
|
|
5342
|
+
};
|
|
5343
|
+
|
|
5344
|
+
// src/embeddedDocs/function/set/setIntersect.ts
|
|
5345
|
+
var setIntersectDocs = {
|
|
5346
|
+
name: "setIntersect",
|
|
5347
|
+
category: "Set",
|
|
5348
|
+
syntax: ["setIntersect(set1, set2)"],
|
|
5349
|
+
description: "Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",
|
|
5350
|
+
examples: [
|
|
5351
|
+
"setIntersect([1, 2, 3, 4], [3, 4, 5, 6])",
|
|
5352
|
+
"setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"
|
|
5353
|
+
],
|
|
5354
|
+
seealso: ["setUnion", "setDifference"]
|
|
5355
|
+
};
|
|
5356
|
+
|
|
5357
|
+
// src/embeddedDocs/function/set/setIsSubset.ts
|
|
5358
|
+
var setIsSubsetDocs = {
|
|
5359
|
+
name: "setIsSubset",
|
|
5360
|
+
category: "Set",
|
|
5361
|
+
syntax: ["setIsSubset(set1, set2)"],
|
|
5362
|
+
description: "Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",
|
|
5363
|
+
examples: ["setIsSubset([1, 2], [3, 4, 5, 6])", "setIsSubset([3, 4], [3, 4, 5, 6])"],
|
|
5364
|
+
seealso: ["setUnion", "setIntersect", "setDifference"]
|
|
5365
|
+
};
|
|
5366
|
+
|
|
5367
|
+
// src/embeddedDocs/function/set/setMultiplicity.ts
|
|
5368
|
+
var setMultiplicityDocs = {
|
|
5369
|
+
name: "setMultiplicity",
|
|
5370
|
+
category: "Set",
|
|
5371
|
+
syntax: ["setMultiplicity(element, set)"],
|
|
5372
|
+
description: "Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",
|
|
5373
|
+
examples: ["setMultiplicity(1, [1, 2, 2, 4])", "setMultiplicity(2, [1, 2, 2, 4])"],
|
|
5374
|
+
seealso: ["setDistinct", "setSize"]
|
|
5375
|
+
};
|
|
5376
|
+
|
|
5377
|
+
// src/embeddedDocs/function/set/setPowerset.ts
|
|
5378
|
+
var setPowersetDocs = {
|
|
5379
|
+
name: "setPowerset",
|
|
5380
|
+
category: "Set",
|
|
5381
|
+
syntax: ["setPowerset(set)"],
|
|
5382
|
+
description: "Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",
|
|
5383
|
+
examples: ["setPowerset([1, 2, 3])"],
|
|
5384
|
+
seealso: ["setCartesian"]
|
|
5385
|
+
};
|
|
5386
|
+
|
|
5387
|
+
// src/embeddedDocs/function/set/setSize.ts
|
|
5388
|
+
var setSizeDocs = {
|
|
5389
|
+
name: "setSize",
|
|
5390
|
+
category: "Set",
|
|
5391
|
+
syntax: ["setSize(set)", "setSize(set, unique)"],
|
|
5392
|
+
description: 'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',
|
|
5393
|
+
examples: ["setSize([1, 2, 2, 4])", "setSize([1, 2, 2, 4], true)"],
|
|
5394
|
+
seealso: ["setUnion", "setIntersect", "setDifference"]
|
|
5395
|
+
};
|
|
5396
|
+
|
|
5397
|
+
// src/embeddedDocs/function/set/setSymDifference.ts
|
|
5398
|
+
var setSymDifferenceDocs = {
|
|
5399
|
+
name: "setSymDifference",
|
|
5400
|
+
category: "Set",
|
|
5401
|
+
syntax: ["setSymDifference(set1, set2)"],
|
|
5402
|
+
description: "Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",
|
|
5403
|
+
examples: [
|
|
5404
|
+
"setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])",
|
|
5405
|
+
"setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"
|
|
5406
|
+
],
|
|
5407
|
+
seealso: ["setUnion", "setIntersect", "setDifference"]
|
|
5408
|
+
};
|
|
5409
|
+
|
|
5410
|
+
// src/embeddedDocs/function/set/setUnion.ts
|
|
5411
|
+
var setUnionDocs = {
|
|
5412
|
+
name: "setUnion",
|
|
5413
|
+
category: "Set",
|
|
5414
|
+
syntax: ["setUnion(set1, set2)"],
|
|
5415
|
+
description: "Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",
|
|
5416
|
+
examples: [
|
|
5417
|
+
"setUnion([1, 2, 3, 4], [3, 4, 5, 6])",
|
|
5418
|
+
"setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"
|
|
5419
|
+
],
|
|
5420
|
+
seealso: ["setIntersect", "setDifference"]
|
|
5421
|
+
};
|
|
5422
|
+
|
|
5423
|
+
// src/embeddedDocs/function/signal/zpk2tf.ts
|
|
5424
|
+
var zpk2tfDocs = {
|
|
5425
|
+
name: "zpk2tf",
|
|
5426
|
+
category: "Signal",
|
|
5427
|
+
syntax: ["zpk2tf(z, p, k)"],
|
|
5428
|
+
description: "Compute the transfer function of a zero-pole-gain model.",
|
|
5429
|
+
examples: [
|
|
5430
|
+
"zpk2tf([1, 2], [-1, -2], 1)",
|
|
5431
|
+
"zpk2tf([1, 2], [-1, -2])",
|
|
5432
|
+
"zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"
|
|
5433
|
+
],
|
|
5434
|
+
seealso: []
|
|
5435
|
+
};
|
|
5436
|
+
|
|
5437
|
+
// src/embeddedDocs/function/signal/freqz.ts
|
|
5438
|
+
var freqzDocs = {
|
|
5439
|
+
name: "freqz",
|
|
5440
|
+
category: "Signal",
|
|
5441
|
+
syntax: ["freqz(b, a)", "freqz(b, a, w)"],
|
|
5442
|
+
description: "Calculates the frequency response of a filter given its numerator and denominator coefficients.",
|
|
5443
|
+
examples: [
|
|
5444
|
+
"freqz([1, 2], [1, 2, 3])",
|
|
5445
|
+
"freqz([1, 2], [1, 2, 3], [0, 1])",
|
|
5446
|
+
"freqz([1, 2], [1, 2, 3], 512)"
|
|
5447
|
+
],
|
|
5448
|
+
seealso: []
|
|
5449
|
+
};
|
|
5450
|
+
|
|
5451
|
+
// src/embeddedDocs/function/special/erf.ts
|
|
5452
|
+
var erfDocs = {
|
|
5453
|
+
name: "erf",
|
|
5454
|
+
category: "Special",
|
|
5455
|
+
syntax: ["erf(x)"],
|
|
5456
|
+
description: "Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",
|
|
5457
|
+
examples: ["erf(0.2)", "erf(-0.5)", "erf(4)"],
|
|
5458
|
+
seealso: []
|
|
5459
|
+
};
|
|
5460
|
+
|
|
5461
|
+
// src/embeddedDocs/function/special/zeta.ts
|
|
5462
|
+
var zetaDocs = {
|
|
5463
|
+
name: "zeta",
|
|
5464
|
+
category: "Special",
|
|
5465
|
+
syntax: ["zeta(s)"],
|
|
5466
|
+
description: "Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",
|
|
5467
|
+
examples: ["zeta(0.2)", "zeta(-0.5)", "zeta(4)"],
|
|
5468
|
+
seealso: []
|
|
5469
|
+
};
|
|
5470
|
+
|
|
5471
|
+
// src/embeddedDocs/function/statistics/mad.ts
|
|
5472
|
+
var madDocs = {
|
|
5473
|
+
name: "mad",
|
|
5474
|
+
category: "Statistics",
|
|
5475
|
+
syntax: ["mad(a, b, c, ...)", "mad(A)"],
|
|
5476
|
+
description: "Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",
|
|
5477
|
+
examples: ["mad(10, 20, 30)", "mad([1, 2, 3])"],
|
|
5478
|
+
seealso: ["mean", "median", "std", "abs"]
|
|
5479
|
+
};
|
|
5480
|
+
|
|
5481
|
+
// src/embeddedDocs/function/statistics/max.ts
|
|
5482
|
+
var maxDocs = {
|
|
5483
|
+
name: "max",
|
|
5484
|
+
category: "Statistics",
|
|
5485
|
+
syntax: ["max(a, b, c, ...)", "max(A)", "max(A, dimension)"],
|
|
5486
|
+
description: "Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",
|
|
5487
|
+
examples: [
|
|
5488
|
+
"max(2, 3, 4, 1)",
|
|
5489
|
+
"max([2, 3, 4, 1])",
|
|
5490
|
+
"max([2, 5; 4, 3])",
|
|
5491
|
+
"max([2, 5; 4, 3], 1)",
|
|
5492
|
+
"max([2, 5; 4, 3], 2)",
|
|
5493
|
+
"max(2.7, 7.1, -4.5, 2.0, 4.1)",
|
|
5494
|
+
"min(2.7, 7.1, -4.5, 2.0, 4.1)"
|
|
5495
|
+
],
|
|
5496
|
+
seealso: ["mean", "median", "min", "prod", "std", "sum", "variance"]
|
|
5497
|
+
};
|
|
5498
|
+
|
|
5499
|
+
// src/embeddedDocs/function/statistics/mean.ts
|
|
5500
|
+
var meanDocs = {
|
|
5501
|
+
name: "mean",
|
|
5502
|
+
category: "Statistics",
|
|
5503
|
+
syntax: ["mean(a, b, c, ...)", "mean(A)", "mean(A, dimension)"],
|
|
5504
|
+
description: "Compute the arithmetic mean of a list of values.",
|
|
5505
|
+
examples: [
|
|
5506
|
+
"mean(2, 3, 4, 1)",
|
|
5507
|
+
"mean([2, 3, 4, 1])",
|
|
5508
|
+
"mean([2, 5; 4, 3])",
|
|
5509
|
+
"mean([2, 5; 4, 3], 1)",
|
|
5510
|
+
"mean([2, 5; 4, 3], 2)",
|
|
5511
|
+
"mean([1.0, 2.7, 3.2, 4.0])"
|
|
5512
|
+
],
|
|
5513
|
+
seealso: ["max", "median", "min", "prod", "std", "sum", "variance"]
|
|
5514
|
+
};
|
|
5515
|
+
|
|
5516
|
+
// src/embeddedDocs/function/statistics/median.ts
|
|
5517
|
+
var medianDocs = {
|
|
5518
|
+
name: "median",
|
|
5519
|
+
category: "Statistics",
|
|
5520
|
+
syntax: ["median(a, b, c, ...)", "median(A)"],
|
|
5521
|
+
description: "Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",
|
|
5522
|
+
examples: ["median(5, 2, 7)", "median([3, -1, 5, 7])"],
|
|
5523
|
+
seealso: ["max", "mean", "min", "prod", "std", "sum", "variance", "quantileSeq"]
|
|
5524
|
+
};
|
|
5525
|
+
|
|
5526
|
+
// src/embeddedDocs/function/statistics/min.ts
|
|
5527
|
+
var minDocs = {
|
|
5528
|
+
name: "min",
|
|
5529
|
+
category: "Statistics",
|
|
5530
|
+
syntax: ["min(a, b, c, ...)", "min(A)", "min(A, dimension)"],
|
|
5531
|
+
description: "Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",
|
|
5532
|
+
examples: [
|
|
5533
|
+
"min(2, 3, 4, 1)",
|
|
5534
|
+
"min([2, 3, 4, 1])",
|
|
5535
|
+
"min([2, 5; 4, 3])",
|
|
5536
|
+
"min([2, 5; 4, 3], 1)",
|
|
5537
|
+
"min([2, 5; 4, 3], 2)",
|
|
5538
|
+
"min(2.7, 7.1, -4.5, 2.0, 4.1)",
|
|
5539
|
+
"max(2.7, 7.1, -4.5, 2.0, 4.1)"
|
|
5540
|
+
],
|
|
5541
|
+
seealso: ["max", "mean", "median", "prod", "std", "sum", "variance"]
|
|
5542
|
+
};
|
|
5543
|
+
|
|
5544
|
+
// src/embeddedDocs/function/statistics/mode.ts
|
|
5545
|
+
var modeDocs = {
|
|
5546
|
+
name: "mode",
|
|
5547
|
+
category: "Statistics",
|
|
5548
|
+
syntax: ["mode(a, b, c, ...)", "mode(A)", "mode(A, a, b, B, c, ...)"],
|
|
5549
|
+
description: "Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",
|
|
5550
|
+
examples: ["mode(2, 1, 4, 3, 1)", "mode([1, 2.7, 3.2, 4, 2.7])", "mode(1, 4, 6, 1, 6)"],
|
|
5551
|
+
seealso: ["max", "mean", "min", "median", "prod", "std", "sum", "variance"]
|
|
5552
|
+
};
|
|
5553
|
+
|
|
5554
|
+
// src/embeddedDocs/function/statistics/prod.ts
|
|
5555
|
+
var prodDocs = {
|
|
5556
|
+
name: "prod",
|
|
5557
|
+
category: "Statistics",
|
|
5558
|
+
syntax: ["prod(a, b, c, ...)", "prod(A)"],
|
|
5559
|
+
description: "Compute the product of all values.",
|
|
5560
|
+
examples: ["prod(2, 3, 4)", "prod([2, 3, 4])", "prod([2, 5; 4, 3])"],
|
|
5561
|
+
seealso: ["max", "mean", "min", "median", "min", "std", "sum", "variance"]
|
|
5562
|
+
};
|
|
5563
|
+
|
|
5564
|
+
// src/embeddedDocs/function/statistics/quantileSeq.ts
|
|
5565
|
+
var quantileSeqDocs = {
|
|
5566
|
+
name: "quantileSeq",
|
|
5567
|
+
category: "Statistics",
|
|
5568
|
+
syntax: [
|
|
5569
|
+
"quantileSeq(A, prob[, sorted])",
|
|
5570
|
+
"quantileSeq(A, [prob1, prob2, ...][, sorted])",
|
|
5571
|
+
"quantileSeq(A, N[, sorted])"
|
|
5572
|
+
],
|
|
5573
|
+
description: "Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",
|
|
5574
|
+
examples: [
|
|
5575
|
+
"quantileSeq([3, -1, 5, 7], 0.5)",
|
|
5576
|
+
"quantileSeq([3, -1, 5, 7], [1/3, 2/3])",
|
|
5577
|
+
"quantileSeq([3, -1, 5, 7], 2)",
|
|
5578
|
+
"quantileSeq([-1, 3, 5, 7], 0.5, true)"
|
|
5579
|
+
],
|
|
5580
|
+
seealso: ["mean", "median", "min", "max", "prod", "std", "sum", "variance"]
|
|
5581
|
+
};
|
|
5582
|
+
|
|
5583
|
+
// src/embeddedDocs/function/statistics/std.ts
|
|
5584
|
+
var stdDocs = {
|
|
5585
|
+
name: "std",
|
|
5586
|
+
category: "Statistics",
|
|
5587
|
+
syntax: [
|
|
5588
|
+
"std(a, b, c, ...)",
|
|
5589
|
+
"std(A)",
|
|
5590
|
+
"std(A, dimension)",
|
|
5591
|
+
"std(A, normalization)",
|
|
5592
|
+
"std(A, dimension, normalization)"
|
|
5593
|
+
],
|
|
5594
|
+
description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',
|
|
5595
|
+
examples: [
|
|
5596
|
+
"std(2, 4, 6)",
|
|
5597
|
+
"std([2, 4, 6, 8])",
|
|
5598
|
+
'std([2, 4, 6, 8], "uncorrected")',
|
|
5599
|
+
'std([2, 4, 6, 8], "biased")',
|
|
5600
|
+
"std([1, 2, 3; 4, 5, 6])"
|
|
5601
|
+
],
|
|
5602
|
+
seealso: ["max", "mean", "min", "median", "prod", "sum", "variance"]
|
|
5603
|
+
};
|
|
5604
|
+
|
|
5605
|
+
// src/embeddedDocs/function/statistics/cumsum.ts
|
|
5606
|
+
var cumSumDocs = {
|
|
5607
|
+
name: "cumsum",
|
|
5608
|
+
category: "Statistics",
|
|
5609
|
+
syntax: ["cumsum(a, b, c, ...)", "cumsum(A)"],
|
|
5610
|
+
description: "Compute the cumulative sum of all values.",
|
|
5611
|
+
examples: [
|
|
5612
|
+
"cumsum(2, 3, 4, 1)",
|
|
5613
|
+
"cumsum([2, 3, 4, 1])",
|
|
5614
|
+
"cumsum([1, 2; 3, 4])",
|
|
5615
|
+
"cumsum([1, 2; 3, 4], 1)",
|
|
5616
|
+
"cumsum([1, 2; 3, 4], 2)"
|
|
5617
|
+
],
|
|
5618
|
+
seealso: ["max", "mean", "median", "min", "prod", "std", "sum", "variance"]
|
|
5619
|
+
};
|
|
5620
|
+
|
|
5621
|
+
// src/embeddedDocs/function/statistics/sum.ts
|
|
5622
|
+
var sumDocs = {
|
|
5623
|
+
name: "sum",
|
|
5624
|
+
category: "Statistics",
|
|
5625
|
+
syntax: ["sum(a, b, c, ...)", "sum(A)", "sum(A, dimension)"],
|
|
5626
|
+
description: "Compute the sum of all values.",
|
|
5627
|
+
examples: ["sum(2, 3, 4, 1)", "sum([2, 3, 4, 1])", "sum([2, 5; 4, 3])"],
|
|
5628
|
+
seealso: ["max", "mean", "median", "min", "prod", "std", "variance"]
|
|
5629
|
+
};
|
|
5630
|
+
|
|
5631
|
+
// src/embeddedDocs/function/statistics/variance.ts
|
|
5632
|
+
var varianceDocs = {
|
|
5633
|
+
name: "variance",
|
|
5634
|
+
category: "Statistics",
|
|
5635
|
+
syntax: [
|
|
5636
|
+
"variance(a, b, c, ...)",
|
|
5637
|
+
"variance(A)",
|
|
5638
|
+
"variance(A, dimension)",
|
|
5639
|
+
"variance(A, normalization)",
|
|
5640
|
+
"variance(A, dimension, normalization)"
|
|
5641
|
+
],
|
|
5642
|
+
description: 'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',
|
|
5643
|
+
examples: [
|
|
5644
|
+
"variance(2, 4, 6)",
|
|
5645
|
+
"variance([2, 4, 6, 8])",
|
|
5646
|
+
'variance([2, 4, 6, 8], "uncorrected")',
|
|
5647
|
+
'variance([2, 4, 6, 8], "biased")',
|
|
5648
|
+
"variance([1, 2, 3; 4, 5, 6])"
|
|
5649
|
+
],
|
|
5650
|
+
seealso: ["max", "mean", "min", "median", "min", "prod", "std", "sum"]
|
|
5651
|
+
};
|
|
5652
|
+
|
|
5653
|
+
// src/embeddedDocs/function/statistics/corr.ts
|
|
5654
|
+
var corrDocs = {
|
|
5655
|
+
name: "corr",
|
|
5656
|
+
category: "Statistics",
|
|
5657
|
+
syntax: ["corr(A,B)"],
|
|
5658
|
+
description: "Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",
|
|
5659
|
+
examples: [
|
|
5660
|
+
"corr([2, 4, 6, 8],[1, 2, 3, 6])",
|
|
5661
|
+
"corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"
|
|
5662
|
+
],
|
|
5663
|
+
seealso: ["max", "mean", "min", "median", "min", "prod", "std", "sum"]
|
|
5664
|
+
};
|
|
5665
|
+
|
|
5666
|
+
// src/embeddedDocs/function/trigonometry/acos.ts
|
|
5667
|
+
var acosDocs = {
|
|
5668
|
+
name: "acos",
|
|
5669
|
+
category: "Trigonometry",
|
|
5670
|
+
syntax: ["acos(x)"],
|
|
5671
|
+
description: "Compute the inverse cosine of a value in radians.",
|
|
5672
|
+
examples: ["acos(0.5)", "acos(cos(2.3))"],
|
|
5673
|
+
seealso: ["cos", "atan", "asin"]
|
|
5674
|
+
};
|
|
5675
|
+
|
|
5676
|
+
// src/embeddedDocs/function/trigonometry/acosh.ts
|
|
5677
|
+
var acoshDocs = {
|
|
5678
|
+
name: "acosh",
|
|
5679
|
+
category: "Trigonometry",
|
|
5680
|
+
syntax: ["acosh(x)"],
|
|
5681
|
+
description: "Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",
|
|
5682
|
+
examples: ["acosh(1.5)"],
|
|
5683
|
+
seealso: ["cosh", "asinh", "atanh"]
|
|
5684
|
+
};
|
|
5685
|
+
|
|
5686
|
+
// src/embeddedDocs/function/trigonometry/acot.ts
|
|
5687
|
+
var acotDocs = {
|
|
5688
|
+
name: "acot",
|
|
5689
|
+
category: "Trigonometry",
|
|
5690
|
+
syntax: ["acot(x)"],
|
|
5691
|
+
description: "Calculate the inverse cotangent of a value.",
|
|
5692
|
+
examples: ["acot(0.5)", "acot(cot(0.5))", "acot(2)"],
|
|
5693
|
+
seealso: ["cot", "atan"]
|
|
5694
|
+
};
|
|
5695
|
+
|
|
5696
|
+
// src/embeddedDocs/function/trigonometry/acoth.ts
|
|
5697
|
+
var acothDocs = {
|
|
5698
|
+
name: "acoth",
|
|
5699
|
+
category: "Trigonometry",
|
|
5700
|
+
syntax: ["acoth(x)"],
|
|
5701
|
+
description: "Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",
|
|
5702
|
+
examples: ["acoth(2)", "acoth(0.5)"],
|
|
5703
|
+
seealso: ["acsch", "asech"]
|
|
5704
|
+
};
|
|
5705
|
+
|
|
5706
|
+
// src/embeddedDocs/function/trigonometry/acsc.ts
|
|
5707
|
+
var acscDocs = {
|
|
5708
|
+
name: "acsc",
|
|
5709
|
+
category: "Trigonometry",
|
|
5710
|
+
syntax: ["acsc(x)"],
|
|
5711
|
+
description: "Calculate the inverse cotangent of a value.",
|
|
5712
|
+
examples: ["acsc(2)", "acsc(csc(0.5))", "acsc(0.5)"],
|
|
5713
|
+
seealso: ["csc", "asin", "asec"]
|
|
5714
|
+
};
|
|
5715
|
+
|
|
5716
|
+
// src/embeddedDocs/function/trigonometry/acsch.ts
|
|
5717
|
+
var acschDocs = {
|
|
5718
|
+
name: "acsch",
|
|
5719
|
+
category: "Trigonometry",
|
|
5720
|
+
syntax: ["acsch(x)"],
|
|
5721
|
+
description: "Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",
|
|
5722
|
+
examples: ["acsch(0.5)"],
|
|
5723
|
+
seealso: ["asech", "acoth"]
|
|
5724
|
+
};
|
|
5725
|
+
|
|
5726
|
+
// src/embeddedDocs/function/trigonometry/asec.ts
|
|
5727
|
+
var asecDocs = {
|
|
5728
|
+
name: "asec",
|
|
5729
|
+
category: "Trigonometry",
|
|
5730
|
+
syntax: ["asec(x)"],
|
|
5731
|
+
description: "Calculate the inverse secant of a value.",
|
|
5732
|
+
examples: ["asec(0.5)", "asec(sec(0.5))", "asec(2)"],
|
|
5733
|
+
seealso: ["acos", "acot", "acsc"]
|
|
5734
|
+
};
|
|
5735
|
+
|
|
5736
|
+
// src/embeddedDocs/function/trigonometry/asech.ts
|
|
5737
|
+
var asechDocs = {
|
|
5738
|
+
name: "asech",
|
|
5739
|
+
category: "Trigonometry",
|
|
5740
|
+
syntax: ["asech(x)"],
|
|
5741
|
+
description: "Calculate the inverse secant of a value.",
|
|
5742
|
+
examples: ["asech(0.5)"],
|
|
5743
|
+
seealso: ["acsch", "acoth"]
|
|
5744
|
+
};
|
|
5745
|
+
|
|
5746
|
+
// src/embeddedDocs/function/trigonometry/asin.ts
|
|
5747
|
+
var asinDocs = {
|
|
5748
|
+
name: "asin",
|
|
5749
|
+
category: "Trigonometry",
|
|
5750
|
+
syntax: ["asin(x)"],
|
|
5751
|
+
description: "Compute the inverse sine of a value in radians.",
|
|
5752
|
+
examples: ["asin(0.5)", "asin(sin(0.5))"],
|
|
5753
|
+
seealso: ["sin", "acos", "atan"]
|
|
5754
|
+
};
|
|
5755
|
+
|
|
5756
|
+
// src/embeddedDocs/function/trigonometry/asinh.ts
|
|
5757
|
+
var asinhDocs = {
|
|
5758
|
+
name: "asinh",
|
|
5759
|
+
category: "Trigonometry",
|
|
5760
|
+
syntax: ["asinh(x)"],
|
|
5761
|
+
description: "Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",
|
|
5762
|
+
examples: ["asinh(0.5)"],
|
|
5763
|
+
seealso: ["acosh", "atanh"]
|
|
5764
|
+
};
|
|
5765
|
+
|
|
5766
|
+
// src/embeddedDocs/function/trigonometry/atan.ts
|
|
5767
|
+
var atanDocs = {
|
|
5768
|
+
name: "atan",
|
|
5769
|
+
category: "Trigonometry",
|
|
5770
|
+
syntax: ["atan(x)"],
|
|
5771
|
+
description: "Compute the inverse tangent of a value in radians.",
|
|
5772
|
+
examples: ["atan(0.5)", "atan(tan(0.5))"],
|
|
5773
|
+
seealso: ["tan", "acos", "asin"]
|
|
5774
|
+
};
|
|
5775
|
+
|
|
5776
|
+
// src/embeddedDocs/function/trigonometry/atan2.ts
|
|
5777
|
+
var atan2Docs = {
|
|
5778
|
+
name: "atan2",
|
|
5779
|
+
category: "Trigonometry",
|
|
5780
|
+
syntax: ["atan2(y, x)"],
|
|
5781
|
+
description: "Computes the principal value of the arc tangent of y/x in radians.",
|
|
5782
|
+
examples: [
|
|
5783
|
+
"atan2(2, 2) / pi",
|
|
5784
|
+
"angle = 60 deg in rad",
|
|
5785
|
+
"x = cos(angle)",
|
|
5786
|
+
"y = sin(angle)",
|
|
5787
|
+
"atan2(y, x)"
|
|
5788
|
+
],
|
|
5789
|
+
seealso: ["sin", "cos", "tan"]
|
|
5790
|
+
};
|
|
5791
|
+
|
|
5792
|
+
// src/embeddedDocs/function/trigonometry/atanh.ts
|
|
5793
|
+
var atanhDocs = {
|
|
5794
|
+
name: "atanh",
|
|
5795
|
+
category: "Trigonometry",
|
|
5796
|
+
syntax: ["atanh(x)"],
|
|
5797
|
+
description: "Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",
|
|
5798
|
+
examples: ["atanh(0.5)"],
|
|
5799
|
+
seealso: ["acosh", "asinh"]
|
|
5800
|
+
};
|
|
5801
|
+
|
|
5802
|
+
// src/embeddedDocs/function/trigonometry/cos.ts
|
|
5803
|
+
var cosDocs = {
|
|
5804
|
+
name: "cos",
|
|
5805
|
+
category: "Trigonometry",
|
|
5806
|
+
syntax: ["cos(x)"],
|
|
5807
|
+
description: "Compute the cosine of x in radians.",
|
|
5808
|
+
examples: ["cos(2)", "cos(pi / 4) ^ 2", "cos(180 deg)", "cos(60 deg)", "sin(0.2)^2 + cos(0.2)^2"],
|
|
5809
|
+
seealso: ["acos", "sin", "tan"]
|
|
5810
|
+
};
|
|
5811
|
+
|
|
5812
|
+
// src/embeddedDocs/function/trigonometry/cosh.ts
|
|
5813
|
+
var coshDocs = {
|
|
5814
|
+
name: "cosh",
|
|
5815
|
+
category: "Trigonometry",
|
|
5816
|
+
syntax: ["cosh(x)"],
|
|
5817
|
+
description: "Compute the hyperbolic cosine of x in radians.",
|
|
5818
|
+
examples: ["cosh(0.5)"],
|
|
5819
|
+
seealso: ["sinh", "tanh", "coth"]
|
|
5820
|
+
};
|
|
5821
|
+
|
|
5822
|
+
// src/embeddedDocs/function/trigonometry/cot.ts
|
|
5823
|
+
var cotDocs = {
|
|
5824
|
+
name: "cot",
|
|
5825
|
+
category: "Trigonometry",
|
|
5826
|
+
syntax: ["cot(x)"],
|
|
5827
|
+
description: "Compute the cotangent of x in radians. Defined as 1/tan(x)",
|
|
5828
|
+
examples: ["cot(2)", "1 / tan(2)"],
|
|
5829
|
+
seealso: ["sec", "csc", "tan"]
|
|
5830
|
+
};
|
|
5831
|
+
|
|
5832
|
+
// src/embeddedDocs/function/trigonometry/coth.ts
|
|
5833
|
+
var cothDocs = {
|
|
5834
|
+
name: "coth",
|
|
5835
|
+
category: "Trigonometry",
|
|
5836
|
+
syntax: ["coth(x)"],
|
|
5837
|
+
description: "Compute the hyperbolic cotangent of x in radians.",
|
|
5838
|
+
examples: ["coth(2)", "1 / tanh(2)"],
|
|
5839
|
+
seealso: ["sech", "csch", "tanh"]
|
|
5840
|
+
};
|
|
5841
|
+
|
|
5842
|
+
// src/embeddedDocs/function/trigonometry/csc.ts
|
|
5843
|
+
var cscDocs = {
|
|
5844
|
+
name: "csc",
|
|
5845
|
+
category: "Trigonometry",
|
|
5846
|
+
syntax: ["csc(x)"],
|
|
5847
|
+
description: "Compute the cosecant of x in radians. Defined as 1/sin(x)",
|
|
5848
|
+
examples: ["csc(2)", "1 / sin(2)"],
|
|
5849
|
+
seealso: ["sec", "cot", "sin"]
|
|
5850
|
+
};
|
|
5851
|
+
|
|
5852
|
+
// src/embeddedDocs/function/trigonometry/csch.ts
|
|
5853
|
+
var cschDocs = {
|
|
5854
|
+
name: "csch",
|
|
5855
|
+
category: "Trigonometry",
|
|
5856
|
+
syntax: ["csch(x)"],
|
|
5857
|
+
description: "Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",
|
|
5858
|
+
examples: ["csch(2)", "1 / sinh(2)"],
|
|
5859
|
+
seealso: ["sech", "coth", "sinh"]
|
|
5860
|
+
};
|
|
5861
|
+
|
|
5862
|
+
// src/embeddedDocs/function/trigonometry/sec.ts
|
|
5863
|
+
var secDocs = {
|
|
5864
|
+
name: "sec",
|
|
5865
|
+
category: "Trigonometry",
|
|
5866
|
+
syntax: ["sec(x)"],
|
|
5867
|
+
description: "Compute the secant of x in radians. Defined as 1/cos(x)",
|
|
5868
|
+
examples: ["sec(2)", "1 / cos(2)"],
|
|
5869
|
+
seealso: ["cot", "csc", "cos"]
|
|
5870
|
+
};
|
|
5871
|
+
|
|
5872
|
+
// src/embeddedDocs/function/trigonometry/sech.ts
|
|
5873
|
+
var sechDocs = {
|
|
5874
|
+
name: "sech",
|
|
5875
|
+
category: "Trigonometry",
|
|
5876
|
+
syntax: ["sech(x)"],
|
|
5877
|
+
description: "Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",
|
|
5878
|
+
examples: ["sech(2)", "1 / cosh(2)"],
|
|
5879
|
+
seealso: ["coth", "csch", "cosh"]
|
|
5880
|
+
};
|
|
5881
|
+
|
|
5882
|
+
// src/embeddedDocs/function/trigonometry/sin.ts
|
|
5883
|
+
var sinDocs = {
|
|
5884
|
+
name: "sin",
|
|
5885
|
+
category: "Trigonometry",
|
|
5886
|
+
syntax: ["sin(x)"],
|
|
5887
|
+
description: "Compute the sine of x in radians.",
|
|
5888
|
+
examples: ["sin(2)", "sin(pi / 4) ^ 2", "sin(90 deg)", "sin(30 deg)", "sin(0.2)^2 + cos(0.2)^2"],
|
|
5889
|
+
seealso: ["asin", "cos", "tan"]
|
|
5890
|
+
};
|
|
5891
|
+
|
|
5892
|
+
// src/embeddedDocs/function/trigonometry/sinh.ts
|
|
5893
|
+
var sinhDocs = {
|
|
5894
|
+
name: "sinh",
|
|
5895
|
+
category: "Trigonometry",
|
|
5896
|
+
syntax: ["sinh(x)"],
|
|
5897
|
+
description: "Compute the hyperbolic sine of x in radians.",
|
|
5898
|
+
examples: ["sinh(0.5)"],
|
|
5899
|
+
seealso: ["cosh", "tanh"]
|
|
5900
|
+
};
|
|
5901
|
+
|
|
5902
|
+
// src/embeddedDocs/function/trigonometry/tan.ts
|
|
5903
|
+
var tanDocs = {
|
|
5904
|
+
name: "tan",
|
|
5905
|
+
category: "Trigonometry",
|
|
5906
|
+
syntax: ["tan(x)"],
|
|
5907
|
+
description: "Compute the tangent of x in radians.",
|
|
5908
|
+
examples: ["tan(0.5)", "sin(0.5) / cos(0.5)", "tan(pi / 4)", "tan(45 deg)"],
|
|
5909
|
+
seealso: ["atan", "sin", "cos"]
|
|
5910
|
+
};
|
|
5911
|
+
|
|
5912
|
+
// src/embeddedDocs/function/trigonometry/tanh.ts
|
|
5913
|
+
var tanhDocs = {
|
|
5914
|
+
name: "tanh",
|
|
5915
|
+
category: "Trigonometry",
|
|
5916
|
+
syntax: ["tanh(x)"],
|
|
5917
|
+
description: "Compute the hyperbolic tangent of x in radians.",
|
|
5918
|
+
examples: ["tanh(0.5)", "sinh(0.5) / cosh(0.5)"],
|
|
5919
|
+
seealso: ["sinh", "cosh"]
|
|
5920
|
+
};
|
|
5921
|
+
|
|
5922
|
+
// src/embeddedDocs/function/units/to.ts
|
|
5923
|
+
var toDocs = {
|
|
5924
|
+
name: "to",
|
|
5925
|
+
category: "Units",
|
|
5926
|
+
syntax: ["x to unit", "to(x, unit)"],
|
|
5927
|
+
description: "Change the unit of a value.",
|
|
5928
|
+
examples: ["5 inch to cm", "3.2kg to g", "16 bytes in bits"],
|
|
5929
|
+
seealso: []
|
|
5930
|
+
};
|
|
5931
|
+
|
|
5932
|
+
// src/embeddedDocs/function/units/toBest.ts
|
|
5933
|
+
var toBestDocs = {
|
|
5934
|
+
name: "toBest",
|
|
5935
|
+
category: "Units",
|
|
5936
|
+
syntax: ["toBest(x)", "toBest(x, unitList)", "toBest(x, unitList, options)"],
|
|
5937
|
+
description: "Converts to the most appropriate display unit.",
|
|
5938
|
+
examples: [
|
|
5939
|
+
'toBest(unit(5000, "m"))',
|
|
5940
|
+
'toBest(unit(3500000, "W"))',
|
|
5941
|
+
'toBest(unit(0.000000123, "A"))',
|
|
5942
|
+
'toBest(unit(10, "m"), "cm")',
|
|
5943
|
+
'toBest(unit(10, "m"), "mm,km", {offset: 1.5})'
|
|
5944
|
+
],
|
|
5945
|
+
seealso: []
|
|
5946
|
+
};
|
|
5947
|
+
|
|
5948
|
+
// src/embeddedDocs/function/utils/bin.ts
|
|
5949
|
+
var binDocs = {
|
|
5950
|
+
name: "bin",
|
|
5951
|
+
category: "Utils",
|
|
5952
|
+
syntax: ["bin(value)"],
|
|
5953
|
+
description: "Format a number as binary",
|
|
5954
|
+
examples: ["bin(2)"],
|
|
5955
|
+
seealso: ["oct", "hex"]
|
|
5956
|
+
};
|
|
5957
|
+
|
|
5958
|
+
// src/embeddedDocs/function/utils/clone.ts
|
|
5959
|
+
var cloneDocs = {
|
|
5960
|
+
name: "clone",
|
|
5961
|
+
category: "Utils",
|
|
5962
|
+
syntax: ["clone(x)"],
|
|
5963
|
+
description: "Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",
|
|
5964
|
+
examples: [
|
|
5965
|
+
"clone(3.5)",
|
|
5966
|
+
"clone(2 - 4i)",
|
|
5967
|
+
"clone(45 deg)",
|
|
5968
|
+
"clone([1, 2; 3, 4])",
|
|
5969
|
+
'clone("hello world")'
|
|
5970
|
+
],
|
|
5971
|
+
seealso: []
|
|
5972
|
+
};
|
|
5973
|
+
|
|
5974
|
+
// src/embeddedDocs/function/utils/format.ts
|
|
5975
|
+
var formatDocs = {
|
|
5976
|
+
name: "format",
|
|
5977
|
+
category: "Utils",
|
|
5978
|
+
syntax: ["format(value)", "format(value, precision)"],
|
|
5979
|
+
description: "Format a value of any type as string.",
|
|
5980
|
+
examples: ["format(2.3)", "format(3 - 4i)", "format([])", "format(pi, 3)"],
|
|
5981
|
+
seealso: ["print"]
|
|
5982
|
+
};
|
|
5983
|
+
|
|
5984
|
+
// src/embeddedDocs/function/utils/hasNumericValue.ts
|
|
5985
|
+
var hasNumericValueDocs = {
|
|
5986
|
+
name: "hasNumericValue",
|
|
5987
|
+
category: "Utils",
|
|
5988
|
+
syntax: ["hasNumericValue(x)"],
|
|
5989
|
+
description: "Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",
|
|
5990
|
+
examples: [
|
|
5991
|
+
"hasNumericValue(2)",
|
|
5992
|
+
'hasNumericValue("2")',
|
|
5993
|
+
'isNumeric("2")',
|
|
5994
|
+
"hasNumericValue(0)",
|
|
5995
|
+
"hasNumericValue(bignumber(500))",
|
|
5996
|
+
"hasNumericValue(fraction(0.125))",
|
|
5997
|
+
"hasNumericValue(2 + 3i)",
|
|
5998
|
+
'hasNumericValue([2.3, "foo", false])'
|
|
5999
|
+
],
|
|
6000
|
+
seealso: ["isInteger", "isZero", "isNegative", "isPositive", "isNaN", "isNumeric"]
|
|
6001
|
+
};
|
|
6002
|
+
|
|
6003
|
+
// src/embeddedDocs/function/utils/hex.ts
|
|
6004
|
+
var hexDocs = {
|
|
6005
|
+
name: "hex",
|
|
6006
|
+
category: "Utils",
|
|
6007
|
+
syntax: ["hex(value)"],
|
|
6008
|
+
description: "Format a number as hexadecimal",
|
|
6009
|
+
examples: ["hex(240)"],
|
|
6010
|
+
seealso: ["bin", "oct"]
|
|
6011
|
+
};
|
|
6012
|
+
|
|
6013
|
+
// src/embeddedDocs/function/utils/isInteger.ts
|
|
6014
|
+
var isIntegerDocs = {
|
|
6015
|
+
name: "isInteger",
|
|
6016
|
+
category: "Utils",
|
|
6017
|
+
syntax: ["isInteger(x)"],
|
|
6018
|
+
description: "Test whether a value is an integer number.",
|
|
6019
|
+
examples: ["isInteger(2)", "isInteger(3.5)", "isInteger([3, 0.5, -2])"],
|
|
6020
|
+
seealso: ["isNegative", "isNumeric", "isPositive", "isZero"]
|
|
6021
|
+
};
|
|
6022
|
+
|
|
6023
|
+
// src/embeddedDocs/function/utils/isNaN.ts
|
|
6024
|
+
var isNaNDocs = {
|
|
6025
|
+
name: "isNaN",
|
|
6026
|
+
category: "Utils",
|
|
6027
|
+
syntax: ["isNaN(x)"],
|
|
6028
|
+
description: "Test whether a value is NaN (not a number)",
|
|
6029
|
+
examples: ["isNaN(2)", "isNaN(0 / 0)", "isNaN(NaN)", "isNaN(Infinity)"],
|
|
6030
|
+
seealso: ["isNegative", "isNumeric", "isPositive", "isZero", "isFinite", "isBounded"]
|
|
6031
|
+
};
|
|
6032
|
+
|
|
6033
|
+
// src/embeddedDocs/function/utils/isBounded.ts
|
|
6034
|
+
var isBoundedDocs = {
|
|
6035
|
+
name: "isBounded",
|
|
6036
|
+
category: "Utils",
|
|
6037
|
+
syntax: ["isBounded(x)"],
|
|
6038
|
+
description: "Test whether a value or its entries are bounded.",
|
|
6039
|
+
examples: ["isBounded(Infinity)", "isBounded(bigint(3))", "isBounded([3, -Infinity, -3])"],
|
|
6040
|
+
seealso: ["isFinite", "isNumeric", "isNaN", "isNegative", "isPositive"]
|
|
6041
|
+
};
|
|
6042
|
+
|
|
6043
|
+
// src/embeddedDocs/function/utils/isFinite.ts
|
|
6044
|
+
var isFiniteDocs = {
|
|
6045
|
+
name: "isFinite",
|
|
6046
|
+
category: "Utils",
|
|
6047
|
+
syntax: ["isFinite(x)"],
|
|
6048
|
+
description: "Test whether a value is finite, elementwise on collections.",
|
|
6049
|
+
examples: ["isFinite(Infinity)", "isFinite(bigint(3))", "isFinite([3, -Infinity, -3])"],
|
|
6050
|
+
seealso: ["isBounded", "isNumeric", "isNaN", "isNegative", "isPositive"]
|
|
6051
|
+
};
|
|
6052
|
+
|
|
6053
|
+
// src/embeddedDocs/function/utils/isNegative.ts
|
|
6054
|
+
var isNegativeDocs = {
|
|
6055
|
+
name: "isNegative",
|
|
6056
|
+
category: "Utils",
|
|
6057
|
+
syntax: ["isNegative(x)"],
|
|
6058
|
+
description: "Test whether a value is negative: smaller than zero.",
|
|
6059
|
+
examples: ["isNegative(2)", "isNegative(0)", "isNegative(-4)", "isNegative([3, 0.5, -2])"],
|
|
6060
|
+
seealso: ["isInteger", "isNumeric", "isPositive", "isZero"]
|
|
6061
|
+
};
|
|
6062
|
+
|
|
6063
|
+
// src/embeddedDocs/function/utils/isNumeric.ts
|
|
6064
|
+
var isNumericDocs = {
|
|
6065
|
+
name: "isNumeric",
|
|
6066
|
+
category: "Utils",
|
|
6067
|
+
syntax: ["isNumeric(x)"],
|
|
6068
|
+
description: "Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",
|
|
6069
|
+
examples: [
|
|
6070
|
+
"isNumeric(2)",
|
|
6071
|
+
'isNumeric("2")',
|
|
6072
|
+
'hasNumericValue("2")',
|
|
6073
|
+
"isNumeric(0)",
|
|
6074
|
+
"isNumeric(bignumber(500))",
|
|
6075
|
+
"isNumeric(fraction(0.125))",
|
|
6076
|
+
"isNumeric(2 + 3i)",
|
|
6077
|
+
'isNumeric([2.3, "foo", false])'
|
|
6078
|
+
],
|
|
6079
|
+
seealso: [
|
|
6080
|
+
"isInteger",
|
|
6081
|
+
"isZero",
|
|
6082
|
+
"isNegative",
|
|
6083
|
+
"isPositive",
|
|
6084
|
+
"isNaN",
|
|
6085
|
+
"hasNumericValue",
|
|
6086
|
+
"isFinite",
|
|
6087
|
+
"isBounded"
|
|
6088
|
+
]
|
|
6089
|
+
};
|
|
6090
|
+
|
|
6091
|
+
// src/embeddedDocs/function/utils/isPositive.ts
|
|
6092
|
+
var isPositiveDocs = {
|
|
6093
|
+
name: "isPositive",
|
|
6094
|
+
category: "Utils",
|
|
6095
|
+
syntax: ["isPositive(x)"],
|
|
6096
|
+
description: "Test whether a value is positive: larger than zero.",
|
|
6097
|
+
examples: ["isPositive(2)", "isPositive(0)", "isPositive(-4)", "isPositive([3, 0.5, -2])"],
|
|
6098
|
+
seealso: ["isInteger", "isNumeric", "isNegative", "isZero"]
|
|
6099
|
+
};
|
|
6100
|
+
|
|
6101
|
+
// src/embeddedDocs/function/utils/isPrime.ts
|
|
6102
|
+
var isPrimeDocs = {
|
|
6103
|
+
name: "isPrime",
|
|
6104
|
+
category: "Utils",
|
|
6105
|
+
syntax: ["isPrime(x)"],
|
|
6106
|
+
description: "Test whether a value is prime: has no divisors other than itself and one.",
|
|
6107
|
+
examples: ["isPrime(3)", "isPrime(-2)", "isPrime([2, 17, 100])"],
|
|
6108
|
+
seealso: ["isInteger", "isNumeric", "isNegative", "isZero"]
|
|
6109
|
+
};
|
|
6110
|
+
|
|
6111
|
+
// src/embeddedDocs/function/utils/isZero.ts
|
|
6112
|
+
var isZeroDocs = {
|
|
6113
|
+
name: "isZero",
|
|
6114
|
+
category: "Utils",
|
|
6115
|
+
syntax: ["isZero(x)"],
|
|
6116
|
+
description: "Test whether a value is zero.",
|
|
6117
|
+
examples: ["isZero(2)", "isZero(0)", "isZero(-4)", "isZero([3, 0, -2, 0])"],
|
|
6118
|
+
seealso: ["isInteger", "isNumeric", "isNegative", "isPositive"]
|
|
6119
|
+
};
|
|
6120
|
+
|
|
6121
|
+
// src/embeddedDocs/function/utils/numeric.ts
|
|
6122
|
+
var numericDocs = {
|
|
6123
|
+
name: "numeric",
|
|
6124
|
+
category: "Utils",
|
|
6125
|
+
syntax: ["numeric(x)"],
|
|
6126
|
+
description: "Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",
|
|
6127
|
+
examples: [
|
|
6128
|
+
'numeric("4")',
|
|
6129
|
+
'numeric("4", "number")',
|
|
6130
|
+
'numeric("4", "bigint")',
|
|
6131
|
+
'numeric("4", "BigNumber")',
|
|
6132
|
+
'numeric("4", "Fraction")',
|
|
6133
|
+
'numeric(4, "Fraction")',
|
|
6134
|
+
'numeric(fraction(2, 5), "number")'
|
|
6135
|
+
],
|
|
6136
|
+
seealso: ["number", "bigint", "fraction", "bignumber", "string", "format"]
|
|
6137
|
+
};
|
|
6138
|
+
|
|
6139
|
+
// src/embeddedDocs/function/utils/oct.ts
|
|
6140
|
+
var octDocs = {
|
|
6141
|
+
name: "oct",
|
|
6142
|
+
category: "Utils",
|
|
6143
|
+
syntax: ["oct(value)"],
|
|
6144
|
+
description: "Format a number as octal",
|
|
6145
|
+
examples: ["oct(56)"],
|
|
6146
|
+
seealso: ["bin", "hex"]
|
|
6147
|
+
};
|
|
6148
|
+
|
|
6149
|
+
// src/embeddedDocs/function/utils/print.ts
|
|
6150
|
+
var printDocs = {
|
|
6151
|
+
name: "print",
|
|
6152
|
+
category: "Utils",
|
|
6153
|
+
syntax: ["print(template, values)", "print(template, values, precision)"],
|
|
6154
|
+
description: "Interpolate values into a string template.",
|
|
6155
|
+
examples: [
|
|
6156
|
+
'print("Lucy is $age years old", {age: 5})',
|
|
6157
|
+
'print("The value of pi is $pi", {pi: pi}, 3)',
|
|
6158
|
+
'print("Hello, $user.name!", {user: {name: "John"}})',
|
|
6159
|
+
'print("Values: $1, $2, $3", [6, 9, 4])'
|
|
6160
|
+
],
|
|
6161
|
+
seealso: ["format"]
|
|
6162
|
+
};
|
|
6163
|
+
|
|
6164
|
+
// src/embeddedDocs/function/utils/typeOf.ts
|
|
6165
|
+
var typeOfDocs = {
|
|
6166
|
+
name: "typeOf",
|
|
6167
|
+
category: "Utils",
|
|
6168
|
+
syntax: ["typeOf(x)"],
|
|
6169
|
+
description: "Get the type of a variable.",
|
|
6170
|
+
examples: ["typeOf(3.5)", "typeOf(2 - 4i)", "typeOf(45 deg)", 'typeOf("hello world")'],
|
|
6171
|
+
seealso: ["getMatrixDataType"]
|
|
6172
|
+
};
|
|
6173
|
+
|
|
6174
|
+
// src/embeddedDocs/function/numeric/solveODE.ts
|
|
6175
|
+
var solveODEDocs = {
|
|
6176
|
+
name: "solveODE",
|
|
6177
|
+
category: "Numeric",
|
|
6178
|
+
syntax: ["solveODE(func, tspan, y0)", "solveODE(func, tspan, y0, options)"],
|
|
6179
|
+
description: "Numerical Integration of Ordinary Differential Equations.",
|
|
6180
|
+
examples: [
|
|
6181
|
+
"f(t,y) = y",
|
|
6182
|
+
"tspan = [0, 4]",
|
|
6183
|
+
"solveODE(f, tspan, 1)",
|
|
6184
|
+
"solveODE(f, tspan, [1, 2])",
|
|
6185
|
+
'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'
|
|
6186
|
+
],
|
|
6187
|
+
seealso: ["derivative", "simplifyCore"]
|
|
6188
|
+
};
|
|
6189
|
+
|
|
6190
|
+
// src/embeddedDocs/embeddedDocs.ts
|
|
6191
|
+
var embeddedDocs = {
|
|
6192
|
+
// construction functions
|
|
6193
|
+
bignumber: bignumberDocs,
|
|
6194
|
+
bigint: bigintDocs,
|
|
6195
|
+
boolean: booleanDocs,
|
|
6196
|
+
complex: complexDocs,
|
|
6197
|
+
createUnit: createUnitDocs,
|
|
6198
|
+
fraction: fractionDocs,
|
|
6199
|
+
index: indexDocs,
|
|
6200
|
+
matrix: matrixDocs,
|
|
6201
|
+
number: numberDocs,
|
|
6202
|
+
sparse: sparseDocs,
|
|
6203
|
+
splitUnit: splitUnitDocs,
|
|
6204
|
+
string: stringDocs,
|
|
6205
|
+
unit: unitDocs,
|
|
6206
|
+
// constants
|
|
6207
|
+
e: eDocs,
|
|
6208
|
+
E: eDocs,
|
|
6209
|
+
false: falseDocs,
|
|
6210
|
+
i: iDocs,
|
|
6211
|
+
Infinity: InfinityDocs,
|
|
6212
|
+
LN2: LN2Docs,
|
|
6213
|
+
LN10: LN10Docs,
|
|
6214
|
+
LOG2E: LOG2EDocs,
|
|
6215
|
+
LOG10E: LOG10EDocs,
|
|
6216
|
+
NaN: NaNDocs,
|
|
6217
|
+
null: nullDocs,
|
|
6218
|
+
pi: piDocs,
|
|
6219
|
+
PI: piDocs,
|
|
6220
|
+
phi: phiDocs,
|
|
6221
|
+
SQRT1_2: SQRT12Docs,
|
|
6222
|
+
SQRT2: SQRT2Docs,
|
|
6223
|
+
tau: tauDocs,
|
|
6224
|
+
true: trueDocs,
|
|
6225
|
+
version: versionDocs,
|
|
6226
|
+
// physical constants
|
|
6227
|
+
// TODO: more detailed docs for physical constants
|
|
6228
|
+
speedOfLight: { description: "Speed of light in vacuum", examples: ["speedOfLight"] },
|
|
6229
|
+
gravitationConstant: {
|
|
6230
|
+
description: "Newtonian constant of gravitation",
|
|
6231
|
+
examples: ["gravitationConstant"]
|
|
6232
|
+
},
|
|
6233
|
+
planckConstant: { description: "Planck constant", examples: ["planckConstant"] },
|
|
6234
|
+
reducedPlanckConstant: {
|
|
6235
|
+
description: "Reduced Planck constant",
|
|
6236
|
+
examples: ["reducedPlanckConstant"]
|
|
6237
|
+
},
|
|
6238
|
+
magneticConstant: {
|
|
6239
|
+
description: "Magnetic constant (vacuum permeability)",
|
|
6240
|
+
examples: ["magneticConstant"]
|
|
6241
|
+
},
|
|
6242
|
+
electricConstant: {
|
|
6243
|
+
description: "Electric constant (vacuum permeability)",
|
|
6244
|
+
examples: ["electricConstant"]
|
|
6245
|
+
},
|
|
6246
|
+
vacuumImpedance: {
|
|
6247
|
+
description: "Characteristic impedance of vacuum",
|
|
6248
|
+
examples: ["vacuumImpedance"]
|
|
6249
|
+
},
|
|
6250
|
+
coulomb: {
|
|
6251
|
+
description: "Coulomb's constant. Deprecated in favor of coulombConstant",
|
|
6252
|
+
examples: ["coulombConstant"]
|
|
6253
|
+
},
|
|
6254
|
+
coulombConstant: { description: "Coulomb's constant", examples: ["coulombConstant"] },
|
|
6255
|
+
elementaryCharge: { description: "Elementary charge", examples: ["elementaryCharge"] },
|
|
6256
|
+
bohrMagneton: { description: "Bohr magneton", examples: ["bohrMagneton"] },
|
|
6257
|
+
conductanceQuantum: { description: "Conductance quantum", examples: ["conductanceQuantum"] },
|
|
6258
|
+
inverseConductanceQuantum: {
|
|
6259
|
+
description: "Inverse conductance quantum",
|
|
6260
|
+
examples: ["inverseConductanceQuantum"]
|
|
6261
|
+
},
|
|
6262
|
+
// josephson: {description: 'Josephson constant', examples: ['josephson']},
|
|
6263
|
+
magneticFluxQuantum: { description: "Magnetic flux quantum", examples: ["magneticFluxQuantum"] },
|
|
6264
|
+
nuclearMagneton: { description: "Nuclear magneton", examples: ["nuclearMagneton"] },
|
|
6265
|
+
klitzing: { description: "Von Klitzing constant", examples: ["klitzing"] },
|
|
6266
|
+
bohrRadius: { description: "Bohr radius", examples: ["bohrRadius"] },
|
|
6267
|
+
classicalElectronRadius: {
|
|
6268
|
+
description: "Classical electron radius",
|
|
6269
|
+
examples: ["classicalElectronRadius"]
|
|
6270
|
+
},
|
|
6271
|
+
electronMass: { description: "Electron mass", examples: ["electronMass"] },
|
|
6272
|
+
fermiCoupling: { description: "Fermi coupling constant", examples: ["fermiCoupling"] },
|
|
6273
|
+
fineStructure: { description: "Fine-structure constant", examples: ["fineStructure"] },
|
|
6274
|
+
hartreeEnergy: { description: "Hartree energy", examples: ["hartreeEnergy"] },
|
|
6275
|
+
protonMass: { description: "Proton mass", examples: ["protonMass"] },
|
|
6276
|
+
deuteronMass: { description: "Deuteron Mass", examples: ["deuteronMass"] },
|
|
6277
|
+
neutronMass: { description: "Neutron mass", examples: ["neutronMass"] },
|
|
6278
|
+
quantumOfCirculation: {
|
|
6279
|
+
description: "Quantum of circulation",
|
|
6280
|
+
examples: ["quantumOfCirculation"]
|
|
6281
|
+
},
|
|
6282
|
+
rydberg: { description: "Rydberg constant", examples: ["rydberg"] },
|
|
6283
|
+
thomsonCrossSection: { description: "Thomson cross section", examples: ["thomsonCrossSection"] },
|
|
6284
|
+
weakMixingAngle: { description: "Weak mixing angle", examples: ["weakMixingAngle"] },
|
|
6285
|
+
efimovFactor: { description: "Efimov factor", examples: ["efimovFactor"] },
|
|
6286
|
+
atomicMass: { description: "Atomic mass constant", examples: ["atomicMass"] },
|
|
6287
|
+
avogadro: { description: "Avogadro's number", examples: ["avogadro"] },
|
|
6288
|
+
boltzmann: { description: "Boltzmann constant", examples: ["boltzmann"] },
|
|
6289
|
+
faraday: { description: "Faraday constant", examples: ["faraday"] },
|
|
6290
|
+
firstRadiation: { description: "First radiation constant", examples: ["firstRadiation"] },
|
|
6291
|
+
loschmidt: {
|
|
6292
|
+
description: "Loschmidt constant at T=273.15 K and p=101.325 kPa",
|
|
6293
|
+
examples: ["loschmidt"]
|
|
6294
|
+
},
|
|
6295
|
+
gasConstant: { description: "Gas constant", examples: ["gasConstant"] },
|
|
6296
|
+
molarPlanckConstant: { description: "Molar Planck constant", examples: ["molarPlanckConstant"] },
|
|
6297
|
+
molarVolume: {
|
|
6298
|
+
description: "Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",
|
|
6299
|
+
examples: ["molarVolume"]
|
|
6300
|
+
},
|
|
6301
|
+
sackurTetrode: {
|
|
6302
|
+
description: "Sackur-Tetrode constant at T=1 K and p=101.325 kPa",
|
|
6303
|
+
examples: ["sackurTetrode"]
|
|
6304
|
+
},
|
|
6305
|
+
secondRadiation: { description: "Second radiation constant", examples: ["secondRadiation"] },
|
|
6306
|
+
stefanBoltzmann: { description: "Stefan-Boltzmann constant", examples: ["stefanBoltzmann"] },
|
|
6307
|
+
wienDisplacement: {
|
|
6308
|
+
description: "Wien displacement law constant",
|
|
6309
|
+
examples: ["wienDisplacement"]
|
|
6310
|
+
},
|
|
6311
|
+
// spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},
|
|
6312
|
+
molarMass: { description: "Molar mass constant", examples: ["molarMass"] },
|
|
6313
|
+
molarMassC12: { description: "Molar mass constant of carbon-12", examples: ["molarMassC12"] },
|
|
6314
|
+
gravity: {
|
|
6315
|
+
description: "Standard acceleration of gravity (standard acceleration of free-fall on Earth)",
|
|
6316
|
+
examples: ["gravity"]
|
|
6317
|
+
},
|
|
6318
|
+
planckLength: { description: "Planck length", examples: ["planckLength"] },
|
|
6319
|
+
planckMass: { description: "Planck mass", examples: ["planckMass"] },
|
|
6320
|
+
planckTime: { description: "Planck time", examples: ["planckTime"] },
|
|
6321
|
+
planckCharge: { description: "Planck charge", examples: ["planckCharge"] },
|
|
6322
|
+
planckTemperature: { description: "Planck temperature", examples: ["planckTemperature"] },
|
|
6323
|
+
// functions - algebra
|
|
6324
|
+
derivative: derivativeDocs,
|
|
6325
|
+
lsolve: lsolveDocs,
|
|
6326
|
+
lsolveAll: lsolveAllDocs,
|
|
6327
|
+
lup: lupDocs,
|
|
6328
|
+
lusolve: lusolveDocs,
|
|
6329
|
+
leafCount: leafCountDocs,
|
|
6330
|
+
polynomialRoot: polynomialRootDocs,
|
|
6331
|
+
resolve: resolveDocs,
|
|
6332
|
+
simplify: simplifyDocs,
|
|
6333
|
+
simplifyConstant: simplifyConstantDocs,
|
|
6334
|
+
simplifyCore: simplifyCoreDocs,
|
|
6335
|
+
symbolicEqual: symbolicEqualDocs,
|
|
6336
|
+
rationalize: rationalizeDocs,
|
|
6337
|
+
slu: sluDocs,
|
|
6338
|
+
usolve: usolveDocs,
|
|
6339
|
+
usolveAll: usolveAllDocs,
|
|
6340
|
+
qr: qrDocs,
|
|
6341
|
+
// functions - arithmetic
|
|
6342
|
+
abs: absDocs,
|
|
6343
|
+
add: addDocs,
|
|
6344
|
+
cbrt: cbrtDocs,
|
|
6345
|
+
ceil: ceilDocs,
|
|
6346
|
+
cube: cubeDocs,
|
|
6347
|
+
divide: divideDocs,
|
|
6348
|
+
dotDivide: dotDivideDocs,
|
|
6349
|
+
dotMultiply: dotMultiplyDocs,
|
|
6350
|
+
dotPow: dotPowDocs,
|
|
6351
|
+
exp: expDocs,
|
|
6352
|
+
expm: expmDocs,
|
|
6353
|
+
expm1: expm1Docs,
|
|
6354
|
+
fix: fixDocs,
|
|
6355
|
+
floor: floorDocs,
|
|
6356
|
+
gcd: gcdDocs,
|
|
6357
|
+
hypot: hypotDocs,
|
|
6358
|
+
lcm: lcmDocs,
|
|
6359
|
+
log: logDocs,
|
|
6360
|
+
log2: log2Docs,
|
|
6361
|
+
log1p: log1pDocs,
|
|
6362
|
+
log10: log10Docs,
|
|
6363
|
+
mod: modDocs,
|
|
6364
|
+
multiply: multiplyDocs,
|
|
6365
|
+
norm: normDocs,
|
|
6366
|
+
nthRoot: nthRootDocs,
|
|
6367
|
+
nthRoots: nthRootsDocs,
|
|
6368
|
+
pow: powDocs,
|
|
6369
|
+
round: roundDocs,
|
|
6370
|
+
sign: signDocs,
|
|
6371
|
+
sqrt: sqrtDocs,
|
|
6372
|
+
sqrtm: sqrtmDocs,
|
|
6373
|
+
square: squareDocs,
|
|
6374
|
+
subtract: subtractDocs,
|
|
6375
|
+
unaryMinus: unaryMinusDocs,
|
|
6376
|
+
unaryPlus: unaryPlusDocs,
|
|
6377
|
+
xgcd: xgcdDocs,
|
|
6378
|
+
invmod: invmodDocs,
|
|
6379
|
+
// functions - bitwise
|
|
6380
|
+
bitAnd: bitAndDocs,
|
|
6381
|
+
bitNot: bitNotDocs,
|
|
6382
|
+
bitOr: bitOrDocs,
|
|
6383
|
+
bitXor: bitXorDocs,
|
|
6384
|
+
leftShift: leftShiftDocs,
|
|
6385
|
+
rightArithShift: rightArithShiftDocs,
|
|
6386
|
+
rightLogShift: rightLogShiftDocs,
|
|
6387
|
+
// functions - combinatorics
|
|
6388
|
+
bellNumbers: bellNumbersDocs,
|
|
6389
|
+
catalan: catalanDocs,
|
|
6390
|
+
composition: compositionDocs,
|
|
6391
|
+
stirlingS2: stirlingS2Docs,
|
|
6392
|
+
// functions - core
|
|
6393
|
+
config: configDocs,
|
|
6394
|
+
import: importDocs,
|
|
6395
|
+
typed: typedDocs,
|
|
6396
|
+
// functions - complex
|
|
6397
|
+
arg: argDocs,
|
|
6398
|
+
conj: conjDocs,
|
|
6399
|
+
re: reDocs,
|
|
6400
|
+
im: imDocs,
|
|
6401
|
+
// functions - expression
|
|
6402
|
+
evaluate: evaluateDocs,
|
|
6403
|
+
help: helpDocs,
|
|
6404
|
+
parse: parseDocs,
|
|
6405
|
+
parser: parserDocs,
|
|
6406
|
+
compile: compileDocs,
|
|
6407
|
+
// functions - geometry
|
|
6408
|
+
distance: distanceDocs,
|
|
6409
|
+
intersect: intersectDocs,
|
|
6410
|
+
// functions - logical
|
|
6411
|
+
and: andDocs,
|
|
6412
|
+
not: notDocs,
|
|
6413
|
+
nullish: nullishDocs,
|
|
6414
|
+
or: orDocs,
|
|
6415
|
+
xor: xorDocs,
|
|
6416
|
+
// functions - matrix
|
|
6417
|
+
mapSlices: mapSlicesDocs,
|
|
6418
|
+
concat: concatDocs,
|
|
6419
|
+
count: countDocs,
|
|
6420
|
+
cross: crossDocs,
|
|
6421
|
+
column: columnDocs,
|
|
6422
|
+
ctranspose: ctransposeDocs,
|
|
6423
|
+
det: detDocs,
|
|
6424
|
+
diag: diagDocs,
|
|
6425
|
+
diff: diffDocs,
|
|
6426
|
+
dot: dotDocs,
|
|
6427
|
+
getMatrixDataType: getMatrixDataTypeDocs,
|
|
6428
|
+
identity: identityDocs,
|
|
6429
|
+
filter: filterDocs,
|
|
6430
|
+
flatten: flattenDocs,
|
|
6431
|
+
forEach: forEachDocs,
|
|
6432
|
+
inv: invDocs,
|
|
6433
|
+
pinv: pinvDocs,
|
|
6434
|
+
eigs: eigsDocs,
|
|
6435
|
+
kron: kronDocs,
|
|
6436
|
+
matrixFromFunction: matrixFromFunctionDocs,
|
|
6437
|
+
matrixFromRows: matrixFromRowsDocs,
|
|
6438
|
+
matrixFromColumns: matrixFromColumnsDocs,
|
|
6439
|
+
map: mapDocs,
|
|
6440
|
+
ones: onesDocs,
|
|
6441
|
+
partitionSelect: partitionSelectDocs,
|
|
6442
|
+
range: rangeDocs,
|
|
6443
|
+
resize: resizeDocs,
|
|
6444
|
+
reshape: reshapeDocs,
|
|
6445
|
+
rotate: rotateDocs,
|
|
6446
|
+
rotationMatrix: rotationMatrixDocs,
|
|
6447
|
+
row: rowDocs,
|
|
6448
|
+
size: sizeDocs,
|
|
6449
|
+
sort: sortDocs,
|
|
6450
|
+
squeeze: squeezeDocs,
|
|
6451
|
+
subset: subsetDocs,
|
|
6452
|
+
trace: traceDocs,
|
|
6453
|
+
transpose: transposeDocs,
|
|
6454
|
+
zeros: zerosDocs,
|
|
6455
|
+
fft: fftDocs,
|
|
6456
|
+
ifft: ifftDocs,
|
|
6457
|
+
sylvester: sylvesterDocs,
|
|
6458
|
+
schur: schurDocs,
|
|
6459
|
+
lyap: lyapDocs,
|
|
6460
|
+
// functions - numeric
|
|
6461
|
+
solveODE: solveODEDocs,
|
|
6462
|
+
// functions - probability
|
|
6463
|
+
bernoulli: bernoulliDocs,
|
|
6464
|
+
combinations: combinationsDocs,
|
|
6465
|
+
combinationsWithRep: combinationsWithRepDocs,
|
|
6466
|
+
// distribution: distributionDocs,
|
|
6467
|
+
factorial: factorialDocs,
|
|
6468
|
+
gamma: gammaDocs,
|
|
6469
|
+
kldivergence: kldivergenceDocs,
|
|
6470
|
+
lgamma: lgammaDocs,
|
|
6471
|
+
multinomial: multinomialDocs,
|
|
6472
|
+
permutations: permutationsDocs,
|
|
6473
|
+
pickRandom: pickRandomDocs,
|
|
6474
|
+
random: randomDocs,
|
|
6475
|
+
randomInt: randomIntDocs,
|
|
6476
|
+
// functions - relational
|
|
6477
|
+
compare: compareDocs,
|
|
6478
|
+
compareNatural: compareNaturalDocs,
|
|
6479
|
+
compareText: compareTextDocs,
|
|
6480
|
+
deepEqual: deepEqualDocs,
|
|
6481
|
+
equal: equalDocs,
|
|
6482
|
+
equalText: equalTextDocs,
|
|
6483
|
+
larger: largerDocs,
|
|
6484
|
+
largerEq: largerEqDocs,
|
|
6485
|
+
smaller: smallerDocs,
|
|
6486
|
+
smallerEq: smallerEqDocs,
|
|
6487
|
+
unequal: unequalDocs,
|
|
6488
|
+
// functions - set
|
|
6489
|
+
setCartesian: setCartesianDocs,
|
|
6490
|
+
setDifference: setDifferenceDocs,
|
|
6491
|
+
setDistinct: setDistinctDocs,
|
|
6492
|
+
setIntersect: setIntersectDocs,
|
|
6493
|
+
setIsSubset: setIsSubsetDocs,
|
|
6494
|
+
setMultiplicity: setMultiplicityDocs,
|
|
6495
|
+
setPowerset: setPowersetDocs,
|
|
6496
|
+
setSize: setSizeDocs,
|
|
6497
|
+
setSymDifference: setSymDifferenceDocs,
|
|
6498
|
+
setUnion: setUnionDocs,
|
|
6499
|
+
// functions - signal
|
|
6500
|
+
zpk2tf: zpk2tfDocs,
|
|
6501
|
+
freqz: freqzDocs,
|
|
6502
|
+
// functions - special
|
|
6503
|
+
erf: erfDocs,
|
|
6504
|
+
zeta: zetaDocs,
|
|
6505
|
+
// functions - statistics
|
|
6506
|
+
cumsum: cumSumDocs,
|
|
6507
|
+
mad: madDocs,
|
|
6508
|
+
max: maxDocs,
|
|
6509
|
+
mean: meanDocs,
|
|
6510
|
+
median: medianDocs,
|
|
6511
|
+
min: minDocs,
|
|
6512
|
+
mode: modeDocs,
|
|
6513
|
+
prod: prodDocs,
|
|
6514
|
+
quantileSeq: quantileSeqDocs,
|
|
6515
|
+
std: stdDocs,
|
|
6516
|
+
sum: sumDocs,
|
|
6517
|
+
variance: varianceDocs,
|
|
6518
|
+
corr: corrDocs,
|
|
6519
|
+
// functions - trigonometry
|
|
6520
|
+
acos: acosDocs,
|
|
6521
|
+
acosh: acoshDocs,
|
|
6522
|
+
acot: acotDocs,
|
|
6523
|
+
acoth: acothDocs,
|
|
6524
|
+
acsc: acscDocs,
|
|
6525
|
+
acsch: acschDocs,
|
|
6526
|
+
asec: asecDocs,
|
|
6527
|
+
asech: asechDocs,
|
|
6528
|
+
asin: asinDocs,
|
|
6529
|
+
asinh: asinhDocs,
|
|
6530
|
+
atan: atanDocs,
|
|
6531
|
+
atanh: atanhDocs,
|
|
6532
|
+
atan2: atan2Docs,
|
|
6533
|
+
cos: cosDocs,
|
|
6534
|
+
cosh: coshDocs,
|
|
6535
|
+
cot: cotDocs,
|
|
6536
|
+
coth: cothDocs,
|
|
6537
|
+
csc: cscDocs,
|
|
6538
|
+
csch: cschDocs,
|
|
6539
|
+
sec: secDocs,
|
|
6540
|
+
sech: sechDocs,
|
|
6541
|
+
sin: sinDocs,
|
|
6542
|
+
sinh: sinhDocs,
|
|
6543
|
+
tan: tanDocs,
|
|
6544
|
+
tanh: tanhDocs,
|
|
6545
|
+
// functions - units
|
|
6546
|
+
to: toDocs,
|
|
6547
|
+
toBest: toBestDocs,
|
|
6548
|
+
// functions - utils
|
|
6549
|
+
clone: cloneDocs,
|
|
6550
|
+
format: formatDocs,
|
|
6551
|
+
bin: binDocs,
|
|
6552
|
+
oct: octDocs,
|
|
6553
|
+
hex: hexDocs,
|
|
6554
|
+
isNaN: isNaNDocs,
|
|
6555
|
+
isBounded: isBoundedDocs,
|
|
6556
|
+
isFinite: isFiniteDocs,
|
|
6557
|
+
isInteger: isIntegerDocs,
|
|
6558
|
+
isNegative: isNegativeDocs,
|
|
6559
|
+
isNumeric: isNumericDocs,
|
|
6560
|
+
hasNumericValue: hasNumericValueDocs,
|
|
6561
|
+
isPositive: isPositiveDocs,
|
|
6562
|
+
isPrime: isPrimeDocs,
|
|
6563
|
+
isZero: isZeroDocs,
|
|
6564
|
+
print: printDocs,
|
|
6565
|
+
typeOf: typeOfDocs,
|
|
6566
|
+
numeric: numericDocs
|
|
6567
|
+
};
|
|
6568
|
+
|
|
2845
6569
|
// src/compiler/compile.ts
|
|
2846
6570
|
function compile(node, mathScope) {
|
|
2847
6571
|
const evalFn = compileNode(node, mathScope, {});
|
|
@@ -7861,6 +11585,7 @@ export {
|
|
|
7861
11585
|
createRangeNode,
|
|
7862
11586
|
createRelationalNode,
|
|
7863
11587
|
createSymbolNode,
|
|
11588
|
+
embeddedDocs,
|
|
7864
11589
|
escapeMathML,
|
|
7865
11590
|
getAssociativity,
|
|
7866
11591
|
getOperator,
|