ARTS 2.5.4 (git: 4c0d3b4d)
Array< base > Class Template Reference

This can be used to make arrays out of anything. More...

#include <array.h>

Inheritance diagram for Array< base >:

Public Member Functions

 Array ()
 
 Array (Index n)
 
 Array (Index n, const base &fillvalue)
 Constructor filling with constant value. More...
 
 Array (const Array< base > &A)
 
 Array (Array< base > &&A) noexcept
 
 Array (std::initializer_list< base > init)
 
template<class base2 , size_t N>
 Array (const std::array< base2, N > &input)
 
 Array (std::vector< base > x)
 
Arrayoperator= (base x)
 Assignment from base type (fill entire Array with this value). More...
 
Arrayoperator= (const Array< base > &A)
 Assignment from another Array. More...
 
Arrayoperator= (Array< base > &&A) noexcept
 
Index nelem () const ARTS_NOEXCEPT
 Number of elements. More...
 
const base & operator[] (const Index n) const
 Constant index operator. More...
 
base & operator[] (const Index n)
 Non-constant index operator. More...
 
void push_back_n (const base &elem, const Index n)
 Append element n times. More...
 
virtual ~Array ()=default
 

Detailed Description

template<class base>
class Array< base >

This can be used to make arrays out of anything.

A simple #define does not do for this, since I have to implement member functions like nelem, in order to be consistent with Vector.

Because constructors are not inherited, I have to re-define all constructors.

Definition at line 108 of file array.h.

Constructor & Destructor Documentation

◆ Array() [1/8]

template<class base >
Array< base >::Array ( )
inline

Definition at line 111 of file array.h.

◆ Array() [2/8]

template<class base >
Array< base >::Array ( Index  n)
inlineexplicit

Definition at line 113 of file array.h.

◆ Array() [3/8]

template<class base >
Array< base >::Array ( Index  n,
const base &  fillvalue 
)
inline

Constructor filling with constant value.

Definition at line 152 of file array.h.

References Zeeman::end().

◆ Array() [4/8]

template<class base >
Array< base >::Array ( const Array< base > &  A)
inline

Definition at line 116 of file array.h.

◆ Array() [5/8]

template<class base >
Array< base >::Array ( Array< base > &&  A)
inlinenoexcept

Definition at line 118 of file array.h.

◆ Array() [6/8]

template<class base >
Array< base >::Array ( std::initializer_list< base >  init)
inline

Definition at line 121 of file array.h.

◆ Array() [7/8]

template<class base >
template<class base2 , size_t N>
Array< base >::Array ( const std::array< base2, N > &  input)
inlineexplicit

Definition at line 124 of file array.h.

◆ Array() [8/8]

template<class base >
Array< base >::Array ( std::vector< base >  x)
inline

Definition at line 128 of file array.h.

◆ ~Array()

template<class base >
virtual Array< base >::~Array ( )
virtualdefault

Member Function Documentation

◆ nelem()

template<class base >
Index Array< base >::nelem
inline

Number of elements.

Definition at line 197 of file array.h.

References ARTS_ASSERT.

Referenced by abs_cia_dataReadFromCIA(), abs_cia_dataReadFromXML(), abs_coefCalcFromXsec(), abs_hitran_relmat_dataReadHitranRelmatDataAndLines(), abs_lines_per_speciesChangeBaseParameterForMatchingLevels(), abs_lines_per_speciesChangeBaseParameterForSpecies(), abs_lines_per_speciesCreateFromLines(), abs_lines_per_speciesMakeManualMirroringSpecies(), abs_lines_per_speciesSetBaseParameterForMatchingLevels(), abs_lines_per_speciesSetBaseParameterForSpecies(), abs_lines_per_speciesSetCutoffForSpecies(), abs_lines_per_speciesSetEmpty(), abs_lines_per_speciesSetLinemixingLimitForSpecies(), abs_lines_per_speciesSetLineShapeTypeForSpecies(), abs_lines_per_speciesSetMirroringForSpecies(), abs_lines_per_speciesSetNormalizationForSpecies(), abs_lines_per_speciesSetPopulationForSpecies(), abs_lines_per_speciesSetT0ForSpecies(), abs_lines_per_speciesSetZeemanCoefficients(), abs_linesChangeBaseParameterForMatchingLevels(), abs_linesFlatten(), abs_linesRemoveBand(), abs_linesRemoveLinesFromSpecies(), abs_linesReplaceBands(), abs_linesReplaceLines(), abs_linesSetBaseParameterForMatchingLevels(), abs_linesSetZeemanCoefficients(), abs_linesWriteSpeciesSplitXML(), abs_lookupSetup(), abs_lookupSetupBatch(), abs_speciesAdd(), abs_speciesAdd2(), abs_speciesSet(), abs_xsec_agenda_checkedCalc(), abs_xsec_per_speciesAddCIA(), abs_xsec_per_speciesAddConts(), abs_xsec_per_speciesAddHitranXsec(), abs_xsec_per_speciesAddLines(), abs_xsec_per_speciesInit(), GasAbsLookup::Adapt(), adapt_stepwise_partial_derivatives(), ArtsXMLTag::add_attribute(), Workspace::add_wsv(), SourceText::AdvanceChar(), SourceText::AdvanceLine(), AgRecord::AgRecord(), antenna1d_matrix(), antenna2d_interp_response(), Append(), SourceText::AppendFile(), apply_iy_unit(), apply_iy_unit2(), ArrayOfAgendaAppend(), ArrayOfAgendaExecute(), ArrayOfGriddedFieldGetNames(), ArrayOfIndexExtractFromArrayOfArrayOfIndex(), ArrayOfIndexLinSpace(), ArrayOfSpeciesTag::ArrayOfSpeciesTag(), atm_fields_compactAddConstant(), atm_fields_compactAddSpecies(), atm_fields_compactExpand(), atm_fields_compactFromMatrix(), atmfields_checkedCalc(), AtmFieldsAndParticleBulkPropFieldFromCompact(), AtmFieldsCalc(), AtmFieldsCalcExpand1D(), AtmRawRead(), AtmWithNLTERawRead(), Raw::Average::avg(), batch_atm_fields_compactAddConstant(), batch_atm_fields_compactAddSpecies(), batch_atm_fields_compactCleanup(), batch_atm_fields_compactFromArrayOfMatrix(), bulk_backscatter_derivative(), Raw::Calibration::caha(), calcBaselineFit(), Agenda::check(), check_abs_species(), check_and_add_block(), check_disort_input(), check_retrieval_grids(), CheckUnique(), chk_contains(), chk_pnd_field_raw_only_in_cloudbox(), chk_pnd_raw_data(), chk_scattering_data(), chk_size(), choose_abs_nls(), cia_get_index(), CIAInfo(), cloud_atm_vars_by_gp(), cloud_fieldsCalc(), cloud_RT_no_background(), cloudbox_checkedCalc(), cloudbox_field_monoOptimizeReverse(), cloudbox_field_monoSetConst(), cloudbox_fieldUpdate1D(), cloudbox_fieldUpdateSeq1D(), cloudbox_fieldUpdateSeq3D(), cloudboxOff(), collision_coefficientsFromSplitFiles(), lm_hitran_2017::compabs(), compute_transmission_matrix_and_derivative(), TelsemAtlas::contains(), continua_model_error_message(), Raw::Average::cov(), covmat_sxAddBlock(), covmat_sxAddInverseBlock(), cumulative_transmission(), CIARecord::Dataset(), CIARecord::DatasetCount(), define_md_map(), define_wsv_group_map(), Workspace::define_wsv_map(), diy_from_path_to_rgrids(), diy_from_pos_to_rgrids(), doit_scat_fieldCalc(), doit_scat_fieldCalcLimb(), DoitInit(), DoitScatteringDataPrepare(), DoitWriteIterationFields(), dsurface_check(), Absorption::LineMixing::ecs_absorption(), ecs_dataSetMeanAir(), Agenda::execute(), expand_md_data_raw_to_md_data(), ext_abs_pfun_from_tro(), Extract(), GasAbsLookup::Extract(), XsecRecord::Extract(), CIARecord::Extract(), ExtractFromMetaSingleScatSpecies(), f_gridFromSensorAMSU(), f_gridFromSensorAMSUgeneric(), f_gridFromSensorHIRS(), f_gridMetMM(), field_of_propagation(), FieldFromGriddedField(), SourceText::File(), find_all(), find_effective_channel_boundaries(), find_file(), find_first(), Raw::Reduce::find_first_and_last_1(), find_new_grid_in_old_grid(), find_nonlinear_continua(), find_xml_file(), find_xml_file_existence(), Flatten(), FlattenedIndex(), CIARecord::FrequencyGrid(), get_angs(), get_array_groups_as_string(), get_dirname(), get_gp_atmgrids_to_rq(), get_gp_atmsurf_to_rq(), get_gp_rq_to_atmgrids(), GriddedField::get_grid_size(), get_iy_of_background(), get_parameters(), get_pointers_for_analytical_species(), get_pointers_for_scat_species(), get_ppath_cloudvars(), get_standard_diy_dpath(), get_standard_starting_diy_dx(), get_stepwise_scattersky_source(), EnergyLevelMap::get_vibtemp_params(), SourceText::GetSourceLine(), gp4length1grid(), GriddedFieldLatLonExpand(), GriddedFieldLatLonRegrid(), GriddedFieldPRegrid(), gridpos_upperend_check(), hitran_xsec_get_index(), HydrotableCalc(), IndexSetToLast(), SourceText::Init(), Workspace::initialize(), insert_elements(), interp(), interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interp_atmsurface_by_itw(), interp_atmsurface_gp2itw(), interp_cloud_coeff1D(), EnergyLevelMap::InterpToGridPos(), interpweights(), is_anyptype_nonTotRan(), is_increasing(), Agenda::is_input(), is_inside_cloudbox(), Agenda::is_output(), is_size(), is_unique(), is_valid_keyword_group(), iy_surface_agenda_arrayExecute(), iy_transmitterMultiplePol(), iy_transmitterSinglePol(), iyb_calc(), iyEmissionHybrid(), iyEmissionStandard(), iyInterpCloudboxField(), iyLoopFrequencies(), iyMC(), iyRadarSingleScat(), iyReplaceFromAux(), iySurfaceCallAgendaX(), iySurfaceFastem(), iySurfaceRtpropCalc(), iyTransmissionStandard(), jac_ranges_indices(), jacobian_type_extrapol(), jacobianAddAbsSpecies(), jacobianAddBasicCatalogParameter(), jacobianAddBasicCatalogParameters(), jacobianAddFreqShift(), jacobianAddFreqStretch(), jacobianAddMagField(), jacobianAddNLTE(), jacobianAddPointingZa(), jacobianAddPolyfit(), jacobianAddScatSpecies(), jacobianAddShapeCatalogParameters(), jacobianAddSinefit(), jacobianAddSpecialSpecies(), jacobianAddSurfaceQuantity(), jacobianAddTemperature(), jacobianAddWind(), jacobianAdjustAndTransform(), jacobianCalcFreqShift(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), jacobianCalcSinefit(), jacobianFromYbatch(), jacobianSetAffineTransformation(), last(), lbl_checkedCalc(), line_irradianceCalcForSingleSpeciesNonOverlappingLinesPseudo2D(), main(), MCGeneral(), MdRecord::MdRecord(), Raw::Average::median(), met_mm_polarisation_hmatrix(), Raw::Average::nanavg(), Raw::Average::nanmedian(), Raw::Average::nanvar(), nca_get_data_ArrayOfArrayOfSpeciesTag(), nca_write_to_file(), Agenda::nelem(), RetrievalQuantity::nelem(), nelemGet(), nlte_collision_factorsCalcFromCoeffs(), nlte_fieldForSingleSpeciesNonOverlappingLines(), nlte_positions_in_statistical_equilibrium_matrix(), nlte_sourceFromTemperatureAndSrcCoefPerSpecies(), Absorption::Lines::NumBroadeners(), EnergyLevelMap::OK(), open_input_file(), operator<<(), ComplexVector::operator=(), Vector::operator=(), MRecord::operator=(), operator>>(), Array< base >::operator[](), opt_prop_Bulk(), opt_prop_bulkCalc(), opt_prop_NScatElems(), opt_prop_ScatSpecBulk(), opt_prop_sptFromData(), opt_prop_sptFromMonoData(), opt_prop_sptFromScat_data(), OptimizeDoitPressureGrid(), option_input(), option_methods(), option_workspacevariables(), ArtsParser::parse_agenda(), ArtsParser::parse_generic_input(), ArtsParser::parse_generic_output(), ArtsParser::parse_intvector_from_string(), ArtsParser::parse_method_args(), ArtsParser::parse_numvector(), ArtsParser::parse_numvector_from_string(), ArtsParser::parse_stringarray_from_string(), particle_bulkprop_fieldClip(), particle_bulkpropRadarOnionPeeling(), particle_massesFromMetaData(), particle_massesFromMetaDataSingleCategory(), pha_mat_Bulk(), pha_mat_NScatElems(), pha_mat_ScatSpecBulk(), pha_mat_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), pha_mat_sptFromScat_data(), pnd_agenda_arrayExecute(), pnd_fieldCalcFromParticleBulkProps(), pnd_fieldCalcFrompnd_field_raw(), pnd_fieldZero(), pndFromPsd(), ppath_calc(), ppath_step_refr_1d(), ppath_step_refr_2d(), ppath_step_refr_3d(), ppathPlaneParallel(), Agenda::print(), MRecord::print(), Print(), MdRecord::PrintTemplate(), propmat_clearsky_fieldCalc(), propmat_clearskyAddFaraday(), propmat_clearskyAddFromAbsCoefPerSpecies(), propmat_clearskyAddFromLookup(), propmat_clearskyAddHitranLineMixingLines(), propmat_clearskyAddHitranXsec(), propmat_clearskyAddLines(), propmat_clearskyAddOnTheFlyLineMixing(), propmat_clearskyAddOnTheFlyLineMixingWithZeeman(), propmat_clearskyAddParticles(), propmat_clearskyAddPredefined(), propmat_clearskyAddXsecAgenda(), propmat_clearskyAddZeeman(), propmat_clearskyInit(), psd_mono_common(), psdMilbrandtYau05(), psdSeifertBeheng06(), RadarOnionPeelingTableCalc(), SourceText::reachedEot(), ReadArrayOfARTSCAT(), ReadARTSCAT(), ReadHITRAN(), Reduce(), refr_index_airMicrowavesEarth(), regrid_atmfield_by_gp(), regrid_atmfield_by_gp_oem(), regrid_atmsurf_by_gp(), regrid_atmsurf_by_gp_oem(), remove_impl(), retrievalAddAbsSpecies(), retrievalAddCatalogParameters(), retrievalAddFreqShift(), retrievalAddFreqStretch(), retrievalAddMagField(), retrievalAddPointingZa(), retrievalAddScatSpecies(), retrievalAddSpecialSpecies(), retrievalAddSurfaceQuantity(), retrievalAddTemperature(), retrievalAddWind(), rtmethods_jacobian_finalisation(), run_cdisort(), scat_data_checkedCalc(), scat_data_monoExtract(), scat_dataCalc(), scat_dataCheck(), scat_dataReduceT(), ScatElementsPndAndScatAdd(), ScatElementsSelect(), ScatElementsToabs_speciesAdd(), ScatSpeciesExtendTemperature(), ScatSpeciesMerge(), ScatSpeciesPndAndScatAdd(), ScatSpeciesScatAndMetaRead(), ScatSpeciesSizeMassInfo(), Select(), Absorption::Lines::SelfVMR(), sensor_aux_vectors(), sensor_checkedCalc(), sensor_responseAntenna(), sensor_responseBackend(), sensor_responseFillFgrid(), sensor_responseFrequencySwitching(), sensor_responseGenericAMSU(), sensor_responseMetMM(), sensor_responseMixer(), sensor_responseMixerBackendPrecalcWeights(), sensor_responseMultiMixerBackend(), sensor_responsePolarisation(), sensor_responseStokesRotation(), sensor_responseWMRF(), set_backscatter_radiation_vector(), Agenda::set_outputs_to_push_and_dup(), setup_retrieval_1D(), spectrometer_matrix(), stepwise_source(), stepwise_transmission(), stokes2pol(), MdRecord::subst_any_with_group(), MdRecord::subst_any_with_specific_group(), surface_props_check(), surface_props_interp(), surface_rtprop_agenda_arrayExecute(), surface_rtpropCallAgendaX(), SurfaceDummy(), ArtsParser::tasklist_insert_set_delete(), CIARecord::TemperatureGrid(), test01(), test05(), test06(), test09(), test12(), test_agenda_arrayExecute(), TestArrayOfAgenda(), time_steps(), time_vector(), TimeSortTemplate(), transform_jacobian(), transform_x(), transform_x_back(), transmittanceFromIy_aux(), Raw::Average::var(), VectorInsertGridPoints(), vmr_fieldClip(), vmr_fieldPerturb(), vmr_fieldPerturbAtmGrids(), WMRFSelectChannels(), write_method_header(), write_method_header_documentation(), x2artsAtmAndSurf(), x2artsSensor(), xClip(), xml_write_to_stream(), yApplySensorPol(), ybatchColdAtmHotAtmCycle(), ybatchMetProfiles(), ybatchMetProfilesClear(), ybatchTimeAveraging(), ybatchTroposphericCorrectionNaiveMedianForward(), ybatchTroposphericCorrectionNaiveMedianInverse(), yCalc(), yCalcAppend(), yRadar(), za_gridOpt(), and zeeman_on_the_fly().

◆ operator=() [1/3]

template<class base >
Array< base > & Array< base >::operator= ( Array< base > &&  A)
inlinenoexcept

Definition at line 190 of file array.h.

◆ operator=() [2/3]

template<class base >
Array< base > & Array< base >::operator= ( base  x)
inline

Assignment from base type (fill entire Array with this value).

Definition at line 160 of file array.h.

References Zeeman::end().

Referenced by ArrayOfSpeciesTag::operator=().

◆ operator=() [3/3]

template<class base >
Array< base > & Array< base >::operator= ( const Array< base > &  A)
inline

Assignment from another Array.

This will adjust the size of the array automatically, so that structures containing arrays can be correctly copied without having an explicit assignment operator.

This is a deviation from the old ARTS paradigm that sizes must match exactly before copying!

Parameters
AThe other array to copy to this one.
Returns
The freshly copied array (normally not used).
Author
Stefan Buehler
Date
2002-12-19

Definition at line 182 of file array.h.

References copy().

◆ operator[]() [1/2]

template<class base >
base & Array< base >::operator[] ( const Index  n)
inline

Non-constant index operator.

We redefine this here so that we can have range checking by assert.

Definition at line 215 of file array.h.

References ARTS_ASSERT, and Array< base >::nelem().

◆ operator[]() [2/2]

template<class base >
const base & Array< base >::operator[] ( const Index  n) const
inline

Constant index operator.

We redifine this here so that we can have range checking by assert.

Definition at line 206 of file array.h.

References ARTS_ASSERT, and Array< base >::nelem().

◆ push_back_n()

template<class base >
void Array< base >::push_back_n ( const base &  elem,
const Index  n 
)
inline

Append element n times.

Definition at line 223 of file array.h.


The documentation for this class was generated from the following file: