Skip to content

Instantly share code, notes, and snippets.

@rhz
Created March 15, 2011 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhz/871248 to your computer and use it in GitHub Desktop.
Save rhz/871248 to your computer and use it in GitHub Desktop.
(defn get-molecule [state mol]
(get-in state [:mixture mol] 0))
(defn get-activities [state] ;; FIXME this fn takes upto 80% of the time
(into {} (for [{:keys [lhs rate] :as r} (:rxns state)]
[r (apply * rate (for [[mol freq] lhs]
(* (get-molecule state mol) freq)))])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment