Liking cljdoc? Tell your friends :D

quandary.impl


$clj

($ varname-or-map suffix)

Constructs a variable name from varname-or-map and suffix. When varname-or-map is a map, uses its ::q/var-name-prefix as the base. Equivalent to (mk-qvar varname-or-map suffix).

Constructs a variable name from `varname-or-map` and `suffix`.
When `varname-or-map` is a map, uses its `::q/var-name-prefix` as the base.
Equivalent to `(mk-qvar varname-or-map suffix)`.
raw docstring

$#clj

($# varname-or-map suffix)

Like $, but produces a TEMP.-prefixed variable name that is stripped from solver results. Use for intermediate variables that should not appear in the final solution map.

Like `$`, but produces a `TEMP.`-prefixed variable name that is stripped from solver results.
Use for intermediate variables that should not appear in the final solution map.
raw docstring

ARITHMETIC_OPERATORSclj


dqsl-process-bodyclj

(dqsl-process-body env? body)

Walks the body forms of a qdsl macro call. Maps become domain entries; vectors become equation entries. Variable names are resolved: $-prefixed symbols are expanded via mk-qvar; other symbols are kept as eval-time expressions if resolvable or in env?.

Walks the `body` forms of a `qdsl` macro call. Maps become domain entries; vectors become
equation entries. Variable names are resolved: `$`-prefixed symbols are expanded via
`mk-qvar`; other symbols are kept as eval-time expressions if resolvable or in `env?`.
raw docstring

flatten-to-polynomialclj

(flatten-to-polynomial expr)

Flatten or convert a s-expression (or additions and multiplications) to a vector-based polynomial. Example Usage: (flatten-to-polynomial '(* (+ a b) (+ a b))) => [[1 "a" "a"] [2 "a" "b"] [1 "b" "b"]]

Flatten or convert a s-expression (or additions and multiplications)
to a vector-based polynomial.
Example Usage:
(flatten-to-polynomial '(* (+ a b) (+ a b)))
=> [[1 "a" "a"] [2 "a" "b"] [1 "b" "b"]]
raw docstring

min-max-domainclj

(min-max-domain domain-spec)

Returns [min max] for a domain spec. Handles :boolean[0 1], [:range lo hi][lo hi], and enumerated value vectors → [min max].

Returns `[min max]` for a domain spec. Handles `:boolean` → `[0 1]`,
`[:range lo hi]` → `[lo hi]`, and enumerated value vectors → `[min max]`.
raw docstring

mk-qvarclj

(mk-qvar o suffix)
(mk-qvar o suffix temp?)

Constructs a fully-qualified variable name string from o (a string prefix or a map with ::q/var-name-prefix) and a suffix. Pass :temp as the third arg to produce a TEMP.-prefixed name, which the solver strips from results.

Constructs a fully-qualified variable name string from `o` (a string prefix or a map
with `::q/var-name-prefix`) and a `suffix`. Pass `:temp` as the third arg to produce a
`TEMP.`-prefixed name, which the solver strips from results.
raw docstring

parse-var-nameclj

(parse-var-name s)

Parses a DSL variable name string, returning a map of: :full-name, :varname (last segment), and optionally :dollar? (prefixed with $), :dollar-hash? (prefixed with $#), :prefix0 (first dot-segment), :suffix (remaining dot-segments joined). Returns nil if s is nil or does not match the expected pattern.

Parses a DSL variable name string, returning a map of:
`:full-name`, `:varname` (last segment), and optionally
`:dollar?` (prefixed with `$`), `:dollar-hash?` (prefixed with `$#`),
`:prefix0` (first dot-segment), `:suffix` (remaining dot-segments joined).
Returns nil if `s` is nil or does not match the expected pattern.
raw docstring

qdsl-internalclj

(qdsl-internal {:keys [tap-entries initial-context] :as options} entries)

Transforms a sequence of DSL entries (domain maps + equation vectors) into a single collated {:domain … :equations …} map, expanding arithmetic s-expressions into the internal polynomial term format. Called by the qdsl macro after macro-expansion.

Transforms a sequence of DSL entries (domain maps + equation vectors) into a single
collated `{:domain … :equations …}` map, expanding arithmetic s-expressions into the
internal polynomial term format. Called by the `qdsl` macro after macro-expansion.
raw docstring

read-all-edn-objects-from-fileclj

(read-all-edn-objects-from-file path)

Reads all EDN objects from the classpath resource at path, returning them as a vector.

Reads all EDN objects from the classpath resource at `path`, returning them as a vector.
raw docstring

remove-coeffcient-of-oneclj

(remove-coeffcient-of-one polynomial)

Removes a leading coefficient of 1 from polynomial terms where there is at least one variable (e.g. [1 "x"]["x"]). Constant-only terms like [5] are left unchanged.

Removes a leading coefficient of 1 from polynomial terms where there is at least one
variable (e.g. `[1 "x"]` → `["x"]`). Constant-only terms like `[5]` are left unchanged.
raw docstring

temp-int-varclj

(temp-int-var {:keys [domain] :as context} v1 v2 txt)

Returns a single-entry domain map {varname [:range t-min t-max]} for a new TEMP variable whose range spans all possible products of the domains of v1 and v2 in context.

Returns a single-entry domain map `{varname [:range t-min t-max]}` for a new TEMP variable
whose range spans all possible products of the domains of `v1` and `v2` in `context`.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close