57 const Index agenda_verbosity)
69 for (
const auto & agenda_iterator :
AgendaMap) {
72 && (
wsv_data[wsv_iterator->second].Group() == WsvAgendaGroupIndex)) {
74 agenda.
set_name(agenda_iterator.first);
95 size_t n_methods =
md_data.size();
108 }
catch (
const std::exception &e) {
129 wsv_data[
i].Name() +
" but it is uninitialized.";
142 swap(output[0], input[0]);
149 MRecord mr(
id, output, input, t, a);
151 out3 <<
"- " + m.
Name() +
"\n";
153 out1 <<
"- " + m.
Name() +
"\n";
156 }
catch (
const std::exception &e) {
168 if (old_name !=
"") {
171 dst.
check(*
this, verbosity_at_launch);
187 Index id,
size_t n,
const char *
const *src) {
190 for (
size_t i = 0;
i <
n; ++
i) {
191 dst->operator[](
i) =
String(src[
i]);
200 for (
size_t i = 0;
i <
n; ++
i) {
201 dst->operator[](
i) = src[
i];
210 for (
size_t i = 0;
i <
n; ++
i) {
211 dst->operator[](
i) = src[
i];
221 for (
size_t i = 0;
i < n * m; ++
i) {
227 Index id,
size_t l,
size_t m,
size_t n,
const Numeric *src) {
230 for (
size_t i = 0;
i < l * n * m; ++
i) {
236 Index id,
size_t k,
size_t l,
size_t m,
size_t n,
const Numeric *src) {
239 for (
size_t i = 0;
i < k * l * m *
n; ++
i) {
252 dst->
resize(k, l, m, n, o);
253 for (
size_t i = 0;
i < k * l * m * n * o; ++
i) {
267 dst->
resize(k, l, m, n, o, p);
268 for (
size_t i = 0;
i < k * l * m * n * o * p; ++
i) {
283 dst->
resize(k, l, m, n, o, p, q);
284 for (
size_t i = 0;
i < k * l * m * n * o * p *
q; ++
i) {
295 const int *col_inds) {
302 for (
size_t i = 0;
i < (size_t)nnz; ++
i) {
303 elements[
i] = src[
i];
304 row_indices[
i] = row_inds[
i];
305 column_indices[
i] = col_inds[
i];
331 ws.push_back(stack<WsvStruct *>());
332 push(
ws.size() - 1,
nullptr);
334 ws.back().top()->auto_allocated =
true;
335 ws.back().top()->initialized =
false;
355 while (
ws[i].size()) {
363 ws.erase(
ws.begin() +
i);
374 ws[
i].push(
ws[j].top());
377 ws[j].push(
ws[i].top());
INDEX Index
The type to use for all integer numbers and indices.
static Array< WsvRecord > wsv_data
Global WSV data.
void copy(ConstComplexIterator1D origin, const ConstComplexIterator1D &end, ComplexIterator1D target)
Copy data between begin and end to target.
void execute_callback(Index callback_id)
void define_md_map()
Define MdMap.
String name() const
Agenda name.
const char * execute_agenda(const Agenda *a)
Execute agenda.
Index nelem() const
Number of elements.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
This file contains all declarations of the ARTS C API.
void check(Workspace &ws, const Verbosity &verbosity)
Checks consistency of an agenda.
map< String, Index > AgendaMap
The map associated with agenda_data.
Verbosity verbosity_at_launch
The global message verbosity settings:
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.
void initialize()
Reset the size of the workspace.
const Numeric * get_c_array() const
Conversion to plain C-array.
void initialize()
Initialization dispatch functions.
void(* getaways[])(Workspace &, const MRecord &)
void pop_free(Index i)
Remove the topmost WSV from its stack and free its memory.
bool is_initialized(Index i)
Checks existence of the given WSV.
void set_agenda_verbosity(Index v)
void set_index_variable(Index id, const Index &src)
Deep-copy of Index variable into workspace.
All information for one workspace method.
void set_matrix_variable(Index id, size_t m, size_t n, const Numeric *src)
Deep-copy of Matrix variable into workspace.
void define_species_map()
void initialize_variable(Index id)
Initialize workspace variable.
const String & Name() const
basic_stringstream< char, string_char_traits< char >, alloc > stringstream
void define_agenda_data()
std::string string_buffer
static size_t n_anonymous_variables_
WorkspaceMemoryHandler workspace_memory_handler
The workspace memory handler Defined in workspace_ng.cc.
void expand_md_data_raw_to_md_data()
Expand supergeneric methods.
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
InteractiveWorkspace(const Index verbosity=1, const Index agenda_verbosity=0)
void set_agenda_variable(Index id, const Agenda &src)
Set agenda variable into workspace.
void set_vector_variable(Index id, size_t n, const Numeric *src)
Deep-copy of Vector variable into workspace.
Header file for sparse matrices.
void resize()
Resize workspace stack.
static void define_wsv_data()
Define workspace variables.
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.
static void initialize()
Workspace intialization.
Declarations for agendas.
void * operator[](Index i)
Retrieve a pointer to the given WSV.
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.
void set_file_verbosity(Index v)
void set_main_agenda(bool main_agenda)
bool check_agenda_data()
Check that agendas.cc and workspace.cc are consistent.
void set_numeric_variable(Index id, const Numeric &src)
Deep-copy of Numeric variable into workspace.
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.
void set_array_of_index_variable(Index id, size_t n, const Index *src)
Deep-copy of ArrayOfIndex variable into workspace.
NUMERIC Numeric
The type to use for all floating point numbers.
void * allocate(Index group_index)
Allocate workspace WSV of given group.
Interactive ARTS workspace.
void execute(Workspace &ws) const
Execute an agenda.
Array< String > ArrayOfString
An array of Strings.
const Numeric * get_c_array() const
Conversion to plain C-array.
const Numeric * get_c_array() const
Conversion to plain C-array.
Implementation of Matrix, Vector, and such stuff.
void resize(Index p, Index r, Index c)
Resize function.
void define_species_data()
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.
void define_md_raw_map()
Define MdRawMap.
void deallocate(Index group_index, void *ptr)
Getaway function to call the deallocation function for the WSV group with the given Index...
This can be used to make arrays out of anything.
bool isInternal() const
Indicates the origin of this method.
void push(Index i, void *wsv)
Push a new WSV onto its stack.
void define_wsv_group_names()
Define the array of workspace variable group names.
void set_name(const String &nname)
Set agenda name.
static map< String, Index > WsvMap
Global map associated with wsv_data.
const Numeric * get_c_array() const
Conversion to plain C-array.
void resize(Index n)
Resize function.
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.
void set_array_of_string_variable(Index id, size_t n, const char *const *src)
Deep-copy of ArrayOfString variable into workspace.
const TokVal & SetValue() const
const map< String, Index > WsvGroupMap
The map associated with wsv_group_names.
void define_md_data_raw()
static std::vector< Callback * > callbacks_
const char * execute_workspace_method(long id, const ArrayOfIndex &output, const ArrayOfIndex &input)
Execute workspace method.
Array< stack< WsvStruct * > > ws
Workspace variable container.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
const Array< MdRecord > md_data
Lookup information for workspace methods.
static void define_wsv_map()
Map WSV names to indices.
Index add_variable(Index group_id, const char *name)
Push a stack for a new variable to the workspace.
const Numeric * get_c_array() const
Conversion to plain C-array.
void callback_getaway(Workspace &ws, const MRecord &mr)
void erase_variable(Index i, Index group_id)
Remove a variable stack from the workspace.
This class contains all static information for one workspace variable.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
The WorkspaceMemoryHandler.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
This stores arbitrary token values and remembers the type.
void swap(Index i, Index j)
Remove a variable stack from the workspace.
Handling of workspace memory.
void resize(Index b, Index p, Index r, Index c)
Resize function.
Declaration of the class MdRecord.
void insert_elements(Index nnz, const ArrayOfIndex &rowind, const ArrayOfIndex &colind, ConstVectorView data)
Insert vector of elements with given row and column indices.
my_basic_string< char > String
The String type for ARTS.
Declarations for AgRecord, storing lookup information for one agenda.
Index get_wsv_id(const char *)
Get index of WSV.
void set_string_variable(Index id, const char *src)
Deep-copy of String variable into workspace.
void set_screen_verbosity(Index v)
void resize(Index r, Index c)
Resize function.
const Numeric * get_c_array() const
Conversion to plain C-array.