lmr reference
Every command-line flag, exit code, context object, host type, method and function of the lmr host, generated from the schema embedded in the repository (native/schema/lmr.dsl.json, dsl.schema 2, name lmr) and from native/src/host/main.cpp. The host schema declares 166 functions with 234 signatures and 50 types with 604 method signatures; the vendored standard library adds 206 more signatures.
Command line
| Command | Effect |
|---|---|
| lmr --version | Prints lmr followed by the release version and exits 0. |
| lmr --lmcode-schema | Prints a readable summary of the registry: context and function signatures, then each type with its methods. |
| lmr --lmcode-schema --json | Writes the embedded schema JSON byte for byte; this is what lmscript compiles against. |
| lmr --schema | Accepted as an alias of --lmcode-schema, with the same optional --json. |
| lmr --lmcode-signatures | Prints one canonical signature per line from the live registry. |
| lmr --generate-schema | Prints schema JSON generated from the live registry (used to maintain the schema file). |
| lmr --lmcode FILE [FILE ...] | Loads and verifies every compiled program file, then runs them in order and writes one result frame to stdout. |
| lmr --lmcode FILE --lmcode FILE | The repeated-flag form is also accepted for multi-file runs. |
Any other argument shape prints the usage line to stderr and is reported as a usage error. All program files are loaded and verified before any of them runs, so a broken later file leaves no output from an earlier one.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success: the program ran and every out.check assertion passed. |
| 2 | Command-line usage error (error code CLI_USAGE). |
| 3 | Load or run error, for example bytecode that fails verification (LOAD_BAD_BYTECODE) or a registry error. |
| 4 | Application failure: one or more out.check calls failed (APP_FAIL). |
Run result
From LMScript, run_lmcode(prog) returns an object with ok and result. For lmr the result holds values (everything stored with out.set, in first-set order), checks (the number of out.check calls) and failures (the number that failed). Non-finite numbers serialize as JSON null.
Context objects
| Name | Type |
|---|---|
| out | Out |
Host functions
| Function | Signatures |
|---|---|
| acos | acos(float) -> float |
| anova | anova(Lm, Lm) -> Anova |
| approx_fun | approx_fun(Vec, Vec) -> ApproxFun; approx_fun(Vec, Vec, string, int) -> ApproxFun; approx_fun(Vec, Vec, string, int, float) -> ApproxFun |
| arima | arima(int, int, int) -> ArimaSpec |
| arima_sim | arima_sim(Rng, int, Vec, Vec, float) -> Vec; arima_sim(Rng, int, Vec, Vec, float, int) -> Vec |
| as_matrix | as_matrix(Frame) -> Mat |
| asin | asin(float) -> float |
| atan | atan(float) -> float |
| atan2 | atan2(float, float) -> float |
| bessel_i | bessel_i(float, float) -> float; bessel_i(float, float, bool) -> float |
| bessel_j | bessel_j(float, float) -> float |
| bessel_k | bessel_k(float, float) -> float; bessel_k(float, float, bool) -> float |
| bessel_y | bessel_y(float, float) -> float |
| beta | beta(float, float) -> float |
| beta_dist | beta_dist(float, float) -> Dist |
| beta_inc | beta_inc(float, float, float) -> float |
| binom | binom(int, float) -> Dist |
| bw | bw(Vec, string) -> float |
| cauchy | cauchy(float, float) -> Dist |
| ceil | ceil(float) -> float |
| chisq | chisq(float) -> Dist; chisq(float, float) -> Dist |
| choose | choose(float, float) -> float |
| cmdscale | cmdscale(Mat, int) -> Mds |
| cosh | cosh(float) -> float |
| cvec | cvec(Vec, Vec) -> CVec |
| density | density(Vec) -> Density; density(Vec, float, string) -> Density; density(Vec, string) -> Density; density(Vec, string, string) -> Density; density(Vec, string, string, float) -> Density |
| diag | diag(Vec) -> Mat |
| digamma | digamma(float) -> float |
| dist | dist(string, float) -> Dist; dist(string, float, float) -> Dist; dist(string, float, float, float) -> Dist |
| ecdf | ecdf(Vec) -> Ecdf |
| erf | erf(float) -> float |
| erfc | erfc(float) -> float |
| exp | exp(float) -> float |
| exp_dist | exp_dist(float) -> Dist |
| expm1 | expm1(float) -> float |
| f_dist | f_dist(float, float) -> Dist; f_dist(float, float, float) -> Dist |
| factorial | factorial(float) -> float |
| fft | fft(Vec) -> CVec |
| file_append | file_append(string, string) -> void |
| file_exists | file_exists(string) -> bool |
| file_lines | file_lines(string) -> StrList |
| file_read | file_read(string) -> string |
| file_write | file_write(string, string) -> void |
| float_list | float_list() -> FloatList |
| float_map | float_map() -> FloatMap |
| float_pq | float_pq() -> FloatPQ |
| float_queue | float_queue() -> FloatQueue |
| float_stack | float_stack() -> FloatStack |
| fmt | fmt(string, float) -> string; fmt(string, int) -> string; fmt(string, string) -> string |
| frame | frame() -> Frame |
| gamma | gamma(float) -> float |
| gamma_dist | gamma_dist(float, float) -> Dist |
| gamma_p | gamma_p(float, float) -> float |
| geom | geom(float) -> Dist |
| glm | glm(Frame, string, string) -> Glm; glm(Frame, string, string, string) -> Glm; glm(Frame, string, string, string, Vec) -> Glm; glm(Frame, string, string, string, Vec, Vec) -> Glm |
| hclust | hclust(Frame, string) -> Hclust; hclust(Frame, string, string) -> Hclust; hclust(Frame, string, string, float) -> Hclust |
| hist | hist(Vec) -> Hist; hist(Vec, Vec) -> Hist; hist(Vec, string) -> Hist |
| hyper | hyper(int, int, int) -> Dist |
| identity | identity(int) -> Mat |
| inf | inf() -> float |
| int_list | int_list() -> IntList |
| int_map | int_map() -> IntMap |
| int_pq | int_pq() -> IntPQ |
| int_queue | int_queue() -> IntQueue |
| int_stack | int_stack() -> IntStack |
| integrate | integrate(float, float) -> Integral |
| is_finite | is_finite(float) -> bool |
| is_kept | is_kept(string) -> bool |
| is_nan | is_nan(float) -> bool |
| json_parse | json_parse(string) -> Json |
| keep | keep(string, Frame) -> void; keep(string, Vec) -> void |
| kept_frame | kept_frame(string) -> Frame |
| kept_vec | kept_vec(string) -> Vec |
| kmeans | kmeans(Frame, int, Rng) -> Kmeans; kmeans(Frame, int, Rng, int) -> Kmeans; kmeans(Frame, int, Rng, int, int, string) -> Kmeans |
| lbeta | lbeta(float, float) -> float |
| lchoose | lchoose(float, float) -> float |
| lfactorial | lfactorial(float) -> float |
| lgamma | lgamma(float) -> float |
| linspace | linspace(float, float, int) -> Vec |
| lm | lm(Frame, string) -> Lm; lm(Frame, string, Vec) -> Lm |
| lmcode_return_null | lmcode_return_null() -> void |
| lmcode_return_put | lmcode_return_put(string, FloatList) -> void; lmcode_return_put(string, FloatMap) -> void; lmcode_return_put(string, IntList) -> void; lmcode_return_put(string, IntMap) -> void; lmcode_return_put(string, Json) -> void; lmcode_return_put(string, StrList) -> void; lmcode_return_put(string, StrMap) -> void; lmcode_return_put(string, bool) -> void; lmcode_return_put(string, float) -> void; lmcode_return_put(string, int) -> void; lmcode_return_put(string, string) -> void |
| lmcode_return_put_null | lmcode_return_put_null(string) -> void |
| lmcode_return_set | lmcode_return_set(FloatList) -> void; lmcode_return_set(FloatMap) -> void; lmcode_return_set(IntList) -> void; lmcode_return_set(IntMap) -> void; lmcode_return_set(Json) -> void; lmcode_return_set(StrList) -> void; lmcode_return_set(StrMap) -> void; lmcode_return_set(bool) -> void; lmcode_return_set(float) -> void; lmcode_return_set(int) -> void; lmcode_return_set(string) -> void |
| lnorm | lnorm(float, float) -> Dist |
| loess | loess(Vec, Vec) -> Loess; loess(Vec, Vec, float) -> Loess; loess(Vec, Vec, float, int) -> Loess; loess(Vec, Vec, float, int, string) -> Loess |
| log | log(float) -> float |
| log10 | log10(float) -> float |
| log1p | log1p(float) -> float |
| log2 | log2(float) -> float |
| logis | logis(float, float) -> Dist |
| lpad | lpad(string, int) -> string |
| mahalanobis | mahalanobis(Mat, Vec, Mat) -> Vec |
| math_abs | math_abs(float) -> float; math_abs(int) -> int |
| math_ceil | math_ceil(float) -> float; math_ceil(int) -> int |
| math_floor | math_floor(float) -> float; math_floor(int) -> int |
| math_max | math_max(float, float) -> float; math_max(int, int) -> int |
| math_min | math_min(float, float) -> float; math_min(int, int) -> int |
| math_pow | math_pow(float, float) -> float; math_pow(int, int) -> int |
| math_round | math_round(float) -> float; math_round(int) -> int |
| math_sqrt | math_sqrt(float) -> float; math_sqrt(int) -> int |
| matrix | matrix(Vec, int, bool) -> Mat |
| minimize | minimize(Vec, string) -> Minimizer |
| nan | nan() -> float |
| nbinom | nbinom(float, float) -> Dist |
| nls | nls(Vec) -> Nls |
| norm | norm() -> Dist; norm(float, float) -> Dist |
| optimize | optimize(float, float) -> Optimizer1; optimize(float, float, bool) -> Optimizer1 |
| parse_vec | parse_vec(string) -> Vec |
| pi | pi() -> float |
| pois | pois(float) -> Dist |
| prcomp | prcomp(Frame, bool) -> Pca; prcomp(Frame, bool, bool) -> Pca; prcomp(Mat, bool) -> Pca |
| pretty | pretty(float, float, int) -> Vec |
| read_csv | read_csv(string) -> Frame |
| rep | rep(float, int) -> Vec |
| rng | rng(int) -> Rng |
| round | round(float) -> float; round(float, int) -> float |
| rpad | rpad(string, int) -> string |
| seq | seq(float, float, float) -> Vec |
| seq_len | seq_len(int) -> Vec |
| sinh | sinh(float) -> float |
| smooth_spline | smooth_spline(Vec, Vec) -> SmoothSpline; smooth_spline(Vec, Vec, bool) -> SmoothSpline |
| smooth_spline_df | smooth_spline_df(Vec, Vec, float) -> SmoothSpline |
| smooth_spline_lambda | smooth_spline_lambda(Vec, Vec, float) -> SmoothSpline |
| spline_fun | spline_fun(Vec, Vec) -> Spline; spline_fun(Vec, Vec, string) -> Spline |
| stl | stl(Vec, int, int) -> Stl; stl(Vec, int, int, bool) -> Stl |
| stl_periodic | stl_periodic(Vec, int) -> Stl; stl_periodic(Vec, int, bool) -> Stl |
| str_base64_decode | str_base64_decode(string) -> string |
| str_base64_encode | str_base64_encode(string) -> string |
| str_contains | str_contains(string, string) -> bool |
| str_ends_with | str_ends_with(string, string) -> bool |
| str_find | str_find(string, string) -> int |
| str_hex_decode | str_hex_decode(string) -> string |
| str_hex_encode | str_hex_encode(string) -> string |
| str_is_float | str_is_float(string) -> bool |
| str_is_int | str_is_int(string) -> bool |
| str_len | str_len(string) -> int |
| str_list | str_list() -> StrList |
| str_lower | str_lower(string) -> string |
| str_map | str_map() -> StrMap |
| str_match | str_match(string, string) -> bool |
| str_pq | str_pq() -> StrPQ |
| str_queue | str_queue() -> StrQueue |
| str_repeat | str_repeat(string, int) -> string |
| str_replace | str_replace(string, string, string) -> string |
| str_split | str_split(string, string) -> StrList |
| str_stack | str_stack() -> StrStack |
| str_starts_with | str_starts_with(string, string) -> bool |
| str_substr | str_substr(string, int, int) -> string |
| str_to_float | str_to_float(string) -> float |
| str_to_int | str_to_int(string) -> int |
| str_trim | str_trim(string) -> string |
| str_upper | str_upper(string) -> string |
| t_dist | t_dist(float) -> Dist; t_dist(float, float) -> Dist |
| tan | tan(float) -> float |
| tanh | tanh(float) -> float |
| template_render | template_render(string, Json) -> string |
| test | test(string) -> Test |
| trigamma | trigamma(float) -> float |
| trunc | trunc(float) -> float |
| tukey | tukey(float, float) -> Dist; tukey(float, float, float) -> Dist |
| unif | unif(float, float) -> Dist |
| uniroot | uniroot(float, float) -> RootFinder |
| vec | vec() -> Vec |
| weibull | weibull(float, float) -> Dist |
| zeros | zeros(int) -> Vec |
Host types and methods
The schema declares these 50 types: Anova, ApproxFun, Arima, ArimaSpec, CVec, Density, Dist, Ecdf, Eigen, FloatList, FloatMap, FloatPQ, FloatQueue, FloatStack, Forecast, Frame, Glm, Hclust, Hist, Htest, IntList, IntMap, IntPQ, IntQueue, IntStack, Integral, Json, Kmeans, Lm, Loess, Mat, Mds, Minimizer, Nls, Optimizer1, Out, Pca, Rng, RootFinder, SmoothSpline, Spline, Stl, StrList, StrMap, StrPQ, StrQueue, StrStack, Svd, Test, Vec.
Anova
| Method | Signatures |
|---|---|
| at | at(int, string) -> float; at(string, string) -> float |
| col | col(string) -> Vec |
| columns | columns() -> StrList |
| n_rows | n_rows() -> int |
| row_name | row_name(int) -> string |
| table | table() -> string |
ApproxFun
| Method | Signatures |
|---|---|
| at | at(float) -> float |
| eval | eval(Vec) -> Vec |
Arima
| Method | Signatures |
|---|---|
| aic | aic() -> float |
| convergence | convergence() -> int |
| estimate | estimate(int) -> float; estimate(string) -> float |
| forecast | forecast(int) -> Forecast |
| has_coef | has_coef(string) -> bool |
| loglik | loglik() -> float |
| n_coef | n_coef() -> int |
| name | name(int) -> string |
| nobs | nobs() -> int |
| p_value | p_value(int) -> float; p_value(string) -> float |
| residuals | residuals() -> Vec |
| se | se(int) -> float; se(string) -> float |
| sigma2 | sigma2() -> float |
| statistic | statistic(int) -> float; statistic(string) -> float |
ArimaSpec
| Method | Signatures |
|---|---|
| fit | fit(Vec) -> Arima |
| include_mean | include_mean(bool) -> ArimaSpec |
| method | method(string) -> ArimaSpec |
| seasonal | seasonal(int, int, int, int) -> ArimaSpec |
CVec
| Method | Signatures |
|---|---|
| arg | arg(int) -> float |
| fft | fft(bool) -> CVec |
| im | im(int) -> float |
| im_vec | im_vec() -> Vec |
| len | len() -> int |
| mod | mod(int) -> float |
| mod_vec | mod_vec() -> Vec |
| re | re(int) -> float |
| re_vec | re_vec() -> Vec |
| scale | scale(float) -> CVec |
Density
| Method | Signatures |
|---|---|
| at | at(float) -> float |
| bw | bw() -> float |
| eval | eval(Vec) -> Vec |
| kernel | kernel() -> string |
| x | x() -> Vec |
| y | y() -> Vec |
Dist
| Method | Signatures |
|---|---|
| d | d(float) -> float |
| d_vec | d_vec(Vec) -> Vec |
| is_discrete | is_discrete() -> bool |
| log_d | log_d(float) -> float |
| log_p | log_p(float) -> float |
| log_p_upper | log_p_upper(float) -> float |
| mean | mean() -> float |
| name | name() -> string |
| p | p(float) -> float |
| p_upper | p_upper(float) -> float |
| p_vec | p_vec(Vec) -> Vec |
| q | q(float) -> float |
| q_log | q_log(float) -> float |
| q_upper | q_upper(float) -> float |
| q_vec | q_vec(Vec) -> Vec |
| sd | sd() -> float |
| var | var() -> float |
Ecdf
| Method | Signatures |
|---|---|
| at | at(float) -> float |
| eval | eval(Vec) -> Vec |
| knots | knots() -> Vec |
| quantile | quantile(float) -> float |
Eigen
| Method | Signatures |
|---|---|
| values | values() -> Vec |
| vectors | vectors() -> Mat |
FloatList
| Method | Signatures |
|---|---|
| add | add(float) -> FloatList |
| at | at(int) -> float |
| clear | clear() -> FloatList |
| contains | contains(float) -> bool |
| index_of | index_of(float) -> int |
| len | len() -> int |
| set | set(int, float) -> FloatList |
FloatMap
| Method | Signatures |
|---|---|
| clear | clear() -> FloatMap |
| get | get(string) -> float |
| get_or | get_or(string, float) -> float |
| has | has(string) -> bool |
| key_at | key_at(int) -> string |
| keys | keys() -> StrList |
| len | len() -> int |
| remove | remove(string) -> bool |
| set | set(string, float) -> FloatMap |
| values | values() -> FloatList |
FloatPQ
| Method | Signatures |
|---|---|
| clear | clear() -> FloatPQ |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> float |
| pop | pop() -> float |
| push | push(float, float) -> FloatPQ |
FloatQueue
| Method | Signatures |
|---|---|
| at | at(int) -> float |
| clear | clear() -> FloatQueue |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> float |
| pop | pop() -> float |
| push | push(float) -> FloatQueue |
FloatStack
| Method | Signatures |
|---|---|
| at | at(int) -> float |
| clear | clear() -> FloatStack |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> float |
| pop | pop() -> float |
| push | push(float) -> FloatStack |
Forecast
| Method | Signatures |
|---|---|
| len | len() -> int |
| lower | lower(int, float) -> float |
| mean | mean() -> Vec |
| mean_at | mean_at(int) -> float |
| se | se() -> Vec |
| se_at | se_at(int) -> float |
| upper | upper(int, float) -> float |
Frame
| Method | Signatures |
|---|---|
| col | col(string) -> Vec |
| drop | drop(string) -> Frame |
| drop_nan | drop_nan() -> Frame |
| has | has(string) -> bool |
| head | head(int) -> Frame |
| is_text | is_text(string) -> bool |
| names | names() -> StrList |
| ncol | ncol() -> int |
| nrow | nrow() -> int |
| select | select(string) -> Frame |
| set | set(string, StrList) -> Frame; set(string, Vec) -> Frame |
| text | text(string) -> StrList |
| where | where(Vec) -> Frame |
| write_csv | write_csv(string) -> void |
Glm
| Method | Signatures |
|---|---|
| aic | aic() -> float |
| aliased | aliased(int) -> bool; aliased(string) -> bool |
| anova | anova(string) -> Anova |
| coef_table | coef_table() -> string |
| conf_high | conf_high(int, float) -> float; conf_high(string, float) -> float |
| conf_low | conf_low(int, float) -> float; conf_low(string, float) -> float |
| converged | converged() -> bool |
| deviance | deviance() -> float |
| df_null | df_null() -> int |
| df_residual | df_residual() -> int |
| dispersion | dispersion() -> float |
| estimate | estimate(int) -> float; estimate(string) -> float |
| estimates | estimates() -> Vec |
| family | family() -> string |
| fitted | fitted() -> Vec |
| has_coef | has_coef(string) -> bool |
| iter | iter() -> int |
| linear_predictors | linear_predictors() -> Vec |
| link | link() -> string |
| n | n() -> int |
| n_coef | n_coef() -> int |
| name | name(int) -> string |
| names | names() -> StrList |
| null_deviance | null_deviance() -> float |
| p_value | p_value(int) -> float; p_value(string) -> float |
| predict | predict(Frame, string) -> Vec |
| residuals | residuals(string) -> Vec |
| se | se(int) -> float; se(string) -> float |
| statistic | statistic(int) -> float; statistic(string) -> float |
Hclust
| Method | Signatures |
|---|---|
| cut | cut(int) -> Vec |
| height | height(int) -> float |
| heights | heights() -> Vec |
| merge_a | merge_a(int) -> int |
| merge_b | merge_b(int) -> int |
| n | n() -> int |
| order | order() -> Vec |
Hist
| Method | Signatures |
|---|---|
| breaks | breaks() -> Vec |
| counts | counts() -> Vec |
| density | density() -> Vec |
| mids | mids() -> Vec |
Htest
| Method | Signatures |
|---|---|
| alternative | alternative() -> string |
| conf_high | conf_high() -> float |
| conf_level | conf_level() -> float |
| conf_low | conf_low() -> float |
| df | df() -> float |
| estimate | estimate() -> float; estimate(int) -> float |
| estimate_name | estimate_name(int) -> string |
| expected | expected() -> Vec |
| has_ci | has_ci() -> bool |
| method | method() -> string |
| n_estimates | n_estimates() -> int |
| n_params | n_params() -> int |
| null_value | null_value() -> float |
| p_value | p_value() -> float |
| param | param(int) -> float; param(string) -> float |
| param_name | param_name(int) -> string |
| statistic | statistic() -> float |
| statistic_name | statistic_name() -> string |
| summary | summary() -> string |
IntList
| Method | Signatures |
|---|---|
| add | add(int) -> IntList |
| at | at(int) -> int |
| clear | clear() -> IntList |
| contains | contains(int) -> bool |
| index_of | index_of(int) -> int |
| len | len() -> int |
| set | set(int, int) -> IntList |
IntMap
| Method | Signatures |
|---|---|
| clear | clear() -> IntMap |
| get | get(string) -> int |
| get_or | get_or(string, int) -> int |
| has | has(string) -> bool |
| key_at | key_at(int) -> string |
| keys | keys() -> StrList |
| len | len() -> int |
| remove | remove(string) -> bool |
| set | set(string, int) -> IntMap |
| values | values() -> IntList |
IntPQ
| Method | Signatures |
|---|---|
| clear | clear() -> IntPQ |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> int |
| pop | pop() -> int |
| push | push(int, float) -> IntPQ |
IntQueue
| Method | Signatures |
|---|---|
| at | at(int) -> int |
| clear | clear() -> IntQueue |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> int |
| pop | pop() -> int |
| push | push(int) -> IntQueue |
IntStack
| Method | Signatures |
|---|---|
| at | at(int) -> int |
| clear | clear() -> IntStack |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> int |
| pop | pop() -> int |
| push | push(int) -> IntStack |
Integral
| Method | Signatures |
|---|---|
| abs_error | abs_error() -> float |
| abs_tol | abs_tol(float) -> Integral |
| evaluations | evaluations() -> int |
| ier | ier() -> int |
| message | message() -> string |
| next | next() -> bool |
| ok | ok() -> bool |
| rel_tol | rel_tol(float) -> Integral |
| subdivisions | subdivisions(int) -> Integral |
| subdivisions_used | subdivisions_used() -> int |
| tell | tell(float) -> void |
| value | value() -> float |
| x | x() -> float |
Json
| Method | Signatures |
|---|---|
| as_bool | as_bool() -> bool |
| as_float | as_float() -> float |
| as_int | as_int() -> int |
| as_string | as_string() -> string |
| at | at(int) -> Json |
| get | get(string) -> Json |
| has | has(string) -> bool |
| keys | keys() -> StrList |
| kind | kind() -> string |
| len | len() -> int |
| to_json | to_json() -> string |
Kmeans
| Method | Signatures |
|---|---|
| betweenss | betweenss() -> float |
| center | center(int, int) -> float; center(int, string) -> float |
| cluster | cluster(int) -> int |
| clusters | clusters() -> Vec |
| ifault | ifault() -> int |
| iter | iter() -> int |
| k | k() -> int |
| n | n() -> int |
| size | size(int) -> int |
| tot_withinss | tot_withinss() -> float |
| totss | totss() -> float |
| withinss | withinss(int) -> float |
Lm
| Method | Signatures |
|---|---|
| adj_r_squared | adj_r_squared() -> float |
| aic | aic() -> float |
| aliased | aliased(int) -> bool; aliased(string) -> bool |
| anova | anova() -> Anova |
| bic | bic() -> float |
| coef_table | coef_table() -> string |
| conf_high | conf_high(int, float) -> float; conf_high(string, float) -> float |
| conf_low | conf_low(int, float) -> float; conf_low(string, float) -> float |
| df_residual | df_residual() -> int |
| estimate | estimate(int) -> float; estimate(string) -> float |
| estimates | estimates() -> Vec |
| f_df1 | f_df1() -> float |
| f_df2 | f_df2() -> float |
| f_p_value | f_p_value() -> float |
| f_statistic | f_statistic() -> float |
| fitted | fitted() -> Vec |
| has_coef | has_coef(string) -> bool |
| loglik | loglik() -> float |
| n | n() -> int |
| n_coef | n_coef() -> int |
| name | name(int) -> string |
| names | names() -> StrList |
| p_value | p_value(int) -> float; p_value(string) -> float |
| predict | predict(Frame) -> Vec |
| predict_se | predict_se(Frame) -> Vec |
| r_squared | r_squared() -> float |
| rank | rank() -> int |
| residuals | residuals() -> Vec |
| rss | rss() -> float |
| se | se(int) -> float; se(string) -> float |
| sigma | sigma() -> float |
| statistic | statistic(int) -> float; statistic(string) -> float |
Loess
| Method | Signatures |
|---|---|
| at | at(float) -> float |
| enp | enp() -> float |
| eval | eval(Vec) -> Vec |
| fitted | fitted() -> Vec |
| one_delta | one_delta() -> float |
| residuals | residuals() -> Vec |
| robustness_weights | robustness_weights() -> Vec |
| s | s() -> float |
| trace_hat | trace_hat() -> float |
| two_delta | two_delta() -> float |
Mat
| Method | Signatures |
|---|---|
| add | add(Mat) -> Mat |
| at | at(int, int) -> float |
| chol | chol() -> Mat |
| col | col(int) -> Vec |
| cor | cor() -> Mat |
| cov | cov() -> Mat |
| det | det() -> float |
| diag | diag() -> Vec |
| dist | dist(string) -> Mat |
| eigen | eigen() -> Eigen |
| format | format(string) -> string |
| inverse | inverse() -> Mat |
| mul | mul(Mat) -> Mat |
| mul_vec | mul_vec(Vec) -> Vec |
| ncol | ncol() -> int |
| nrow | nrow() -> int |
| row | row(int) -> Vec |
| scale | scale(float) -> Mat |
| set | set(int, int, float) -> Mat |
| solve | solve(Vec) -> Vec |
| str | str() -> string |
| sub | sub(Mat) -> Mat |
| svd | svd() -> Svd |
| t | t() -> Mat |
| to_frame | to_frame() -> Frame |
| values | values() -> Vec |
Mds
| Method | Signatures |
|---|---|
| eig | eig() -> Vec |
| gof | gof() -> Vec |
| points | points() -> Mat |
| warning | warning() -> string |
Minimizer
| Method | Signatures |
|---|---|
| convergence | convergence() -> int |
| evaluations | evaluations() -> int |
| fn_count | fn_count() -> int |
| gr_count | gr_count() -> int |
| hessian | hessian(bool) -> Minimizer; hessian(int, int) -> float |
| lower | lower(Vec) -> Minimizer |
| maxit | maxit(int) -> Minimizer |
| message | message() -> string |
| ndeps | ndeps(float) -> Minimizer |
| next | next() -> bool |
| par | par(int) -> float |
| pars | pars() -> Vec |
| point | point() -> Vec |
| reltol | reltol(float) -> Minimizer |
| seed | seed(int) -> Minimizer |
| tell | tell(float) -> void |
| upper | upper(Vec) -> Minimizer |
| value | value() -> float |
| x | x(int) -> float |
Nls
| Method | Signatures |
|---|---|
| algorithm | algorithm(string) -> Nls |
| aliased | aliased(int) -> bool; aliased(string) -> bool |
| coef_table | coef_table() -> string |
| conf_high | conf_high(int, float) -> float; conf_high(string, float) -> float |
| conf_low | conf_low(int, float) -> float; conf_low(string, float) -> float |
| conv_criterion | conv_criterion() -> float |
| converged | converged() -> bool |
| df_residual | df_residual() -> int |
| estimate | estimate(int) -> float; estimate(string) -> float |
| estimates | estimates() -> Vec |
| evaluations | evaluations() -> int |
| fitted | fitted() -> Vec |
| has_coef | has_coef(string) -> bool |
| iterations | iterations() -> int |
| lower | lower(string, float) -> Nls |
| maxiter | maxiter(int) -> Nls |
| message | message() -> string |
| n | n() -> int |
| n_coef | n_coef() -> int |
| name | name(int) -> string |
| names | names() -> StrList |
| next | next() -> bool |
| p_value | p_value(int) -> float; p_value(string) -> float |
| par | par(int) -> float; par(string) -> float |
| param | param(string, float) -> Nls |
| residuals | residuals() -> Vec |
| rss | rss() -> float |
| se | se(int) -> float; se(string) -> float |
| sigma | sigma() -> float |
| statistic | statistic(int) -> float; statistic(string) -> float |
| tell | tell(int, float) -> void |
| tol | tol(float) -> Nls |
| upper | upper(string, float) -> Nls |
Optimizer1
| Method | Signatures |
|---|---|
| argmin | argmin() -> float |
| evaluations | evaluations() -> int |
| next | next() -> bool |
| objective | objective() -> float |
| tell | tell(float) -> void |
| tol | tol(float) -> Optimizer1 |
| x | x() -> float |
Out
| Method | Signatures |
|---|---|
| check | check(bool, string) -> bool |
| check_close | check_close(float, float, float, string) -> bool |
| fail | fail(string) -> void |
| failures | failures() -> int |
| print(string) -> void | |
| set | set(string, StrList) -> void; set(string, Vec) -> void; set(string, bool) -> void; set(string, float) -> void; set(string, int) -> void; set(string, string) -> void |
Pca
| Method | Signatures |
|---|---|
| center | center() -> Vec |
| cumulative | cumulative() -> Vec |
| loading | loading(string, int) -> float |
| proportion | proportion() -> Vec |
| rotation | rotation() -> Mat |
| scale | scale() -> Vec |
| scores | scores() -> Mat |
| sdev | sdev() -> Vec |
| summary | summary() -> string |
Rng
| Method | Signatures |
|---|---|
| below | below(int) -> int |
| draw | draw(Dist) -> float; draw(Dist, int) -> Vec |
| norm | norm() -> float |
| permutation | permutation(int) -> Vec |
| sample | sample(Vec, int, bool) -> Vec; sample(Vec, int, bool, Vec) -> Vec |
| unif | unif() -> float |
RootFinder
| Method | Signatures |
|---|---|
| converged | converged() -> bool |
| estim_prec | estim_prec() -> float |
| evaluations | evaluations() -> int |
| extend | extend(string) -> RootFinder |
| f_root | f_root() -> float |
| init_it | init_it() -> int |
| iter | iter() -> int |
| maxiter | maxiter(int) -> RootFinder |
| next | next() -> bool |
| root | root() -> float |
| tell | tell(float) -> void |
| tol | tol(float) -> RootFinder |
| x | x() -> float |
SmoothSpline
| Method | Signatures |
|---|---|
| at | at(float) -> float |
| cv_crit | cv_crit() -> float |
| deriv | deriv(float, int) -> float |
| df | df() -> float |
| eval | eval(Vec) -> Vec |
| lambda | lambda() -> float |
| leverages | leverages() -> Vec |
| pen_crit | pen_crit() -> float |
| x | x() -> Vec |
| y | y() -> Vec |
Spline
| Method | Signatures |
|---|---|
| at | at(float) -> float |
| deriv | deriv(float, int) -> float |
| eval | eval(Vec) -> Vec |
| method | method() -> string |
Stl
| Method | Signatures |
|---|---|
| remainder | remainder() -> Vec |
| seasonal | seasonal() -> Vec |
| trend | trend() -> Vec |
| weights | weights() -> Vec |
StrList
| Method | Signatures |
|---|---|
| add | add(string) -> StrList |
| clear | clear() -> StrList |
| index_of | index_of(string) -> int |
| set | set(int, string) -> StrList |
StrMap
| Method | Signatures |
|---|---|
| clear | clear() -> StrMap |
| get | get(string) -> string |
| get_or | get_or(string, string) -> string |
| has | has(string) -> bool |
| key_at | key_at(int) -> string |
| keys | keys() -> StrList |
| len | len() -> int |
| remove | remove(string) -> bool |
| set | set(string, string) -> StrMap |
| values | values() -> StrList |
StrPQ
| Method | Signatures |
|---|---|
| clear | clear() -> StrPQ |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> string |
| pop | pop() -> string |
| push | push(string, float) -> StrPQ |
StrQueue
| Method | Signatures |
|---|---|
| at | at(int) -> string |
| clear | clear() -> StrQueue |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> string |
| pop | pop() -> string |
| push | push(string) -> StrQueue |
StrStack
| Method | Signatures |
|---|---|
| at | at(int) -> string |
| clear | clear() -> StrStack |
| empty | empty() -> bool |
| len | len() -> int |
| peek | peek() -> string |
| pop | pop() -> string |
| push | push(string) -> StrStack |
Svd
| Method | Signatures |
|---|---|
| d | d() -> Vec |
| u | u() -> Mat |
| v | v() -> Mat |
Test
| Method | Signatures |
|---|---|
| alt | alt(string) -> Test |
| blocks | blocks(StrList) -> Test; blocks(Vec) -> Test |
| conf | conf(float) -> Test |
| conf_int | conf_int(bool) -> Test |
| correct | correct(bool) -> Test |
| counts | counts(Vec) -> Test |
| dist | dist(Dist) -> Test |
| exact | exact(bool) -> Test |
| groups | groups(StrList) -> Test; groups(Vec) -> Test |
| method | method(string) -> Test |
| mu | mu(float) -> Test |
| odds_ratio | odds_ratio(float) -> Test |
| p | p(Vec) -> Test; p(float) -> Test |
| paired | paired(bool) -> Test |
| probs | probs(Vec) -> Test |
| ratio | ratio(float) -> Test |
| run | run() -> Htest |
| successes | successes(Vec) -> Test; successes(float) -> Test |
| table | table(Vec, int, bool) -> Test |
| trials | trials(Vec) -> Test; trials(float) -> Test |
| var_equal | var_equal(bool) -> Test |
| x | x(Vec) -> Test |
| y | y(Vec) -> Test |
Vec
Operators: * (mul), + (add), - (sub), neg (neg), r* (mul), r+ (add), r- (rsub).
| Method | Signatures |
|---|---|
| abs | abs() -> Vec |
| acf | acf() -> Vec; acf(int) -> Vec |
| add | add(Vec) -> Vec; add(float) -> Vec |
| append | append(Vec) -> Vec |
| at | at(int) -> float |
| copy | copy() -> Vec |
| cor | cor(Vec) -> float; cor(Vec, string) -> float |
| count_nan | count_nan() -> int |
| cov | cov(Vec) -> float |
| cumsum | cumsum() -> Vec |
| diff | diff() -> Vec; diff(int) -> Vec |
| div | div(Vec) -> Vec; div(float) -> Vec |
| dot | dot(Vec) -> float |
| drop_nan | drop_nan() -> Vec |
| exp | exp() -> Vec |
| format | format(string, string) -> string |
| head | head(int) -> Vec |
| len | len() -> int |
| log | log() -> Vec |
| mad | mad() -> float |
| max | max() -> float |
| mean | mean() -> float |
| median | median() -> float |
| min | min() -> float |
| mul | mul(Vec) -> Vec; mul(float) -> Vec |
| neg | neg() -> Vec |
| order | order() -> Vec |
| pacf | pacf() -> Vec; pacf(int) -> Vec |
| pow | pow(float) -> Vec |
| prod | prod() -> float |
| push | push(float) -> Vec |
| quantile | quantile(float) -> float; quantile(float, int) -> float |
| quantiles | quantiles(Vec, int) -> Vec |
| rank | rank() -> Vec |
| rdiv | rdiv(float) -> Vec |
| rev | rev() -> Vec |
| round | round(int) -> Vec |
| rsub | rsub(float) -> Vec |
| sd | sd() -> float |
| set | set(int, float) -> Vec |
| slice | slice(int, int) -> Vec |
| sort | sort() -> Vec |
| sqrt | sqrt() -> Vec |
| standardize | standardize() -> Vec |
| str | str() -> string |
| sub | sub(Vec) -> Vec; sub(float) -> Vec |
| sum | sum() -> float |
| tail | tail(int) -> Vec |
| take | take(Vec) -> Vec |
| var | var() -> float |
| where | where(Vec) -> Vec |
| which_max | which_max() -> int |
| which_min | which_min() -> int |
Standard library (lmcode_std_v3)
The lmcode-cpp SDK pinned in native/sdk.lock vendors the lmcode_std_v3 schema with 206 canonical signatures: 83 function signatures and 123 method signatures across 16 types. They are available in every lmr block without appearing in the host schema. The current lmcode_std_v3 catalog upstream has 226 signatures; lmr picks up the additional 20 when it syncs its SDK pin and releases.
Standard functions
| Function | Signatures |
|---|---|
| file_append | file_append(string, string) -> void |
| file_exists | file_exists(string) -> bool |
| file_lines | file_lines(string) -> StrList |
| file_read | file_read(string) -> string |
| file_write | file_write(string, string) -> void |
| float_list | float_list() -> FloatList |
| float_map | float_map() -> FloatMap |
| float_pq | float_pq() -> FloatPQ |
| float_queue | float_queue() -> FloatQueue |
| float_stack | float_stack() -> FloatStack |
| int_list | int_list() -> IntList |
| int_map | int_map() -> IntMap |
| int_pq | int_pq() -> IntPQ |
| int_queue | int_queue() -> IntQueue |
| int_stack | int_stack() -> IntStack |
| json_parse | json_parse(string) -> Json |
| lmcode_return_null | lmcode_return_null() -> void |
| lmcode_return_put | lmcode_return_put(string, bool) -> void; lmcode_return_put(string, float) -> void; lmcode_return_put(string, FloatList) -> void; lmcode_return_put(string, FloatMap) -> void; lmcode_return_put(string, int) -> void; lmcode_return_put(string, IntList) -> void; lmcode_return_put(string, IntMap) -> void; lmcode_return_put(string, Json) -> void; lmcode_return_put(string, StrList) -> void; lmcode_return_put(string, StrMap) -> void; lmcode_return_put(string, string) -> void |
| lmcode_return_put_null | lmcode_return_put_null(string) -> void |
| lmcode_return_set | lmcode_return_set(bool) -> void; lmcode_return_set(float) -> void; lmcode_return_set(FloatList) -> void; lmcode_return_set(FloatMap) -> void; lmcode_return_set(int) -> void; lmcode_return_set(IntList) -> void; lmcode_return_set(IntMap) -> void; lmcode_return_set(Json) -> void; lmcode_return_set(StrList) -> void; lmcode_return_set(StrMap) -> void; lmcode_return_set(string) -> void |
| math_abs | math_abs(int) -> int; math_abs(float) -> float |
| math_ceil | math_ceil(int) -> int; math_ceil(float) -> float |
| math_floor | math_floor(int) -> int; math_floor(float) -> float |
| math_max | math_max(int, int) -> int; math_max(float, float) -> float |
| math_min | math_min(int, int) -> int; math_min(float, float) -> float |
| math_pow | math_pow(int, int) -> int; math_pow(float, float) -> float |
| math_round | math_round(int) -> int; math_round(float) -> float |
| math_sqrt | math_sqrt(int) -> int; math_sqrt(float) -> float |
| str_base64_decode | str_base64_decode(string) -> string |
| str_base64_encode | str_base64_encode(string) -> string |
| str_contains | str_contains(string, string) -> bool |
| str_ends_with | str_ends_with(string, string) -> bool |
| str_find | str_find(string, string) -> int |
| str_hex_decode | str_hex_decode(string) -> string |
| str_hex_encode | str_hex_encode(string) -> string |
| str_is_float | str_is_float(string) -> bool |
| str_is_int | str_is_int(string) -> bool |
| str_len | str_len(string) -> int |
| str_list | str_list() -> StrList |
| str_lower | str_lower(string) -> string |
| str_map | str_map() -> StrMap |
| str_match | str_match(string, string) -> bool |
| str_pq | str_pq() -> StrPQ |
| str_queue | str_queue() -> StrQueue |
| str_repeat | str_repeat(string, int) -> string |
| str_replace | str_replace(string, string, string) -> string |
| str_split | str_split(string, string) -> StrList |
| str_stack | str_stack() -> StrStack |
| str_starts_with | str_starts_with(string, string) -> bool |
| str_substr | str_substr(string, int, int) -> string |
| str_to_float | str_to_float(string) -> float |
| str_to_int | str_to_int(string) -> int |
| str_trim | str_trim(string) -> string |
| str_upper | str_upper(string) -> string |
| template_render | template_render(string, Json) -> string |
Standard types
| Type | Methods |
|---|---|
| FloatList | add(float) -> FloatList; at(int) -> float; clear() -> FloatList; contains(float) -> bool; index_of(float) -> int; len() -> int; set(int, float) -> FloatList |
| FloatMap | clear() -> FloatMap; get(string) -> float; get_or(string, float) -> float; has(string) -> bool; key_at(int) -> string; keys() -> StrList; len() -> int; remove(string) -> bool; set(string, float) -> FloatMap; values() -> FloatList |
| FloatPQ | clear() -> FloatPQ; empty() -> bool; len() -> int; peek() -> float; pop() -> float; push(float, float) -> FloatPQ |
| FloatQueue | at(int) -> float; clear() -> FloatQueue; empty() -> bool; len() -> int; peek() -> float; pop() -> float; push(float) -> FloatQueue |
| FloatStack | at(int) -> float; clear() -> FloatStack; empty() -> bool; len() -> int; peek() -> float; pop() -> float; push(float) -> FloatStack |
| IntList | add(int) -> IntList; at(int) -> int; clear() -> IntList; contains(int) -> bool; index_of(int) -> int; len() -> int; set(int, int) -> IntList |
| IntMap | clear() -> IntMap; get(string) -> int; get_or(string, int) -> int; has(string) -> bool; key_at(int) -> string; keys() -> StrList; len() -> int; remove(string) -> bool; set(string, int) -> IntMap; values() -> IntList |
| IntPQ | clear() -> IntPQ; empty() -> bool; len() -> int; peek() -> int; pop() -> int; push(int, float) -> IntPQ |
| IntQueue | at(int) -> int; clear() -> IntQueue; empty() -> bool; len() -> int; peek() -> int; pop() -> int; push(int) -> IntQueue |
| IntStack | at(int) -> int; clear() -> IntStack; empty() -> bool; len() -> int; peek() -> int; pop() -> int; push(int) -> IntStack |
| Json | as_bool() -> bool; as_float() -> float; as_int() -> int; as_string() -> string; at(int) -> Json; get(string) -> Json; has(string) -> bool; keys() -> StrList; kind() -> string; len() -> int; to_json() -> string |
| StrList | add(string) -> StrList; at(int) -> string; clear() -> StrList; contains(string) -> bool; index_of(string) -> int; join(string) -> string; len() -> int; set(int, string) -> StrList |
| StrMap | clear() -> StrMap; get(string) -> string; get_or(string, string) -> string; has(string) -> bool; key_at(int) -> string; keys() -> StrList; len() -> int; remove(string) -> bool; set(string, string) -> StrMap; values() -> StrList |
| StrPQ | clear() -> StrPQ; empty() -> bool; len() -> int; peek() -> string; pop() -> string; push(string, float) -> StrPQ |
| StrQueue | at(int) -> string; clear() -> StrQueue; empty() -> bool; len() -> int; peek() -> string; pop() -> string; push(string) -> StrQueue |
| StrStack | at(int) -> string; clear() -> StrStack; empty() -> bool; len() -> int; peek() -> string; pop() -> string; push(string) -> StrStack |
Standard REST and CLI interfaces
These do not apply to lmr today. The std schema vendored in this repository contains no rest_ functions and none of the RestGet, RestPost, RestPut, RestDelete, RestPatch, RestHead, RestOptions, RestHandler, CliCommand or CliOption interfaces. They belong to the 226-signature lmcode_std_v3 catalog (rest_config, rest_route, rest_serve, rest_stop, rest_cli and the RestExchange methods) and become available to lmr blocks only after lmr updates its SDK pin and ships a release with it. Confirm with lmr --lmcode-signatures on the binary you run.