Go to the documentation of this file.
32 unsigned long n_args_out,
34 unsigned long n_args_in,
35 const long *args_in) {
36 output.reserve(n_args_out);
37 for (
size_t i = 0; i < n_args_out; ++i) {
38 output.push_back(args_out[i]);
40 input.reserve(n_args_in);
41 for (
size_t i = 0; i < n_args_in; ++i) {
42 input.push_back(args_in[i]);
81 }
catch (
const std::exception &e) {
109 *
reinterpret_cast<Agenda *
>(workspace->operator[](id));
110 mr =
MRecord(m_id, output, input, t, agenda);
114 t =
TokVal(*
reinterpret_cast<Index *
>(workspace->operator[](
id)));
118 t =
TokVal(*
reinterpret_cast<Numeric *
>(workspace->operator[](
id)));
126 t =
TokVal(*
reinterpret_cast<String *
>(workspace->operator[](
id)));
138 t =
TokVal(*
reinterpret_cast<Vector *
>(workspace->operator[](
id)));
142 t =
TokVal(*
reinterpret_cast<Matrix *
>(workspace->operator[](
id)));
159 unsigned long n_output_args,
160 const long *output_args,
161 unsigned long n_input_args,
162 const long *input_args) {
166 output, input, n_output_args, output_args, n_input_args, input_args);
192 const Index agenda_verbosity) {
214 md_data[i].Description().c_str(),
231 m.g_in_types = &
md_data[i].GInType()[0];
237 m.g_out_types = &
md_data[i].GOutType()[0];
243 return md_data[i].GIn()[j].c_str();
247 return md_data[i].GIn()[j].c_str();
251 return md_data[i].GInDefault()[j].c_str();
255 return md_data[i].GIn()[j].c_str();
259 return md_data[i].GOut()[j].c_str();
264 unsigned long n_args_out,
265 const long *args_out,
266 unsigned long n_args_in,
267 const long *args_in) {
270 output, input, n_args_out, args_out, n_args_in, args_in);
275 std::stringstream ss;
310 if (value.initialized) {
311 value.ptr = workspace->operator[](id);
316 if (value.initialized) {
318 reinterpret_cast<ArrayOfIndex *
>(workspace->operator[](id));
319 value.dimensions[0] = a->size();
320 value.ptr = a->data();
325 if (value.initialized) {
327 reinterpret_cast<String *
>(workspace->operator[](id))->c_str();
332 if (value.initialized) {
333 value.ptr =
reinterpret_cast<Numeric *
>(workspace->operator[](id));
338 if (value.initialized) {
339 Vector *v =
reinterpret_cast<Vector *
>(workspace->operator[](id));
340 value.dimensions[0] = v->
nelem();
348 if (value.initialized) {
349 Matrix *m =
reinterpret_cast<Matrix *
>(workspace->operator[](id));
350 value.dimensions[0] = m->
nrows();
351 value.dimensions[1] = m->
ncols();
359 if (value.initialized) {
360 Tensor3 *t =
reinterpret_cast<Tensor3 *
>(workspace->operator[](id));
361 value.dimensions[0] = t->
npages();
362 value.dimensions[1] = t->
nrows();
363 value.dimensions[2] = t->
ncols();
371 if (value.initialized) {
372 Tensor4 *t =
reinterpret_cast<Tensor4 *
>(workspace->operator[](id));
373 value.dimensions[0] = t->
nbooks();
374 value.dimensions[1] = t->
npages();
375 value.dimensions[2] = t->
nrows();
376 value.dimensions[3] = t->
ncols();
384 if (value.initialized) {
385 Tensor5 *t =
reinterpret_cast<Tensor5 *
>(workspace->operator[](id));
386 value.dimensions[0] = t->
nshelves();
387 value.dimensions[1] = t->
nbooks();
388 value.dimensions[2] = t->
npages();
389 value.dimensions[3] = t->
nrows();
390 value.dimensions[4] = t->
ncols();
398 if (value.initialized) {
399 Tensor6 *t =
reinterpret_cast<Tensor6 *
>(workspace->operator[](id));
401 value.dimensions[1] = t->
nshelves();
402 value.dimensions[2] = t->
nbooks();
403 value.dimensions[3] = t->
npages();
404 value.dimensions[4] = t->
nrows();
405 value.dimensions[5] = t->
ncols();
414 if (value.initialized) {
415 Tensor7 *t =
reinterpret_cast<Tensor7 *
>(workspace->operator[](id));
418 value.dimensions[2] = t->
nshelves();
419 value.dimensions[3] = t->
nbooks();
420 value.dimensions[4] = t->
npages();
421 value.dimensions[5] = t->
nrows();
422 value.dimensions[6] = t->
ncols();
431 if (value.initialized) {
432 Sparse *s =
reinterpret_cast<Sparse *
>(workspace->operator[](id));
433 value.dimensions[0] = s->
nrows();
434 value.dimensions[1] = s->
ncols();
435 value.dimensions[2] = s->
nnz();
443 if (value.initialized) {
451 value.dimensions[0] = blocks.size();
452 value.dimensions[1] = inv_blocks.size();
453 value.inner_ptr =
reinterpret_cast<int *
>(blocks.data());
456 if (value.initialized) {
457 value.ptr = workspace->operator[](id);
464 return workspace->operator[](id);
470 std::vector<Block> &blocks =
473 if ((block_index < 0) || ((
size_t)block_index >= blocks.size())) {
474 throw std::runtime_error(
"The block index is invalid.");
476 Block &block = blocks[block_index];
484 int *inner_ptr =
nullptr;
485 int *outer_ptr =
nullptr;
507 b.inner_ptr = inner_ptr;
508 b.outer_ptr = outer_ptr;
517 if (value.
ptr ==
nullptr) {
525 }
catch (
const std::exception &e) {
532 const Index *ptr =
reinterpret_cast<const Index *
>(value.
ptr);
542 const char *ptr =
reinterpret_cast<const char *
>(value.
ptr);
547 const char *
const *ptr =
reinterpret_cast<const char *
const *
>(value.
ptr);
552 const Index *ptr =
reinterpret_cast<const Index *
>(value.
ptr);
630 "This variable can currently not be set through the C API."
631 " Signal your need to ARTS dev mailing list.");
653 version_string = version_string.substr(5, std::string::npos);
654 size_t dash_pos = version_string.find(
'.');
656 static_cast<Index>(std::stoi(version_string.substr(0, dash_pos)));
658 version_string = version_string.substr(dash_pos + 1, std::string::npos);
659 dash_pos = version_string.find(
'.');
661 static_cast<Index>(std::stoi(version_string.substr(0, dash_pos)));
663 version_string = version_string.substr(dash_pos + 1, std::string::npos);
665 std::stoi(version_string.substr(0, std::string::npos)));
void set_string_variable(Index id, const char *src)
Deep-copy of String variable into workspace.
InteractiveWorkspace * create_workspace(const Index verbosity, const Index agenda_verbosity)
Create new workspace.
const char * get_method_g_out(Index i, Index j)
Get name value of generic output argument.
const Matrix & get_dense() const
DLL_PUBLIC VersionStruct get_version()
Get ARTS Version.
void agenda_append(Agenda *dst, const Agenda *src)
Append agendas.
Index nshelves() const
Returns the number of shelves.
static Array< WsvRecord > wsv_data
Global WSV data.
VariableValueStruct get_variable_value(InteractiveWorkspace *workspace, Index id, Index group_id)
Get value WSV in given workspace.
std::string string_buffer
Index nshelves() const
Returns the number of shelves.
Index nbooks() const
Returns the number of books.
long revision
Revision number.
void push_back(const MRecord &n)
Append a new method to end of list.
const char * execute_agenda(const Agenda *a)
Execute agenda.
const Sparse & get_sparse() const
String out_basename
The basename for the report file and for all other output files.
Index ncols() const
Returns the number of columns.
This stores arbitrary token values and remembers the type.
int * get_column_index_pointer()
int * get_row_start_pointer()
Agenda * create_agenda(const char *name)
Create Agenda.
Index ncols() const
Returns the number of columns.
Index npages() const
Returns the number of pages.
Structure to hold all command line Parameters.
Index ncols() const
Returns the number of columns.
Range get_column_range() const
const char * get_method_g_in_default(Index i, Index j)
Get default value of generic input argument.
Verbosity verbosity(Workspace &ws) noexcept
void data_path_pop()
Remove last data path.
Index nrows() const
Returns the number of rows.
void initialize_variable(Index id)
Initialize workspace variable.
#define ARTS_FULL_VERSION
void include_path_push(const char *path)
Add include path.
MatrixType get_matrix_type() const
void set_tensor7_variable(Index id, size_t k, size_t l, size_t m, size_t n, size_t o, size_t p, size_t q, const Numeric *src)
Deep-copy of Tensor5 variable into workspace.
Index nrows() const
Returns the number of rows.
Agenda * parse_agenda(const char *filename)
Parse Controlfile.
long major
Major version number of ARTS.
Parameters parameters
Holds the command line parameters.
const int * inner_ptr
Additional array data for sparse matrices.
void set_agenda_variable(Index id, const Agenda &src)
Set agenda variable into workspace.
Index npages() const
Returns the number of pages.
void set_matrix_variable(Index id, size_t m, size_t n, const Numeric *src)
Deep-copy of Matrix variable into workspace.
const void * ptr
Data pointer.
void finalize()
Finalize ARTS runtime.
Index npages() const
Returns the number of pages.
constexpr Index get_start() const
Returns the start index of the range.
Index nlibraries() const
Returns the number of libraries.
Representation of ARTS WSVs.
void set_index_variable(Index id, const Index &src)
Deep-copy of Index variable into workspace.
void * get_variable_data_pointer(InteractiveWorkspace *workspace, Index id)
Get data pointer to the WSV variable.
Index Group() const
The wsv group to which this variable belongs.
std::vector< Method > methods()
VariableStruct get_variable(Index i)
Get WSV by index.
void set_vector_variable(Index id, size_t n, const Numeric *src)
Deep-copy of Vector variable into workspace.
Index nvitrines() const
Returns the number of vitrines.
Declarations for agendas.
const char * get_group_name(int i)
Get pointer to name of given group.
const char * get_method_in(Index i, Index j)
bool empty() const
Check if variable is empty.
Index get_wsv_id(const char *)
Get index of WSV.
Index nnz() const
Returns the number of nonzero elements.
static void initialize()
Workspace intialization.
void set_array_of_index_variable(Index id, size_t n, const Index *src)
Deep-copy of ArrayOfIndex variable into workspace.
Index ncols() const
Returns the number of columns.
void data_path_push(const char *path)
Add data path.
long add_variable(InteractiveWorkspace *workspace, long group_id, const char *name)
Add variable of given type to workspace.
Representation of ARTS values.
bool empty() const
Check if variable is empty.
const Numeric * get_c_array() const
Conversion to plain C-array.
void set_tensor5_variable(Index id, size_t k, size_t l, size_t m, size_t n, size_t o, const Numeric *src)
Deep-copy of Tensor5 variable into workspace.
Index nelem() const
Returns the number of elements.
const map< String, Index > MdMap
The map associated with md_data.
const String & Name() const
Name of this workspace variable.
const char * set_variable_value(InteractiveWorkspace *workspace, long id, long group_id, VariableValueStruct value)
Sets the value of a WSV in a given workspace.
Index nvitrines() const
Returns the number of vitrines.
Numeric * get_element_pointer()
const char * get_method_g_in(Index i, Index j)
Get name of generic input argument.
Range get_row_range() const
void set_numeric_variable(Index id, const Numeric &src)
Deep-copy of Numeric variable into workspace.
Index ncols() const
Returns the number of columns.
bool empty() const
Check if variable is empty.
Index npages() const
Returns the number of pages.
const int * outer_ptr
Additional array data for sparse matrices.
void parse_tasklist()
Public interface to the main function of the parser.
unsigned long get_number_of_groups()
Return number of WSV groups.
NUMERIC Numeric
The type to use for all floating point numbers.
Index npages() const
Returns the number of pages.
Verbosity verbosity_at_launch
The global message verbosity settings:
void set_tensor3_variable(Index id, size_t l, size_t m, size_t n, const Numeric *src)
Deep-copy of Tensor3 variable into workspace.
unsigned long get_number_of_methods()
Return number of WSMs.
Index nbooks() const
Returns the number of books.
void set_sparse_variable(Index id, Index m, Index n, Index nnz, const Numeric *src, const int *row_indices, const int *column_indices)
Deep-copy of Sparse matrix into workspace.
const Numeric * get_c_array() const
Conversion to plain C-array.
const Numeric * get_c_array() const
Conversion to plain C-array.
void initialize()
Initalize ARTS runtime.
void destroy_workspace(InteractiveWorkspace *workspace)
Destroy given workspace.
unsigned long get_number_of_variables()
Number of defined WSVs.
void set_tensor6_variable(Index id, size_t k, size_t l, size_t m, size_t n, size_t o, size_t p, const Numeric *src)
Deep-copy of Tensor6 variable into workspace.
This file contains header information for the dealing with command line parameters.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
Index nrows() const
Returns the number of rows.
bool empty() const
Returns true if variable size is zero.
DLL_PUBLIC void erase_variable(InteractiveWorkspace *workspace, long id, long group_id)
Erase variable from workspace.
Index nbooks() const
Returns the number of books.
constexpr Index get_extent() const
Returns the extent of the range.
const Array< MdRecord > md_data
Lookup information for workspace methods.
Index nrows() const
Returns the number of rows.
void destroy_agenda(Agenda *a)
Destroy Agenda.
const char * method_print_doc(long id)
Print method documentation.
void agenda_clear(Agenda *a)
Clear Agenda.
long minor
Minor version number of this ARTS major version.
const char * execute_workspace_method(long id, const ArrayOfIndex &output, const ArrayOfIndex &input)
Execute workspace method.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
void set_tensor4_variable(Index id, size_t k, size_t l, size_t m, size_t n, const Numeric *src)
Deep-copy of Tensor4 variable into workspace.
static Index add_callback(Callback *cb)
Add callback to workspace.
This class contains all static information for one workspace variable.
void set_array_of_string_variable(Index id, size_t n, const char *const *src)
Deep-copy of ArrayOfString variable into workspace.
This file contains the Workspace class.
Index nrows() const
Returns the number of rows.
long dimensions[7]
Dimensions of array data.
void agenda_insert_set(InteractiveWorkspace *workspace, Agenda *a, long id, long group_id)
Insert a set method into an agenda.
MethodStruct get_method(Index i)
Return MethodStruct describing method with index i.
Index nshelves() const
Returns the number of shelves.
Index ncols() const
Returns the number of columns.
const String & Description() const
A text describing this workspace variable.
long lookup_workspace_variable(const char *s)
Lookup workspace variable by name.
const char * execute_agenda(InteractiveWorkspace *workspace, const Agenda *a)
Execute Agenda.
void erase_variable(Index i, Index group_id)
Remove a variable stack from the workspace.
my_basic_string< char > String
The String type for ARTS.
bool empty() const
Returns true if variable size is zero.
static map< String, Index > WsvMap
Global map associated with wsv_data.
Representation of workspace methods.
void set_name(const String &nname)
Set agenda name.
const char * execute_workspace_method(InteractiveWorkspace *workspace, long id, unsigned long n_args_out, const long *args_out, unsigned long n_args_in, const long *args_in)
Execute workspace method.
void agenda_insert_callback(Agenda *a, void(*f)(InteractiveWorkspace *))
Insert callback into agenda.
void agenda_add_method(Agenda *a, const long id, unsigned long n_output_args, const long *output_args, unsigned long n_input_args, const long *input_args)
void copy_output_and_input(ArrayOfIndex &output, ArrayOfIndex &input, unsigned long n_args_out, const long *args_out, unsigned long n_args_in, const long *args_in)
INDEX Index
The type to use for all integer numbers and indices.
IndexPair get_indices() const
void set_basename(const char *name)
Set the ARTS basename.
const char * get_error()
Get most recent error.
Index nrows() const
Returns the number of rows.
const Array< MRecord > & Methods() const
const ArrayOfString wsv_group_names
The names associated with Wsv groups as Strings.
std::vector< Block > & get_inverse_blocks()
Blocks of the inverse covariance matrix.
bool empty() const
Check if variable is empty.
const Numeric * get_c_array() const
Conversion to plain C-array.
std::vector< Block > & get_blocks()
Block in the covariance matrix.
ArrayOfString includepath
List of paths to search for include files.
const Numeric * get_c_array() const
Conversion to plain C-array.
long indices[2]
Quantity indices.
const char * get_method_out(Index i, Index j)
ArrayOfString datapath
List of paths to search for data files.
bool is_initialized(Index i)
Checks existence of the given WSV.
CovarianceMatrixBlockStruct get_covariance_matrix_block(CovarianceMatrix *m, long block_index, bool inverse)
Return block of covariance matrix.
const Numeric * get_c_array() const
Conversion to plain C-array.
Index ncols() const
Returns the number of columns.
This file contains all declarations of the ARTS C API.
void include_path_pop()
Remove last include path.
const Numeric * get_c_array() const
Conversion to plain C-array, const-version.
Index add_variable(Index group_id, const char *name)
Push a stack for a new variable to the workspace.
The global header file for ARTS.
Interactive ARTS workspace.
bool empty() const
Check if variable is empty.