Table of Contents
A file showing off some Org Mode and ESS features
Preamble
Tips for using this document
If you are looking at this on the web, and I hope you find it useful. But, a useful method of using this file to learn is to download the plain text .org file, open it in Emacs, and explore it, editing and/or evaluating the various blocks provided, seeing what they do, changing things, trying again, how did it change – all those pedagogical techniques. (If you somehow mess up, you can always download the file again!)
The structure of this document was originally designed to (and may still) parallel that of the short beamer presentation from the same project. There are pointers to other presentations and tutorials under below. In particular, you may find the Org Mode Quick Start guide, as well as a tutorial by Erik Iverson, org-mode-R-tutorial.org, and a more recent one from Vikas Rawal, orgpapers.org, useful.
Some notation
A string inside square brackets,
[abecde]
, means you, the user, should type the string, leaving out the square brackets.Also, the Emacs convention for control and modifier (alt) keys is used. So,
[C-x b]
means typecontrol x
, then the letterb
. And,[M-x b]
would mean typemodifier x
(maybe better known as 'alt x'), then the letterb
(almost certainly an error!).
Contents
Here's a brief map. After a brief introduction to Org Mode, we discuss
- the basics of source blocks, in which code is embedded;
- how to evaluate a source block (to produce results);
- how to export a .org file, including the code of source blocks and/or the results of evaluating them;
- how to extract source blocks from the .org file and write them to a file (a process known as tangling);
- the two options for editing source blocks;
- some of the header arguments that can be used; and, finally
- pointers to more information
Introduction to Org Mode
Emacs (wikipedia) Org Mode 1 sometimes exhorts one to do something like "Organize Your Life In Plain Text!"; the Org Mode manual, on the other hand, starts off by saying, "Org is an outliner". The philosophy of Org Mode (indeed, of Emacs, and maybe, to some extent, of any of the *nix operating systems) is that using non-proprietary file formats and software provides the most "liberating" and "horizon-free" way of taking advantage of modern information technology. And, to some extent, that a mostly-command line interface, rather than a graphical user interface, is also "the way to go".
I think Org Mode started off as a way of simplifying the creation of formatted documents, with tables, etc., for taking notes, creating agendas (items with date elements), and evolved into a much larger system of utilities for, for example, converting ("exporting", in org mode parlance) between the Org Mode syntax to .html, .pdf, etc., documents, with good support for doing mathematical (LaTeX) formatting.
Org Mode does a good job exporting to LaTeX, html. (Some people primarily use Org Mode as a more "user friendly" interface to LaTeX, though for serious documents, in the final analysis they probably spend a lot of time tweaking LaTeX, and org-to-LaTeX, configuration.)
Though I have used Org Mode for more than a decade, I know very little of most of its capabilities, as I mostly use it to centralize the source code within a project, as well as to produce the random document, especially documents with embedded code segments (known, in Org Mode, as "source blocks").
Org Mode is bundled into the main Emacs distribution, but a
more-than-casual user might like to use the more-than-likely
up-to-date package available via melpa ([M-x package-list-packages]
,
and regexp-search for /^..org /).
Babel is one name for talking about programming language support in Org Mode. You are able to embed source code inside of Org Mode buffers, edit these code blocks in a language-specific way, evaluate code blocks, pass the results of the evaulation of one code block to another code block, and include code blocks and/or the results of their evaulation in the document produced by exporting the org buffer. The rest of this document is dedicated to explaining these things.
Blocks of various sizes, shapes, colors
Various sorts of "blocks" are supported in Org Mode files. These
start with #+begin_...
, and end with a corresponding #+end_...
,
where the ...
are something like src
, example
, quote
. A
skeleton for some of these can conveniently be created with the
command [M-x org-insert-structure-template]
([C-c C-,]
), and
entering the type of block you are interested in creating, e.g.,
e
for an example block (line wrapping does not apply) (#+begin_example
)q
for a quote block (line wrapping applies) (#+begin_quote
)s
for a source block (#+begin_src
)
there are various other blocks; you can experiment by typing
[M-x org-insert-structure-template]
([C-c C-,]
) and then one of
the following
a
c
C
E
h
l
v
and seeing what you get, looking in the manual for enlightenment. (Of
course, one can always search the manual for #[+]begin_
.)
In addition to the source blocks mentioned above (and elaborated on below), Org Mode allows short bits of "verbatim" code to be introduced by a colon as the first non-blank column of a line
: this is verbatim
One can have longer runs of verbatim ("example") data (which is not word wrapped, etc.:
#+begin_example this is a block that holds more verbatim text #+end_example
As well as longer bits of text that will be wrapped ("quote"):
#+begin_quote this is a bit of text that should show up, eventually, strung out in a smaller number of lines when "filled" (e.g., [M-x org-fill-paragraph] ([M-q])) #+end_quote
Blocks can optionally have names. These names can be used as :noweb
references, or to use the value of a block (or, if a source block, of
the block's results) as input (a :var
) to another block in the
file.2
Drawers, Properties, Property Drawers
Org Mode drawers are a way of "closing away" information you normally
won't want to see. These start with a line :NAME:
, where NAME
is
a string, and end with a simple(r) :end:
.
A property allows you to associate values with keys. Of particular interest to us here are property drawers, which combine the two concepts to provide a place to put parameters that customize the environment in which Org Mode processes your file (and, in particular, for our case, the context in which source code is evaluated).
Source blocks
Source blocks are lines of text, surrounded by a #+begin_src
line
before the beginning and a #+end_src
line after the end of the code.
Source blocks can be named by a #+name
line which appears
immediately before the #+begin_src
line.
Source blocks can also have various header arguments that modify the context in which the source block executes.
(As mentioned above, a source block skeleton can be created by typing
[M-x org-insert-structure-template]
([C-c C-,]
) and entering
[=s=].)
Inline source blocks
Source blocks can also be expressed using a =src_LANG= construct; a =#+name:= line can be used to name the =src_LANG= block. for example, src_R{"hello, world"} {{{results(=hello\, world=)}}}.
Inline source blocks have their own syntax for header arguments: src_R[:results output]{cat("hello, again")} {{{results(=hello\, again=)}}}.
And, the results of an inline source block can be used as input (via :var) to another source block.
{{{results(=42=)}}}src_R{"42"}
#+begin_src R :var x=whyo :exports results x #+end_src | 42 | | |
Evaluating source blocks
In order to enable evaluation of source blocks of R code, you will
need to evaluate the following source block. (Emacs lisp is the only
language whose evaluation is enabled by default.) To do this,
position your cursor inside the source block (or on the #+begin_src
or #+end_src
line), and type [M-x org-babel-execute-src-block]
([C-c C-c]
) (not the square brackets; just what is inside).
Additionally, evaluating code in a file can be a security risk, so you
will be prompted to make sure you want to execute the code.
#+begin_src elisp :results none (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (R . t) (python . t))) #+end_src
(Here, I named the source block mainly so that the confirmation message can provide you the name of the block for which it is asking permission to evaluate.)
You can also enable evaluation in an R source code block by
customizing the variable org-babel-load-languages
, via [M-x
customize-variable]
, or [M-S-:(customize-variable
'org-babel-load-languages)]
and enable R (something like "Ins",
"Value Menu", "R", "State"),
Once enabled, an R source block, for example, can be evaluated using
the same command, [M-x org-babel-execute-src-block]
([C-c C-c]
)
(with point inside the source block):
#+begin_src R :results output cat("this block has been evaluated\n") #+end_src : this block has been evaluated
Evaluation via a call
statement
Source blocks can also be evaluated by call
statements in the .org
file. Call statements have two forms, somewhat similar to the two
forms of source blocks.
First, a #+call
line can trigger evaluation of a source block. To
trigger the triggering, you will need to type
[M-x org-babel-execute-src-block]
([C-c C-c]
) with point
positioned on the call line.
: this block has been evaluated
Similarly, there is an inline call statement form which can trigger evaluation of a source block. here it is, inline! call_first-r-block() {{{results(=this block has been evaluated=)}}}.
inline call statements have a syntax for block-specific header arguments similar to that of inline source blocks.
Exporting source blocks
Source blocks are, optionally, exported – to a .html or .pdf file, say – along with some of the rest of a .org file.
To start the export process, one types executes the command
M-x org-export-dispatch
([C-c C-e]
). Org mode then pops up a
window that allows you to customize your export. At the top of this
window are mostly options for defining the scope of the export. For
example, if you then type [C-s]
, only the subtree in which the
export is initialized will be exported.
Then, one can choose the type of export: Org, Html, Latex (including PDF), Markdown, or Plain Text.
(The top and the lower parts talk about publishing, which
accomplishes exporting in a slightly heavier way, requiring the
parameters to be pre-set in the org-publish-project-alist
variable.
We won't discuss publishing here – you can read about it in the Org
Mode manual – but it is, in fact, the way the .html and .pdf files
associated with this tutorial have been produced.)
The following code is based on a question to the R-help e-mail list. The goal was a simple way to find the peaks and valleys (highest and lowest values) in a vector of numbers.
#+begin_src R :exports both x <- c(1,0,0,0,2,2,3,4,0,1,1,0,5,5,5,0,1) (cumsum(rle(x)$lengths)-(rle(x)$length-1))[which(diff(diff(rle(x)$values)>=0)<0)+1] cumsum(rle(x)$lengths)[which(diff(diff(rle(x)$value)>0)>0)+1] #+end_src | 4 | | 9 | | 12 | | 16 |
If you type M-x org-export-dispatch
([C-c C-e]
), then [C-s] (for
"subtree"), then [h] (for "html"), and [o] (for "open"), then,
assuming your Emacs is configured to know how to open a .html file in
a browser (90% likely, I'd guess), you'll see the text in this
subtree, the above code, and the indices of the valleys (the last
result).
The :exports both
is a header argument that tells Org Mode to export
both the source code itself, as well as the results of its evaluation
(you will be prompted to authorize the evaluation). One could also
say one of: :exports none
, :exports code
, or :exports results
.
Tangling code
Tangling is a term the literate programming world uses to mean
extracting the source code from a "literate" document in a way that
the code can then be compiled and/or executed. In Org Mode files, the
:tangle
header argument defines the filename to which a source block
should be written. Like all header arguments, the :tangle
header
argument can be specified at the file, subtree, or individual source
block level. All source blocks that have (or inherit) the same
:tangle
header argument will be tangled to the same file, in the
order in which they appear in the .org file.
Repeating a source block from above (using :noweb
syntax),
#+begin_src R :exports both :tangle peaks-and-valleys.el :noweb yes <<peaks-and-valleys>> #+end_src | 4 | | 9 | | 12 | | 16 |
Now, you could, if you chose, enter [M-x org-babel-tangle]
([C-c C-v t]
). But, be warned! This will tangle all the source
blocks in the current (this) .org file that have a :tangle
header
argument (specified or inherited). One can restrict the tangle
operation to the source block at point (see [M-x describe-function]
([C-h f]
) for org-babel-tangle
for details), but even so, I would
suggest being careful.
Editing a source block
The source block is just a number of text lines in text file. So, it is very normal to do minor edits in line, in the .org file. A certain amount of code highlighting (fontification, I guess, in Emacs parlance) is provided when editing source blocks inline.
On the other hand, by positioning the cursor on the source block and
executing [M-x org-edit-src-code]
([C-c ']
), one can "pop out" the
source block and edit it in a buffer with the major mode set
appropriately for the language of the source block. In the case of an
R source block, the major mode will (the R-flavor of) ESS, ESS[R]
.
To enabling editing R code (if you get an error message No such language mode: R-mode), you may need to evaluate the following code:
#+begin_src elisp :results none (require 'ess-r-mode) #+end_src
Feel free to experiment with the following code. On the R-help list,
a new value for the vector x
was proposed.
x <- c(1,1,1,2,2,3,4,4,4,5,6,6,6)
If you like, edit the source, change x
, and evaluate it. What is
its result? Is there a peak? A valley? 3
#+begin_src R x <- c(1,0,0,0,2,2,3,4,0,1,1,0,5,5,5,0,1) (cumsum(rle(x)$lengths)-(rle(x)$length-1))[which(diff(diff(rle(x)$values)>=0)<0)+1] cumsum(rle(x)$lengths)[which(diff(diff(rle(x)$value)>0)>0)+1] #+end_src | 4 | | 9 | | 12 | | 16 |
When editing, the "OrgSrc" minor mode is enabled. This mode provides binding for
[M-x org-edit-src-save]
([C-x C-s]
)- to save the source edit back to the main .org buffer
[M-x org-edit-src-abort]
([C-c C-k]
)- to abort the current editing, discarding any unsaved changes
[M-x org-edit-src-exit]
([C-c ']
)- to save any unsaved changes back to the .org buffer and close the source edit buffer
NB: If you are editing a block that has :noweb references,
the references will not be expanded when passing the block (in part
or in whole) to a running iESS instance (via, e.g.,
[M-x org-babel-execute-src-block]
([C-c C-c]
) or
[M-x ess-eval-buffer]
([C-c C-b]
)). And, in fact, the R
interpreter will likely flag a syntax error should you try to do so.
Header arguments
Header arguments modify the execution context in which Org Mode source blocks are evaluated and/or in which the results of those evaluations are processed.
Header arguments can be specified on, and apply to
- a
#+property: header-args
line, to apply as defaults for all source blocks in a file - inside a
:PROPERTIES:
drawer of a headline (node in the tree defined by the .org file), to apply as defaults for all source blocks in that subtree - the
#+begin_src
line that precedes the source block - separate
#+header
line(s), immediately preceding the#+begin_src
line.
Here is an example from a .org file that shows those ways of defining
various header arguments. The #+header-args+
construct adds these
arguments to the list of header args.
** this is somewhere in this file :PROPERTIES: :header-args+: :tangle very/important/code.R :END: now, code blocks will carry that name #+begin_src R :results value x <- "we want some code, and we want it now!" #+end_src
The following are some of the header arguments I most often use.
:colnames and :rownames
When processing a table result of a previous source block to be used
as an input variable to another code block, the :colnames
header
argument instructs Org Mode how to interpret the first row: should it
be assumed to be a row of column names, a row of data, or should Org
Mode use a heuristic to make that determination.
Similarly, Org Mode uses :rownames
to determine whether the first
column of each row should be considered as a name for that row, or
simply as the data of the first column of that row.
Also, when processing the results of a code block, these header
arguments tell some Org Mode language support routines how to deal
with column and row names of the returned result. If left off, the
Org Mode result of evaluation will drop any language-specific column
and row names. However, if these header arguments are set to yes
,
language-specific column and row names will be included in the results
placed in the Org Mode buffer.
#+BEGIN_SRC R mtcars[1:3,] #+END_SRC | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | 21 | 6 | 160 | 110 | 3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 | | 22.8 | 4 | 108 | 93 | 3.85 | 2.32 | 18.61 | 1 | 1 | 4 | 1 |
#+begin_src R :colnames yes :rownames yes mtcars[1:3,] #+end_src | | mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | |---------------+------+-----+------+-----+------+-------+-------+----+----+------+------| | Mazda RX4 | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | Mazda RX4 Wag | 21 | 6 | 160 | 110 | 3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 | | Datsun 710 | 22.8 | 4 | 108 | 93 | 3.85 | 2.32 | 18.61 | 1 | 1 | 4 | 1 |
:noweb
Many (most?) programming languages have a way of "including" the
"textual" contents of one source file in the compilation or execution
phase of another source file. I think of #include <stdio.h
, for
example, in C
. Literate programming defines a way of doing this
known as "noweb".
In Org Mode's implementation, inside a source block, a reference to
a previous block of code named NAME
is denoted by <<NAME>>
. The
double angle brackets signal that this is a noweb
reference.4
However, by default, noweb processing is disabled in an Org Mode
buffer. The :noweb
header argument defaults to no
, but can be set
to yes
to enable noweb processing. Again, as with all header
arguments, this can be done on a per-file, per-subtree, or
per-(referring-)source block basis.
The noweb reference <<NAME>>
can refer to either the name of another
source block in the .org file:
#+begin_src R :noweb no cm <- "copy me!" #+end_src : copy me!
or with the :noweb-ref
header argument:
#+begin_src R :noweb-ref another-noweb-name :noweb no cmt <- "copy me, too!" #+end_src : copy me, too!
#+begin_src R :noweb yes :results output <<a-noweb-name>> <<another-noweb-name>> cat(cm, "\n", cmt, "\n", sep="") #+end_src : copy me! : copy me, too!
(If you edit the header of the previous source block by changing "yes"
to "no" and then evaluate it, you will get an error as R tries to
parse a line that begins with <<
.)
Note that, like the :noweb
header argument, the :noweb-ref
header
argument can be set on a subtree basis. (I dread to think of what
would happen were it to be set on a file basis. Okay, I have to try.
Be right back… Not much happened. I suppose this is
special-cased.)
:var
In Org Mode, the evaluation of source blocks can include initializing
variables, using the :var
header argument.
#+begin_src R :var pi=3.14 pi #+end_src : 3.14
The left hand side of the argument to :var
is the name of the
variable as seen by the code inside the source block. The right hand
side can be a constant (as above), or can designate the output of
another source block in the .org file. In that case, the right hand
side is the name (#+name:
) of the source block providing the desired
result.
If you evaluate the following source block, you will be asked to allow evaluation twice: once to produce the result from the above source block, and a second time to produce the result from the source block you are evaluating.
#+begin_src R :var pitoo=gives-pi :session R :results output cat("you were", pitoo/pi, "close!\n") #+end_src : you were 0.999493 close!
The language of the source block providing the value of the variable does same as the language of the source block receiving the value. In general, though, there may be some adaptation required to mould the shape of the input value to that needed by the source code.
#+begin_src python :results value return 21 #+end_src : 21
#+begin_src R :var howmany=from-python 2*howmany #+end_src : 42
The name on the right hand side, instead of naming another source block in the file, can also name, e.g., an Org Mode table.
| student | first exam | second exam | final |
|---|---|---|---|
| Greg | 1 | 3 | 2 |
| George | 2 | 2 | 2 |
| Linda | 3 | 1 | 2 |
| Georgia | 4 | 4 | 4 |
In the following code block, the :colnames header argument is set to
yes
so that the first row is considered a row of column names.
#+begin_src R :var tbl=a-table :colnames yes :session R summary(tbl) #+end_src | student | first.exam | second.exam | final | |------------------+--------------+--------------+-------------| | Length:4 | Min. :1.00 | Min. :1.00 | Min. :2.0 | | Class :character | 1st Qu.:1.75 | 1st Qu.:1.75 | 1st Qu.:2.0 | | Mode :character | Median :2.50 | Median :2.50 | Median :2.0 | | nil | Mean :2.50 | Mean :2.50 | Mean :2.5 | | nil | 3rd Qu.:3.25 | 3rd Qu.:3.25 | 3rd Qu.:2.5 | | nil | Max. :4.00 | Max. :4.00 | Max. :4.0 |
For R code, a second effect of setting :colnames
to yes
is that if
the result is an R data frame, its column names (colnames()
) will
be preserved in the resulting Org Mode table
#+begin_src R :colnames yes mtcars[1:4,] #+end_src | mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | |------+-----+------+-----+------+-------+-------+----+----+------+------| | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | 21 | 6 | 160 | 110 | 3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 | | 22.8 | 4 | 108 | 93 | 3.85 | 2.32 | 18.61 | 1 | 1 | 4 | 1 | | 21.4 | 6 | 258 | 110 | 3.08 | 3.215 | 19.44 | 1 | 0 | 3 | 1 |
#+begin_src R :colnames no mtcars[1:4,] #+end_src | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | 21 | 6 | 160 | 110 | 3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 | | 22.8 | 4 | 108 | 93 | 3.85 | 2.32 | 18.61 | 1 | 1 | 4 | 1 | | 21.4 | 6 | 258 | 110 | 3.08 | 3.215 | 19.44 | 1 | 0 | 3 | 1 |
:results
The :results
header argument specifies many things. First, it
specifies whether the results of an evaluation consist in the value
"returned" by the evaluated source block, or by the output (to
standard output) produced by the source block. The "value returned"
means, in many programming languages (include R), the value of the
last statement executed in the source block. You may have noticed
examples of this use of :results
in some of the previous source
blocks. The values here are value
and output
.
#+begin_src R :results none truepi <- pi cat(truepi, "\n", sep="") invisible(truepi*2) #+end_src
#+begin_src R :results output <<usenowebhere>> #+end_src : 3.141593
#+begin_src R :results value <<usenowebhere>> #+end_src : 6.28318530717959
- Type of result
Here, the question is what sort of Org structure should the returned value be considered to consist. The results can be interpreted to be an Org Mode table, list, or verbatim text. Or, the results can be output to a file.
#+begin_src R mtcars[c(1,12,13, 19),] #+end_src | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | 16.4 | 8 | 275.8 | 180 | 3.07 | 4.07 | 17.4 | 0 | 0 | 3 | 3 | | 17.3 | 8 | 275.8 | 180 | 3.07 | 3.73 | 17.6 | 0 | 0 | 3 | 3 | | 30.4 | 4 | 75.7 | 52 | 4.93 | 1.615 | 18.52 | 1 | 1 | 4 | 2 |
If no result type is listed, Org Mode makes its pretty-good guess.
#+begin_src R :results value <<results-noweb>> #+end_src | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | 16.4 | 8 | 275.8 | 180 | 3.07 | 4.07 | 17.4 | 0 | 0 | 3 | 3 | | 17.3 | 8 | 275.8 | 180 | 3.07 | 3.73 | 17.6 | 0 | 0 | 3 | 3 | | 30.4 | 4 | 75.7 | 52 | 4.93 | 1.615 | 18.52 | 1 | 1 | 4 | 2 |
But, to be sure, you can specify the type you would like. (Note the reapearance of
:colnames
.)#+begin_src R :results value table :colnames yes <<results-noweb>> #+end_src | mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | |------+-----+-------+-----+------+-------+-------+----+----+------+------| | 21 | 6 | 160 | 110 | 3.9 | 2.62 | 16.46 | 0 | 1 | 4 | 4 | | 16.4 | 8 | 275.8 | 180 | 3.07 | 4.07 | 17.4 | 0 | 0 | 3 | 3 | | 17.3 | 8 | 275.8 | 180 | 3.07 | 3.73 | 17.6 | 0 | 0 | 3 | 3 | | 30.4 | 4 | 75.7 | 52 | 4.93 | 1.615 | 18.52 | 1 | 1 | 4 | 2 |
scalar
andverbatim
are synonyms. They cause the value to be taken, well, at face value:#+begin_src R :results scalar <<results-noweb>> #+end_src : 21 6 160 110 3.9 2.62 16.46 0 1 4 4 : 16.4 8 275.8 180 3.07 4.07 17.4 0 0 3 3 : 17.3 8 275.8 180 3.07 3.73 17.6 0 0 3 3 : 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2
And,
list
converts the source block result into an Org Mode list.#+begin_src R :results list <<results-noweb>> #+end_src - (21 6 160 110 3.9 2.62 16.46 0 1 4 4) - (16.4 8 275.8 180 3.07 4.07 17.4 0 0 3 3) - (17.3 8 275.8 180 3.07 3.73 17.6 0 0 3 3) - (30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2)
- How the results are formatted
There are various ways Org Mode might decide to format the results, of, more or less, whatever type, before embedding them in the .org buffer.
For example, to want the results to be wrapped in a source block, one can specify
code
:#+begin_src R :results value code "<<results-noweb>>" #+end_src
#+begin_src R mtcars[c(1,12,13, 19),] #+end_src
This also shows that
noweb
syntax isn't defeated by, e.g., being embedded inside quotation marks. One can also specify that the results be embedded in an Org Mode "drawer" (which can be "closed", so the results don't show), or embedded in a source block of type "org", in blocks whose content will only be used when exporting to HTML, or to LaTeX (including PDF), etc.There is (apparently – writing this tutorial is a learning experience!) also a
:wrap
header argument, separate from the:results
header argument, which specifies a valueX
, and the results are summarily wrapped in a#+begin_X...#+end_X
block.#+begin_src R :wrap foo 3 #+end_src #+begin_foo 3 #+end_foo
Here the code creates a graphic file (named by the
:file
header argument).#+begin_src R :file speed.png :results output file graphics :exports code ## from "?graphics::plot" Speed <- cars$speed Distance <- cars$dist plot(Speed, Distance, panel.first = grid(8, 8), pch = 0, cex = 1.2, col = "blue") plot(Speed, Distance, panel.first = lines(stats::lowess(Speed, Distance), lty = "dashed"), pch = 0, cex = 1.2, col = "blue") #+end_src
- Handling of results
Typically, the results of evaluating a source block are placed in the buffer following the source block, preceded by a line
#+RESULTS: <NAME>
where
<NAME>
is the name of the source block, if any, or blank.#+begin_src R Sys.time() #+end_src : 2021-04-15 09:40:03
#+begin_src R Sys.time() #+end_src : 2021-04-15 09:40:03
However, this behavior can be modified with the
:results
header argument. The relevant options are- silent
- Don't change the buffer. The results are echoed in the minibuffer.
- replace
- This is the normal behavior; the
#+RESULTS:
block is replaced. - append
- Each evaluation generates a separate
#+RESULTS:
block, which is placed after the previous result blocks. - prepend
- Each evaluation generates a separate results block, which is placed before all previous result blocks.
Well, really, that is all pretty much just copied from the manual. Which, see.
:session
Normally, when Org Mode evaluates a source block, in instantiates a
new process of the appropriate type (the R
command, for example),
provides that process with the source from the source block (expanding
:noweb
references), and lets it run.
This ensures that each run starts from a "clean state". On the other hand, it means that artefacts left behind by previous runs are not available to a future run in cases where that might be desirable. And, it can complicate debugging.
Thus, Org Mode provdies a :session
header argument which names a
buffer (that Org Mode will create, if it doesn't already exist) in
which evaluations of the current source block (or, all source blocks
in the file, or all in a subtree) will occur.
During a given Emacs instance, the first time you type
[M-x org-babel-execute-src-block]
([C-c C-c]
) in a source block
with a given :session
name, Emacs will prompt you for the name of
the starting directory (with a default being the directory of the
current file). It will then start up such a process, attach it to a
buffer (i'm not totally sure of the Emacs terminology here) with the
name provided as the argument to the :session
header argument (or,
use a language-specific default), and evaluate your code. This works
for interpreted languages but not, to my knowledge, for compiled
languages.
#+begin_src R :session R-session-name :exports code :eval never-export :results none x <- 1 #+end_src
#+begin_src R :session R-session-name :eval never-export :exports code x #+end_src
If you evaluate the above two blocks in order, the second will return
as a result the value of x
set by the first.
After evaluations, you can use [M-x switch-to-buffer]
([C-x b]
) to
switch to that buffer and inspect the state, maybe set debug
breakpoints, or debug after error or debug statement (browser()
,
say) in your code.
For R, the session buffer uses ESS[R]
mode. (As well as in the
OrgSrc minor mode.)
As I said above, the fact that future evaluations of the given source
block, or of any other source block with the same :session
argument,
will run in the same R process is both a feature and a bug. On the
bug side, you may end up developing code that only works with the
accumulated state in the current buffer.
For example, say you are developing an R package and are testing it
with some code that imports (require()
) that package.  Now, if
you once again evaluate your test code, it will execute the
require()
statement but will do nothing as, as far as R is
concerned, your package is already loaded. So, you will need to
detach and unload your package which, if my memory serves me right
detach(package:PACKAGENAME, unload=TRUE)
or some such. Then, R will load the new version of your package the
next time you or your code require's
it.
Still, I find :session
immensely valuable while developing code or
doing an analysis. If you find yourself wanting to use a debugger to
debug your code, or to incrementally build up state as your are
working, I recommend (carefully) using it.
:cache
Sometimes you will have a long-running computation, the results of
which are used as input to other computations, or for export. In this
case, you may not want to have to re-run the computation if its
results won't change. To help with this situation, Org Mode has the
:cache
header argument.
If a source block is marked with :cache yes
is scheduled to be
evaluated, Org Mode checks the following:
- the contents of the source block itself
- the header arguments to the source block
- the values of the sources of all the
:var
header arguments
If none of these have changed (as testified by a cryptographic hash over these) since the last evaluation of the source block, then the value of the previous evaluation is used as the value of the current evaluation.
Of course, if a source code block takes input from some external
source, such as a file, that may have changed since the previous
evaluation, Org Mode won't notice, and you may get incorrect results.
Also, a source code block that makes use of the results of a random
number generator will not be re-evaluated. It is the responsibility
of the programmer to not mark source blocks of these types with
:cache yes
.
Here is an example. When it is actually evaluated, this source code block will block for two seconds. If you evaluate it a second time, the results will appear immediately.
#+begin_src R :cache yes Sys.sleep(2) 42 #+end_src : 42
Now, we look at how :cache
deals with one of the inputs changing.
First, here is a source which produces the same value each time it is
run:
#+begin_src R 23 #+end_src : 23
Then, a source that produces a different value each second:
#+begin_src R Sys.time() #+end_src : 2021-04-15 09:40:05
Then, two functions. The first uses results of the unvarying source
code block as input. The first time you evaluate it with
[M-x org-babel-execute-src-block]
([C-c C-c]
), it will sleep the
two seconds. However, after that, evaluating it will return results
immediately.
#+begin_src R :var input=stable :cache yes Sys.sleep(2) input #+end_src : 23
This function, on the other hand, takes as input results from the varying function. Each time (well, separated by at least one second) you evaluate it, it will take the full two seconds.
#+begin_src R :var input=unstable :cache yes Sys.sleep(2) input #+end_src : 2021-04-15 09:40:08
Other sources of information
The official Quick Start guide provides a very good introduction to
Org Mode. The main Org Mode web page is another good source for
further information, as is the Org Mode worg site. (You may find it
useful to take a linear stroll through the worg site map.) Also, once
installed on your system, the Org Mode info pages are available in
Emacs (or, using info(1)
).
The Org Mode Compact Guide has a section on source blocks. A separate
"worg" page gives information on using R with Org Mode. The list of
languages officially supported by Org Mode is documented here. In
addition to that list, a number of Emacs packages add support for
additional programming languages; you can enter [M-x list-packages]
and (regexp) search for ^ ob-
, to list a number of these.
The Org Mode community has various forms of engaging with one another. In particular, there is an e-mail list, an IRC channel, etc.
The other presentations in this ESS intro series provide more detail about ESS. The ESS project also has ways to connect, listed here.
The beamer slides for this tutorial are here (html). A .html version of this file is here (pdf), and plain text version, suitable for experimentation in Emacs, is here (no PDF file for this one!). The github repository for this presentation is here.
There are some videos you might find useful. Rainer König's screencasts about Org Mode (also available as a course on Udemy) are useful for coming up to speed with Org Mode, but are more focused on the non-programming aspects of Org Mode. SystemCrafters' videos include a number that touch on various aspects of both Emacs and Org Mode. DT ("Distro Tube"?) has yet another introductory video. And, tdhock has a playlist Emacs and R.
There are some nice tutorials. A somewhat older one is from Erik Iverson, org-mode-R-tutorial.org. And, there is a more recent one from Vikas Rawal, orgpapers.org.
Footnotes:
a.k.a., "org-mode", Org Mode, orgmode – the proliferation of notation makes googling somewhat of a challenge.
I believe there are facilities for "naming" bits of information in other .org files, but I don't know the details and I don't know if it works with source code blocks.
Outside of a source block, <<NAME>>
is used to tag an
internal link in the .org file; if you are visiting this as a .org
file in Emacs, you may have noticed instances in this document.


com.numericalmethod.suanshu.mathstructure
Interface HilbertSpace<H,F extends Field<F> & java.lang.Comparable<F>>
- Type Parameters:
H
- a Hilbert space
- All Superinterfaces:
- AbelianGroup<H>, BanachSpace<H,F>, VectorSpace<H,F>
- All Known Subinterfaces:
- Vector
- All Known Implementing Classes:
- Basis, DenseVector, ImmutableVector, SparseVector
public interface HilbertSpace<H,F extends Field<F> & java.lang.Comparable<F>>
- extends BanachSpace<H,F>
This interface represents a Hilbert space.
A Hilbert space is an inner product space, an abstract vector space in which distances and angles can be measured.
It is also "complete", meaning that
if a sequence of vectors is Cauchy, then it converges to some limit in the space.
- See Also:
- Wikipedia: Hilbert space
|
Method Summary |
double |
angle(H that)
angle : H × H → F
Inner products formalizes the geometrical notions
such as the length of a vector and the angle between two vectors. |
double |
innerProduct(H that)
<·,·> : H × H → F
Inner products formalizes the geometrical notions
such as the length of a vector and the angle between two vectors. |
| Methods inherited from interface com.numericalmethod.suanshu.mathstructure.BanachSpace |
norm |
| Methods inherited from interface com.numericalmethod.suanshu.mathstructure.VectorSpace |
scaled |
innerProduct
double innerProduct(H that)
<·,·> : H × H → F
Inner products formalizes the geometrical notions
such as the length of a vector and the angle between two vectors.
It defines orthogonality between two vectors, where their inner product is 0.
- Parameters:
that
- the object to form an angle with this
- Returns:
<this,that>
angle
double angle(H that)
angle : H × H → F
Inner products formalizes the geometrical notions
such as the length of a vector and the angle between two vectors.
It defines orthogonality between two vectors, where their inner product is 0.
- Parameters:
that
- the object to form an angle with this
- Returns:
- the angle between this and that
Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.


Libraries Release Notes
- Cocos2d-X v3.4
- Support for bones (skeletal structure)
LevelHelper2-API v0.0.931
- Fixed collision handling with bodies created manually by the user
After Update Compilation Help
Cocos2d-X Library
After Update Compilation Help
Because of changes in the Cocos2d-X 3.3 library files & code structure, user action is required to make an old project compile.
1. Go to AppController.mm and change:
#import "CCEAGLView.h"
to
#import "platform/ios/CCEAGLView-ios.h"
2. Go to RootViewController.mm and change:
#import "CCEAGLView.h"
to
#import "platform/ios/CCEAGLView-ios.h"
3. Go to AppController.mm and change:
cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView);
to
cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView);
4. Go to AppDelegate.cpp and change:
glview = GLView::create("My Game");
to
glview = GLViewImpl::create("My Game");
5. Select all your project targets and under "General" tab find "Linked Frameworks and Libraries" and remove the following libraries if present:
libbox2d iOS.a
libchipmunk iOS.a
libcocos2dx-extensions iOS.a
libCocos2dDenshion iOS.a


Rise and shine sleepy head. A new day awaits you. May you make an indellible mark on the human race today. I believe in you.
Enjoy your day!!!


The initial distribution function of fast ions are assumed to take the following form:
|
| (114) |
where the constant C is set to achieve desired stored energy of energetic particles. Figure 27 plots the time evolution of the loss fraction due to the prompt loss (also called ﬁrst orbit loss) in EAST#48916 at 4.6s.
| dΓ = dV sdV v = RdRdZdϕ2πdv∥′dμ |
|
| (115) |
Marker’s phase-space volume V j


| Top |
NcCBEPrecisionNcCBEPrecision — CLASS (Cosmic Linear Anisotropy Solving System) backend for perturbations |
Functions
| NcCBEPrecision * | nc_cbe_precision_ref () |
| NcCBEPrecision * | nc_cbe_precision_new () |
| void | nc_cbe_precision_free () |
| void | nc_cbe_precision_clear () |
| void | nc_cbe_precision_assert_default () |
Properties
| double | a-ini-over-a-today-default | Read / Write / Construct |
| int | accurate-lensing | Read / Write / Construct |
| double | back-integration-stepsize | Read / Write / Construct |
| double | curvature-ini | Read / Write / Construct |
| int | delta-l-max | Read / Write / Construct |
| double | entropy-ini | Read / Write / Construct |
| int | evolver | Read / Write / Construct |
| double | gw-ini | Read / Write / Construct |
| double | halofit-k-per-decade | Read / Write / Construct |
| double | halofit-min-k-max | Read / Write / Construct |
| double | halofit-min-k-nonlinear | Read / Write / Construct |
| double | halofit-sigma-precision | Read / Write / Construct |
| double | halofit-tol-sigma | Read / Write / Construct |
| double | hyper-flat-approximation-nu | Read / Write / Construct |
| double | hyper-nu-sampling-step | Read / Write / Construct |
| double | hyper-phi-min-abs | Read / Write / Construct |
| double | hyper-sampling-curved-high-nu | Read / Write / Construct |
| double | hyper-sampling-curved-low-nu | Read / Write / Construct |
| double | hyper-sampling-flat | Read / Write / Construct |
| double | hyper-x-min | Read / Write / Construct |
| double | hyper-x-tol | Read / Write / Construct |
| char * | hyrec-Alpha-inf-file | Read / Write / Construct |
| char * | hyrec-R-inf-file | Read / Write / Construct |
| char * | hyrec-two-photon-tables-file | Read / Write / Construct |
| double | k-bao-center | Read / Write / Construct |
| double | k-bao-width | Read / Write / Construct |
| double | k-max-tau0-over-l-max | Read / Write / Construct |
| double | k-min-tau0 | Read / Write / Construct |
| double | k-per-decade-for-bao | Read / Write / Construct |
| double | k-per-decade-for-pk | Read / Write / Construct |
| double | k-per-decade-primordial | Read / Write / Construct |
| double | k-step-sub | Read / Write / Construct |
| double | k-step-super | Read / Write / Construct |
| double | k-step-super-reduction | Read / Write / Construct |
| double | k-step-transition | Read / Write / Construct |
| int | l-linstep | Read / Write / Construct |
| double | l-logstep | Read / Write / Construct |
| int | l-max-dr | Read / Write / Construct |
| int | l-max-g | Read / Write / Construct |
| int | l-max-g-ten | Read / Write / Construct |
| int | l-max-ncdm | Read / Write / Construct |
| int | l-max-pol-g | Read / Write / Construct |
| int | l-max-pol-g-ten | Read / Write / Construct |
| int | l-max-ur | Read / Write / Construct |
| double | l-switch-limber | Read / Write / Construct |
| double | l-switch-limber-for-nc-local-over-z | Read / Write / Construct |
| double | l-switch-limber-for-nc-los-over-z | Read / Write / Construct |
| int | ncdm-fluid-approximation | Read / Write / Construct |
| double | ncdm-fluid-trigger-tau-over-tau-k | Read / Write / Construct |
| double | neglect-CMB-sources-below-visibility | Read / Write / Construct |
| int | num-mu-minus-lmax | Read / Write / Construct |
| double | perturb-integration-stepsize | Read / Write / Construct |
| double | perturb-sampling-stepsize | Read / Write / Construct |
| double | pk-eq-tol | Read / Write / Construct |
| double | pk-eq-z-max | Read / Write / Construct |
| double | primordial-inflation-aH-ini-target | Read / Write / Construct |
| int | primordial-inflation-attractor-maxit | Read / Write / Construct |
| double | primordial-inflation-attractor-precision-initial | Read / Write / Construct |
| double | primordial-inflation-attractor-precision-pivot | Read / Write / Construct |
| double | primordial-inflation-bg-stepsize | Read / Write / Construct |
| double | primordial-inflation-end-dphi | Read / Write / Construct |
| double | primordial-inflation-end-logstep | Read / Write / Construct |
| double | primordial-inflation-extra-efolds | Read / Write / Construct |
| int | primordial-inflation-phi-ini-maxit | Read / Write / Construct |
| double | primordial-inflation-pt-stepsize | Read / Write / Construct |
| double | primordial-inflation-ratio-max | Read / Write / Construct |
| double | primordial-inflation-ratio-min | Read / Write / Construct |
| double | primordial-inflation-small-epsilon | Read / Write / Construct |
| double | primordial-inflation-small-epsilon-tol | Read / Write / Construct |
| double | primordial-inflation-tol-curvature | Read / Write / Construct |
| double | primordial-inflation-tol-integration | Read / Write / Construct |
| double | q-linstep | Read / Write / Construct |
| double | q-logstep-open | Read / Write / Construct |
| double | q-logstep-spline | Read / Write / Construct |
| double | q-logstep-trapzd | Read / Write / Construct |
| double | q-numstep-transition | Read / Write / Construct |
| int | radiation-streaming-approximation | Read / Write / Construct |
| double | radiation-streaming-trigger-tau-c-over-tau | Read / Write / Construct |
| double | radiation-streaming-trigger-tau-over-tau-k | Read / Write / Construct |
| double | recfast-AGauss1 | Read / Write / Construct |
| double | recfast-AGauss2 | Read / Write / Construct |
| double | recfast-H-frac | Read / Write / Construct |
| int | recfast-Heswitch | Read / Write / Construct |
| int | recfast-Hswitch | Read / Write / Construct |
| int | recfast-Nz0 | Read / Write / Construct |
| double | recfast-delta-fudge-H | Read / Write / Construct |
| double | recfast-delta-z-He-1 | Read / Write / Construct |
| double | recfast-delta-z-He-2 | Read / Write / Construct |
| double | recfast-delta-z-He-3 | Read / Write / Construct |
| double | recfast-fudge-H | Read / Write / Construct |
| double | recfast-fudge-He | Read / Write / Construct |
| double | recfast-wGauss1 | Read / Write / Construct |
| double | recfast-wGauss2 | Read / Write / Construct |
| double | recfast-x-H0-trigger | Read / Write / Construct |
| double | recfast-x-H0-trigger-delta | Read / Write / Construct |
| double | recfast-x-H0-trigger2 | Read / Write / Construct |
| double | recfast-x-He0-trigger | Read / Write / Construct |
| double | recfast-x-He0-trigger-delta | Read / Write / Construct |
| double | recfast-x-He0-trigger2 | Read / Write / Construct |
| double | recfast-z-He-1 | Read / Write / Construct |
| double | recfast-z-He-2 | Read / Write / Construct |
| double | recfast-z-He-3 | Read / Write / Construct |
| double | recfast-z-initial | Read / Write / Construct |
| double | recfast-zGauss1 | Read / Write / Construct |
| double | recfast-zGauss2 | Read / Write / Construct |
| double | reionization-optical-depth-tol | Read / Write / Construct |
| double | reionization-sampling | Read / Write / Construct |
| double | reionization-start-factor | Read / Write / Construct |
| double | reionization-z-start-max | Read / Write / Construct |
| char * | sBBN-file | Read / Write / Construct |
| double | safe-phi-scf | Read / Write / Construct |
| double | selection-cut-at-sigma | Read / Write / Construct |
| double | selection-sampling | Read / Write / Construct |
| double | selection-sampling-bessel | Read / Write / Construct |
| double | selection-sampling-bessel-los | Read / Write / Construct |
| double | selection-tophat-edge | Read / Write / Construct |
| double | smallest-allowed-variation | Read / Write / Construct |
| double | start-large-k-at-tau-h-over-tau-k | Read / Write / Construct |
| double | start-small-k-at-tau-c-over-tau-h | Read / Write / Construct |
| double | start-sources-at-tau-c-over-tau-h | Read / Write / Construct |
| int | thermo-rate-smoothing-radius | Read / Write / Construct |
| int | tight-coupling-approximation | Read / Write / Construct |
| double | tight-coupling-trigger-tau-c-over-tau-h | Read / Write / Construct |
| double | tight-coupling-trigger-tau-c-over-tau-k | Read / Write / Construct |
| double | tol-M-ncdm | Read / Write / Construct |
| double | tol-background-integration | Read / Write / Construct |
| double | tol-gauss-legendre | Read / Write / Construct |
| double | tol-initial-Omega-r | Read / Write / Construct |
| double | tol-ncdm | Read / Write / Construct |
| double | tol-ncdm-bg | Read / Write / Construct |
| double | tol-ncdm-initial-w | Read / Write / Construct |
| double | tol-ncdm-newtonian | Read / Write / Construct |
| double | tol-ncdm-synchronous | Read / Write / Construct |
| double | tol-perturb-integration | Read / Write / Construct |
| double | tol-tau-approx | Read / Write / Construct |
| double | tol-tau-eq | Read / Write / Construct |
| double | tol-thermo-integration | Read / Write / Construct |
| double | transfer-neglect-delta-k-S-e | Read / Write / Construct |
| double | transfer-neglect-delta-k-S-t0 | Read / Write / Construct |
| double | transfer-neglect-delta-k-S-t1 | Read / Write / Construct |
| double | transfer-neglect-delta-k-S-t2 | Read / Write / Construct |
| double | transfer-neglect-delta-k-T-b | Read / Write / Construct |
| double | transfer-neglect-delta-k-T-e | Read / Write / Construct |
| double | transfer-neglect-delta-k-T-t2 | Read / Write / Construct |
| double | transfer-neglect-delta-k-V-b | Read / Write / Construct |
| double | transfer-neglect-delta-k-V-e | Read / Write / Construct |
| double | transfer-neglect-delta-k-V-t1 | Read / Write / Construct |
| double | transfer-neglect-delta-k-V-t2 | Read / Write / Construct |
| double | transfer-neglect-late-source | Read / Write / Construct |
| int | ur-fluid-approximation | Read / Write / Construct |
| double | ur-fluid-trigger-tau-over-tau-k | Read / Write / Construct |
Description
This object provides a front-end for CLASS precision structure.
If you use this object please cite: Blas (2011) CLASS II, see also:
Functions
nc_cbe_precision_ref ()
NcCBEPrecision *
nc_cbe_precision_ref (NcCBEPrecision *cbe_prec
);
Increases the reference count of cbe_prec
.
nc_cbe_precision_free ()
void
nc_cbe_precision_free (NcCBEPrecision *cbe_prec
);
Decreases the reference count of cbe_prec
.
nc_cbe_precision_clear ()
void
nc_cbe_precision_clear (NcCBEPrecision **cbe_prec
);
Decreases the reference count of *cbe_prec
and sets *cbe_prec
to NULL.
nc_cbe_precision_assert_default ()
void
nc_cbe_precision_assert_default (NcCBEPrecision *cbe_prec
);
Check agaist CLASS default values.
Property Details
The “a-ini-over-a-today-default”
property
“a-ini-over-a-today-default” double
default initial value of scale factor in background integration, in units of scale factor today.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-14
The “accurate-lensing”
property
“accurate-lensing” int
switch between Gauss-Legendre quadrature integration and simple quadrature on a subdomain of angles.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0
The “back-integration-stepsize”
property
“back-integration-stepsize” double
default step d tau in background integration, in units of conformal Hubble time ($d \tau$ = back_integration_stepsize / aH ).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.007
The “curvature-ini”
property
“curvature-ini” double
initial curvature; used to fix adiabatic initial conditions; must remain fixed to one as long as the primordial adiabatic spectrum stands for the curvature power spectrum.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “delta-l-max”
property
“delta-l-max” int
difference between l_max in unlensed and lensed spectra.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 500
The “entropy-ini”
property
“entropy-ini” double
initial entropy; used to fix isocurvature initial conditions; must remain fixed to one as long as the primordial isocurvature spectrum stands for an entropy power spectrum.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “evolver”
property
“evolver” int
which type of evolver for integrating perturbations (Runge-Kutta? Stiff?...).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “gw-ini”
property
“gw-ini” double
initial condition for tensor metric perturbation h.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “halofit-k-per-decade”
property
“halofit-k-per-decade” double
halofit needs to evalute integrals (linear power spectrum times some kernels). They are sampled using this logarithmic step size.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 80
The “halofit-min-k-max”
property
“halofit-min-k-max” double
when halofit is used, k_max must be at least equal to this value (otherwise halofit could not find the scale of non-linearity).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 5
The “halofit-min-k-nonlinear”
property
“halofit-min-k-nonlinear” double
value of k in 1/Mpc above which non-linear corrections will be computed.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.0001
The “halofit-sigma-precision”
property
“halofit-sigma-precision” double
a smaller value will lead to a more precise halofit result at the highest requested redshift, at the expense of requiring a larger k_max.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.05
The “halofit-tol-sigma”
property
“halofit-tol-sigma” double
tolerance required on sigma(R) when matching the condition sigma(R_nl)=1, whcih defines the wavenumber of non-linearity, k_nl=1./R_nl.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-06
The “hyper-flat-approximation-nu”
property
“hyper-flat-approximation-nu” double
hyper flat approximation nu.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 4000
The “hyper-nu-sampling-step”
property
“hyper-nu-sampling-step” double
hyper nu sampling step.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1000
The “hyper-phi-min-abs”
property
“hyper-phi-min-abs” double
hyper phi min abs.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-10
The “hyper-sampling-curved-high-nu”
property
“hyper-sampling-curved-high-nu” double
hyper sampling_curved_high_nu.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 3
The “hyper-sampling-curved-low-nu”
property
“hyper-sampling-curved-low-nu” double
hyper sampling_curved_low_nu.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 7
The “hyper-sampling-flat”
property
“hyper-sampling-flat” double
hyper sampling flat.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 8
The “hyper-x-min”
property
“hyper-x-min” double
hyper x min.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-05
The “hyper-x-tol”
property
“hyper-x-tol” double
hyper x tol.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.0001
The “hyrec-Alpha-inf-file”
property
“hyrec-Alpha-inf-file” char *
Hyrec Alpha inf file.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: "/home/sandro/Projects/NumCosmo/data/class_data/hyrec/Alpha_inf.dat"
The “hyrec-R-inf-file”
property
“hyrec-R-inf-file” char *
Hyrec R inf file.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: "/home/sandro/Projects/NumCosmo/data/class_data/hyrec/R_inf.dat"
The “hyrec-two-photon-tables-file”
property
“hyrec-two-photon-tables-file” char *
Hyrec two photon tables file.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: "/home/sandro/Projects/NumCosmo/data/class_data/hyrec/two_photon_tables.dat"
The “k-bao-center”
property
“k-bao-center” double
in ln(k) space, the central value of the BAO region where sampling is finer is defined as k_rec times this number (recommended: 3, i.e. finest sampling near 3rd BAO peak).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 3
The “k-bao-width”
property
“k-bao-width” double
in ln(k) space, width of the BAO region where sampling is finer: this number gives roughly the number of BAO oscillations well resolved on both sides of the central value (recommended: 4, i.e. finest sampling from before first up to 3+4=7th peak).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 4
The “k-max-tau0-over-l-max”
property
“k-max-tau0-over-l-max” double
number defining k_max for the computation of Cl's (dimensionless): (k_max tau_0)/l_max, usually chosen around two (very relevant for accuracy of lensed ClTT at highest l's).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2.4
The “k-min-tau0”
property
“k-min-tau0” double
number defining k_min for the computation of Cl's and P(k)'s (dimensionless): (k_min tau_0), usually chosen much smaller than one.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “k-per-decade-for-bao”
property
“k-per-decade-for-bao” double
if values needed between kmax inferred from k_oscillations and k_kmax_for_pk, this gives the number of k per decade inside the BAO region (for finer sampling).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 70
The “k-per-decade-for-pk”
property
“k-per-decade-for-pk” double
if values needed between kmax inferred from k_oscillations and k_kmax_for_pk, this gives the number of k per decade outside the BAO region.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10
The “k-per-decade-primordial”
property
“k-per-decade-primordial” double
logarithmic sampling for primordial spectra (number of points per decade in k space).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10
The “k-step-sub”
property
“k-step-sub” double
step in k space, in units of one period of acoustic oscillation at decoupling, for scales inside sound horizon at decoupling.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.05
The “k-step-super”
property
“k-step-super” double
step in k space, in units of one period of acoustic oscillation at decoupling, for scales above sound horizon at decoupling.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.002
The “k-step-super-reduction”
property
“k-step-super-reduction” double
the step k_step_super is reduced by this amount in the k-->0 limit (below scale of Hubble and/or curvature radius).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “k-step-transition”
property
“k-step-transition” double
dimensionless number regulating the transition from 'sub' steps to 'super' steps. Decrease for more precision.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.2
The “l-linstep”
property
“l-linstep” int
factor for logarithmic spacing of values of l over which bessel and transfer functions are sampled.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 40
The “l-logstep”
property
“l-logstep” double
maximum spacing of values of l over which Bessel and transfer functions are sampled (so, spacing becomes linear instead of logarithmic at some point).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1.12
The “l-max-dr”
property
“l-max-dr” int
number of momenta in Boltzmann hierarchy for decay radiation.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 17
The “l-max-g”
property
“l-max-g” int
number of momenta in Boltzmann hierarchy for photon temperature (scalar).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 12
The “l-max-g-ten”
property
“l-max-g-ten” int
number of momenta in Boltzmann hierarchy for photon temperature (tensor).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 5
The “l-max-ncdm”
property
“l-max-ncdm” int
number of momenta in Boltzmann hierarchy for relativistic neutrino/relics (scalar).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 17
The “l-max-pol-g”
property
“l-max-pol-g” int
number of momenta in Boltzmann hierarchy for photon polarisation (scalar).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 10
The “l-max-pol-g-ten”
property
“l-max-pol-g-ten” int
number of momenta in Boltzmann hierarchy for photon polarisation (tensor).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 5
The “l-max-ur”
property
“l-max-ur” int
number of momenta in Boltzmann hierarchy for relativistic neutrino/relics (scalar).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 4
Default value: 17
The “l-switch-limber”
property
“l-switch-limber” double
when to use the Limber approximation for project gravitational potential cl's.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10
The “l-switch-limber-for-nc-local-over-z”
property
“l-switch-limber-for-nc-local-over-z” double
when to use the Limber approximation for local number count contributions to cl's (relative to central redshift of each bin).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 100
The “l-switch-limber-for-nc-los-over-z”
property
“l-switch-limber-for-nc-los-over-z” double
when to use the Limber approximation for number count contributions to cl's integrated along the line-of-sight (relative to central redshift of each bin).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 30
The “ncdm-fluid-approximation”
property
“ncdm-fluid-approximation” int
NCDM fluid approximation scheme.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2
The “ncdm-fluid-trigger-tau-over-tau-k”
property
“ncdm-fluid-trigger-tau-over-tau-k” double
when to switch off ncdm (massive neutrinos / non-cold relics) fluid approximation.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 31
The “neglect-CMB-sources-below-visibility”
property
“neglect-CMB-sources-below-visibility” double
neglect CMB sources below visibility.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “num-mu-minus-lmax”
property
“num-mu-minus-lmax” int
difference between num_mu and l_max, increase for more precision.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 70
The “perturb-integration-stepsize”
property
“perturb-integration-stepsize” double
default step $d \tau$ in perturbation integration, in units of the timescale involved in the equations (usally, the min of $1/k$, $1/aH$, $1/\dot{\kappa}$).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.5
The “perturb-sampling-stepsize”
property
“perturb-sampling-stepsize” double
default step $d \tau$ for sampling the source function, in units of the timescale involved in the sources: $(\dot{\kappa}- \ddot{\kappa}/\dot{\kappa})^{-1}$.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “pk-eq-tol”
property
“pk-eq-tol” double
tolerance for finding the equivalent models of the pk_equal method.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-07
The “pk-eq-z-max”
property
“pk-eq-z-max” double
Maximum z until which the Pk_equal method of 0810.0190 and 1601.07230 is used.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 5
The “primordial-inflation-aH-ini-target”
property
“primordial-inflation-aH-ini-target” double
primordial inflation aH ini target.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.9
The “primordial-inflation-attractor-maxit”
property
“primordial-inflation-attractor-maxit” int
primordial inflation attractor_maxit.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10
The “primordial-inflation-attractor-precision-initial”
property
“primordial-inflation-attractor-precision-initial” double
primordial inflation attractor_precision_initial.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “primordial-inflation-attractor-precision-pivot”
property
“primordial-inflation-attractor-precision-pivot” double
primordial inflation attractor_precision_pivot.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “primordial-inflation-bg-stepsize”
property
“primordial-inflation-bg-stepsize” double
primordial inflation bg stepsize.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.005
The “primordial-inflation-end-dphi”
property
“primordial-inflation-end-dphi” double
primordial inflation end dphi.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-10
The “primordial-inflation-end-logstep”
property
“primordial-inflation-end-logstep” double
primordial inflation end logstep.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10
The “primordial-inflation-extra-efolds”
property
“primordial-inflation-extra-efolds” double
primordial inflation extra efolds.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2
The “primordial-inflation-phi-ini-maxit”
property
“primordial-inflation-phi-ini-maxit” int
primordial inflation phi ini maxit.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10000
The “primordial-inflation-pt-stepsize”
property
“primordial-inflation-pt-stepsize” double
primordial inflation pt stepsize.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.01
The “primordial-inflation-ratio-max”
property
“primordial-inflation-ratio-max” double
primordial inflation ratio max.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.02
The “primordial-inflation-ratio-min”
property
“primordial-inflation-ratio-min” double
primordial inflation ratio min.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 100
The “primordial-inflation-small-epsilon”
property
“primordial-inflation-small-epsilon” double
primordial inflation small epsilon.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “primordial-inflation-small-epsilon-tol”
property
“primordial-inflation-small-epsilon-tol” double
primordial inflation small epsilon tol.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.01
The “primordial-inflation-tol-curvature”
property
“primordial-inflation-tol-curvature” double
primordial inflation tol curvature.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “primordial-inflation-tol-integration”
property
“primordial-inflation-tol-integration” double
primordial inflation tol integration.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “q-linstep”
property
“q-linstep” double
asymptotic linear sampling step in q space, in units of 2pi/r_a(tau_rec) (comoving angular diameter distance to recombination).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.45
The “q-logstep-open”
property
“q-logstep-open” double
in open models, the value of q_logstep_spline must be decreased according to curvature. Increasing this number will make the calculation more accurate for large positive Omega_k0.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 6
The “q-logstep-spline”
property
“q-logstep-spline” double
initial logarithmic sampling step in q space, in units of 2pi/r_a(tau_rec) (comoving angular diameter distance to recombination).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 170
The “q-logstep-trapzd”
property
“q-logstep-trapzd” double
initial logarithmic sampling step in q space, in units of 2pi/r_a(tau_rec) (comoving angular diameter distance to recombination), in the case of small q's in the closed case, for which one must used trapezoidal integration instead of spline (the number of q's for which this is the case decreases with curvature and vanishes in the flat limit).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 20
The “q-numstep-transition”
property
“q-numstep-transition” double
number of steps for the transition from q_logstep_trapzd steps to q_logstep_spline steps (transition must be smooth for spline).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 250
The “radiation-streaming-approximation”
property
“radiation-streaming-approximation” int
method for switching off photon perturbations.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2
The “radiation-streaming-trigger-tau-c-over-tau”
property
“radiation-streaming-trigger-tau-c-over-tau” double
when to switch off photon perturbations, ie when to switch on photon free-streaming approximation (keep density and theta, set shear and higher momenta to zero): second condition:.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 5
The “radiation-streaming-trigger-tau-over-tau-k”
property
“radiation-streaming-trigger-tau-over-tau-k” double
when to switch off photon perturbations, ie when to switch on photon free-streaming approximation (keep density and thtau, set shear and higher momenta to zero): first condition: $k au$ > radiation_streaming_trigger_tau_h_over_tau_k.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 45
The “recfast-AGauss1”
property
“recfast-AGauss1” double
Amplitude of 1st Gaussian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: -0.14
The “recfast-AGauss2”
property
“recfast-AGauss2” double
Amplitude of 2st Gaussian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: 0.079
The “recfast-H-frac”
property
“recfast-H-frac” double
governs time at which full equation of evolution for Tmat is used.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “recfast-Heswitch”
property
“recfast-Heswitch” int
Recfast He switch.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 6
The “recfast-Hswitch”
property
“recfast-Hswitch” int
recfast 1.5 switching parameter.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “recfast-Nz0”
property
“recfast-Nz0” int
number of integration steps.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 20000
The “recfast-delta-fudge-H”
property
“recfast-delta-fudge-H” double
correction to H fudge factor in v1.5.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: -0.015
The “recfast-delta-z-He-1”
property
“recfast-delta-z-He-1” double
z range over which transition is smoothed.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 50
The “recfast-delta-z-He-2”
property
“recfast-delta-z-He-2” double
z range over which transition is smoothed.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 100
The “recfast-delta-z-He-3”
property
“recfast-delta-z-He-3” double
z range over which transition is smoothed.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 50
The “recfast-fudge-H”
property
“recfast-fudge-H” double
H fudge factor when recfast_Hswitch set to false (v1.4 fudging).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1.14
The “recfast-fudge-He”
property
“recfast-fudge-He” double
Recfast fudge He.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.86
The “recfast-wGauss1”
property
“recfast-wGauss1” double
Width of 2st Gaussian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: 0.18
The “recfast-wGauss2”
property
“recfast-wGauss2” double
Width of 2st Gaussian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: 0.33
The “recfast-x-H0-trigger”
property
“recfast-x-H0-trigger” double
value below which recfast uses the full equation for Hydrogen.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.995
The “recfast-x-H0-trigger-delta”
property
“recfast-x-H0-trigger-delta” double
x_H range over which transition is smoothed.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.05
The “recfast-x-H0-trigger2”
property
“recfast-x-H0-trigger2” double
a second threshold used in derivative routine.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.995
The “recfast-x-He0-trigger”
property
“recfast-x-He0-trigger” double
value below which recfast uses the full equation for Helium.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.995
The “recfast-x-He0-trigger-delta”
property
“recfast-x-He0-trigger-delta” double
x_He range over which transition is smoothed.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.05
The “recfast-x-He0-trigger2”
property
“recfast-x-He0-trigger2” double
a second threshold used in derivative routine.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.995
The “recfast-z-He-1”
property
“recfast-z-He-1” double
down to which redshift Helium fully ionized.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 8000
The “recfast-z-He-2”
property
“recfast-z-He-2” double
down to which redshift first Helium recombination not complete.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 5000
The “recfast-z-He-3”
property
“recfast-z-He-3” double
down to which redshift Helium singly ionized.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 3500
The “recfast-z-initial”
property
“recfast-z-initial” double
initial redshift in recfast.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 10000
The “recfast-zGauss1”
property
“recfast-zGauss1” double
ln(1+z) of 1st Gaussian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: 7.28
The “recfast-zGauss2”
property
“recfast-zGauss2” double
ln(1+z) of 2st Gaussian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: 6.73
The “reionization-optical-depth-tol”
property
“reionization-optical-depth-tol” double
fractional error on optical_depth.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.0001
The “reionization-sampling”
property
“reionization-sampling” double
control stepsize in z during reionization.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.05
The “reionization-start-factor”
property
“reionization-start-factor” double
parameter for CAMB-like parametrization.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 8
The “reionization-z-start-max”
property
“reionization-z-start-max” double
maximum redshift at which reionization should start. If not, return an error.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 50
The “sBBN-file”
property
“sBBN-file” char *
SBBN filename.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: "/home/sandro/Projects/NumCosmo/data/class_data/bbn/sBBN_2017.dat"
The “safe-phi-scf”
property
“safe-phi-scf” double
parameter controlling the initial scalar field in background functions.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Default value: 0
The “selection-cut-at-sigma”
property
“selection-cut-at-sigma” double
in sigma units, where to cut gaussian selection functions.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 5
The “selection-sampling”
property
“selection-sampling” double
controls sampling of integral over time when selection functions vary quicker than Bessel functions. Increase for better sampling.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 50
The “selection-sampling-bessel”
property
“selection-sampling-bessel” double
controls sampling of integral over time when selection functions vary slower than Bessel functions. Increase for better sampling.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 20
The “selection-sampling-bessel-los”
property
“selection-sampling-bessel-los” double
controls sampling of integral over time when selection functions vary slower than Bessel functions. This parameter is specific to number counts contributions to Cl integrated along the line of sight. Increase for better sampling.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 20
The “selection-tophat-edge”
property
“selection-tophat-edge” double
controls how smooth are the edge of top-hat window function (<<1 for very sharp, 0.1 for sharp).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “smallest-allowed-variation”
property
“smallest-allowed-variation” double
machine-dependent, defined by the implementation.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2.22045e-16
The “start-large-k-at-tau-h-over-tau-k”
property
“start-large-k-at-tau-h-over-tau-k” double
largest wavelengths start being sampled when mode is sufficiently outside Hibble scale. This is quantified in terms of the ratio of hubble time scale to wavenumber time scale, $ au_h/ au_k$ wich is roughly equal to (k*tau). Start when this ratio equals start_large_k_at_tau_k_over_tau_h. Decrease this value to start integrating the wavenumbers earlier in time.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.07
The “start-small-k-at-tau-c-over-tau-h”
property
“start-small-k-at-tau-c-over-tau-h” double
largest wavelengths start being sampled when universe is sufficiently opaque. This is quantified in terms of the ratio of thermo to hubble time scales, $ au_c/ au_H$. Start when start_largek_at_tau_c_over_tau_h equals this ratio. Decrease this value to start integrating the wavenumbers earlier in time.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.0015
The “start-sources-at-tau-c-over-tau-h”
property
“start-sources-at-tau-c-over-tau-h” double
sources start being sampled when universe is sufficiently opaque. This is quantified in terms of the ratio of thermo to hubble time scales, $\tau_c/\tau_H$. Start when start_sources_at_tau_c_over_tau_h equals this ratio. Decrease this value to start sampling the sources earlier in time.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.008
The “thermo-rate-smoothing-radius”
property
“thermo-rate-smoothing-radius” int
plays a minor (almost aesthetic) role in the definition of the variation rate of thermodynamical quantities.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 50
The “tight-coupling-approximation”
property
“tight-coupling-approximation” int
Tight coupling approximation scheme.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 5
The “tight-coupling-trigger-tau-c-over-tau-h”
property
“tight-coupling-trigger-tau-c-over-tau-h” double
when to switch off tight-coupling approximation: first condition: $\tau_c/\tau_H$ > tight_coupling_trigger_tau_c_over_tau_h. Decrease this value to switch off earlier in time. If this number is larger than start_sources_at_tau_c_over_tau_h, the code returns an error, because the source computation requires tight-coupling to be switched off.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.015
The “tight-coupling-trigger-tau-c-over-tau-k”
property
“tight-coupling-trigger-tau-c-over-tau-k” double
when to switch off tight-coupling approximation: second condition: $\tau_c/\tau_k \equiv k \tau_c$ < tight_coupling_trigger_tau_c_over_tau_k. Decrease this value to switch off earlier in time.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.01
The “tol-M-ncdm”
property
“tol-M-ncdm” double
parameter controlling relative precision of ncdm mass for given ncdm current density.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-07
The “tol-background-integration”
property
“tol-background-integration” double
parameter controlling precision of background integration.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.01
The “tol-gauss-legendre”
property
“tol-gauss-legendre” double
tolerance with which quadrature points are found: must be very small for an accurate integration (if not entered manually, set automatically to match implementation precision).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2.22045e-16
The “tol-initial-Omega-r”
property
“tol-initial-Omega-r” double
parameter controlling how deep inside radiation domination must the initial time be chosen.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.0001
The “tol-ncdm”
property
“tol-ncdm” double
parameter controlling relative precision of integrals over ncdm phase-space distribution during perturbation calculation.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “tol-ncdm-bg”
property
“tol-ncdm-bg” double
parameter controlling relative precision of integrals over ncdm phase-space distribution during background evolution.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-05
The “tol-ncdm-initial-w”
property
“tol-ncdm-initial-w” double
parameter controlling how relativistic must non-cold relics be at initial time.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “tol-ncdm-newtonian”
property
“tol-ncdm-newtonian” double
parameter controlling relative precision of integrals over ncdm phase-space distribution during perturbation calculation - newtonian.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-05
The “tol-ncdm-synchronous”
property
“tol-ncdm-synchronous” double
parameter controlling relative precision of integrals over ncdm phase-space distribution during perturbation calculation - synchronous.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.001
The “tol-perturb-integration”
property
“tol-perturb-integration” double
control parameter for the precision of the perturbation integration.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-05
The “tol-tau-approx”
property
“tol-tau-approx” double
precision with which the code should determine (by bisection) the times at which sources start being sampled, and at which approximations must be switched on/off (units of Mpc).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-10
The “tol-tau-eq”
property
“tol-tau-eq” double
parameter controlling precision with which tau_eq (conformal time at radiation/matter equality) is found (units: Mpc).
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e-06
The “tol-thermo-integration”
property
“tol-thermo-integration” double
precision of each integration step.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.01
The “transfer-neglect-delta-k-S-e”
property
“transfer-neglect-delta-k-S-e” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.11
The “transfer-neglect-delta-k-S-t0”
property
“transfer-neglect-delta-k-S-t0” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.15
The “transfer-neglect-delta-k-S-t1”
property
“transfer-neglect-delta-k-S-t1” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.04
The “transfer-neglect-delta-k-S-t2”
property
“transfer-neglect-delta-k-S-t2” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.15
The “transfer-neglect-delta-k-T-b”
property
“transfer-neglect-delta-k-T-b” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.1
The “transfer-neglect-delta-k-T-e”
property
“transfer-neglect-delta-k-T-e” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.25
The “transfer-neglect-delta-k-T-t2”
property
“transfer-neglect-delta-k-T-t2” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0.2
The “transfer-neglect-delta-k-V-b”
property
“transfer-neglect-delta-k-V-b” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “transfer-neglect-delta-k-V-e”
property
“transfer-neglect-delta-k-V-e” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “transfer-neglect-delta-k-V-t1”
property
“transfer-neglect-delta-k-V-t1” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “transfer-neglect-delta-k-V-t2”
property
“transfer-neglect-delta-k-V-t2” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1
The “transfer-neglect-late-source”
property
“transfer-neglect-late-source” double
range of k values (in 1/Mpc) taken into account in transfer function: for l < (k-delta_k)*tau0, ie for k > (l/tau0 + delta_k), the transfer function is set to zero.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 400
The “ur-fluid-approximation”
property
“ur-fluid-approximation” int
UR fluid approximation scheme.
Owner: NcCBEPrecision
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 2


Definition at line 112 of file equationdetect_test.cc.
◆ AddBlobIntoPart()
| void tesseract::EquationFinderTest::AddBlobIntoPart |
( |
const TBOX & |
tbox, |
|
|
ColPartition * |
part |
|
) |
| |
|
inlineprotected |
◆ AddPageBlock()
| void tesseract::EquationFinderTest::AddPageBlock |
( |
Pix * |
pix, |
|
|
BLOCK_LIST * |
blocks |
|
) |
| |
|
inlineprotected |
Definition at line 138 of file equationdetect_test.cc.
139 CHECK(pix !=
nullptr);
140 CHECK(blocks !=
nullptr);
141 BLOCK_IT block_it(blocks);
143 new BLOCK(
"",
true, 0, 0, 0, 0, pixGetWidth(pix), pixGetHeight(pix));
144 block_it.add_to_end(block);
◆ ClearParts()
| void tesseract::EquationFinderTest::ClearParts |
( |
std::vector< ColPartition * > * |
all_parts | ) |
|
|
inlineprotected |
Definition at line 165 of file equationdetect_test.cc.
166 for (
size_t i = 0; i < all_parts->size(); ++i) {
167 (*all_parts)[i]->DeleteBoxes();
168 delete ((*all_parts)[i]);
◆ CreateColParts()
| void tesseract::EquationFinderTest::CreateColParts |
( |
const int |
rows, |
|
|
const int |
cols, |
|
|
ColPartitionGrid * |
part_grid, |
|
|
std::vector< ColPartition * > * |
all_parts |
|
) |
| |
|
inlineprotected |
Definition at line 148 of file equationdetect_test.cc.
151 const int kWidth = 10, kHeight = 10;
153 for (
int y = 0; y < rows; ++y) {
154 for (
int x = 0; x < cols; ++x) {
155 int left = x * kWidth * 2, bottom = y * kHeight * 2;
156 TBOX box(left, bottom, left + kWidth, bottom + kHeight);
159 part_grid->InsertBBox(
true,
true, part);
160 all_parts->push_back(part);
◆ SetUp()
| void tesseract::EquationFinderTest::SetUp |
( |
| ) |
|
|
inlineprotected |
◆ TearDown()
| void tesseract::EquationFinderTest::TearDown |
( |
| ) |
|
|
inlineprotected |
◆ equation_det_
◆ tesseract_
| std::unique_ptr<Tesseract> tesseract::EquationFinderTest::tesseract_ |
|
protected |
◆ testdata_dir_
| std::string tesseract::EquationFinderTest::testdata_dir_ |
|
protected |
The documentation for this class was generated from the following file:


The topic of test automation frameworks is huge. All of its aspects are worth many pages of conversation. Below I tried to collect the general principles I find useful and desired to almost any (model based) test automation framework regardless of the specific details of them.
One source of the historical overview of test automation frameworks is this paper from John Kent. It does worth reading to see how we’ve got to the model-based automation.
###General Principles
Test code is product code.
If it does not get treated like it, eventually the maintenance cost becomes much much greater than the benefit of having the tests.
The same basic programming/architecturing principles have to be applied to the test codebase as to any product codebases.
- The code should be DRY (Don’t Repeat Yourself): code duplications should be punished by fire and death
- Promote the code reusability
- The code base has to have a structure, layers to it
- Refactor, Refactor, Refactor: it has its cost, but it is inevitable on the long run.
The code implementing the test scenario should be entirely separated from the code which defines the interaction with the target application
- Following this principle there will be at least two separate layer defined in the architecture (tests, interaction code)
The tests should only use a well defined API of the interaction code
- Combined with the separation principle above, this enables the test and interaction code development the be separate processes.
- This will create an N:1 relation between the tests and the interaction code. The happy consequence is that if the target application changes without the requirements change, there is only the interaction code needed to be changed
Version control the tests, model code and the target application together
- If the tests and the application are not versioned together it gives an accumulative maintenance cost to be able to identify that which version of the tests are compatible with which version of the application under test.
The test case should be as readable as possible
- See the next blog entry.
The name of the test case should describe entirely the scenario the case is implemented for
- If the case does too much to be able to capture it in the name of the function it’s a good sign that the case should be divided into multiples.
- Having a structure like targetName_scenarioAndInput_expectedResult in the test case naming helps a lot. For example ElementDeletion_NotEmptyElement_AsksForConfirmation
It is intentional that I did not write “UI testing” anywhere. These principles can be used for any testing level like unit, integration, system or UI.


Sofia Carballo
Replicas
1st Project: Digital Elite
2nd Project: Smart SEO
3rd Project: IKAE
4th Project: THRONE


org.apache.hivemind.service
Classes
BodyBuilder
(100%)
ClassFabUtils
(95.6%)
MethodContribution
(61.5%)
MethodIterator
(96.6%)
MethodSignature
(98.6%)


Add Round
Name:
*
Season:
*
Choose
You must firstly create a season - season 2020-2021.. for example
Status:
*
Choose
Shirt
Round Start Date:
*
Round End Date:
*
Back


Enter course name.Course name is required!
Course name length must be at least {{cf.courseName?.errors.minlength.requiredLength}} characters!
Course name length must be no more than {{cInfo['controls'].courseName?.errors.maxlength.requiredLength}} characters!
Enter sertificate url.
Invalid url!