#include <matpackI.h>
Public Types | |
typedef ConstIterator1D | const_iterator |
Public Member Functions | |
Index | nelem () const |
Returns the number of elements. | |
Numeric | sum () const |
The sum of all elements of a Vector. | |
Numeric | operator[] (Index n) const |
Plain const index operator. | |
ConstVectorView | operator[] (const Range &r) const |
Const index operator for subrange. | |
ConstIterator1D | begin () const |
Return const iterator to first element. | |
ConstIterator1D | end () const |
Return const iterator behind last element. | |
operator ConstMatrixView () const | |
Conversion to const 1 column matrix. | |
virtual | ~ConstVectorView () |
Destructor. | |
ConstVectorView (const Numeric &a) | |
A special constructor, which allows to make a ConstVectorView from a scalar. | |
Protected Member Functions | |
ConstVectorView () | |
Default constructor. | |
ConstVectorView (Numeric *data, const Range &range) | |
Explicit constructor. | |
ConstVectorView (Numeric *data, const Range &p, const Range &n) | |
Recursive constructor. | |
Protected Attributes | |
Range | mrange |
The range of mdata that is actually used. | |
Numeric * | mdata |
Pointer to the plain C array that holds the data. | |
Friends | |
class | VectorView |
class | ConstIterator2D |
class | ConstMatrixView |
class | ConstTensor3View |
class | ConstTensor4View |
class | ConstTensor5View |
class | ConstTensor6View |
class | ConstTensor7View |
int | poly_root_solve (Matrix &roots, Vector &coeffs) |
void | mult (VectorView, const ConstMatrixView &, const ConstVectorView &) |
Matrix Vector multiplication. |
Together with the derived class VectorView this contains the main implementation of a Vector. The class Vector is just a special case of a VectorView which also allocates storage.
Definition at line 291 of file matpackI.h.
Definition at line 294 of file matpackI.h.
virtual ConstVectorView::~ConstVectorView | ( | ) | [inline, virtual] |
ConstVectorView::ConstVectorView | ( | const Numeric & | a | ) |
A special constructor, which allows to make a ConstVectorView from a scalar.
This one is a bit tricky: We have to cast away the arguments const qualifier, because mdata is not const. This should be safe, since there are no non-const methods for ConstVectorView.
Definition at line 224 of file matpackI.cc.
ConstVectorView::ConstVectorView | ( | ) | [protected] |
Default constructor.
This is necessary, so that we can have a default constructor for the derived class Vector.
Definition at line 232 of file matpackI.cc.
Referenced by operator[]().
Explicit constructor.
This one is used by Vector to initialize its own VectorView part.
Definition at line 240 of file matpackI.cc.
Recursive constructor.
This is used to construct sub ranges from sub ranges. That means that the new range has to be interpreted relative to the original range. The new range may contain -1 for the extent which acts as a joker. However, the used Range constructor converts this to an explicit range, consistent with the original Range.
*data | The actual data. | |
p | Previous range. | |
n | New Range. |
Definition at line 258 of file matpackI.cc.
Index ConstVectorView::nelem | ( | ) | const |
Returns the number of elements.
The names `size' and `length' are already used by STL functions returning size_t. To avoid confusion we choose the name `nelem'. This is also more consistent with `nrow' and `ncol' for matrices.
The value range of long, which is used to store the index is on a PC from -2147483648 to 2147483647. This means that a 15GB large array of float can be addressed with this index. So the extra bit that size_t has compared to long is not needed.
Definition at line 170 of file matpackI.cc.
References Range::mextent, and mrange.
Referenced by abs_coefCalcSaveMemory(), abs_fieldCalc(), abs_lines_per_speciesCompact(), abs_lines_per_speciesReadFromCatalogues(), abs_lineshape_per_tgDefine(), abs_lookupCreate(), abs_lookupSetup(), abs_lookupSetupBatch(), abs_lookupTestAccuracy(), abs_vecInit(), abs_vecTransform(), abs_xsec_per_speciesAddConts(), abs_xsec_per_speciesInit(), AbsInputFromRteScalars(), GasAbsLookup::Adapt(), AngIntegrate_trapezoid(), AngIntegrate_trapezoid_fixedstep(), AngIntegrate_trapezoid_fixedstep_opt(), AngIntegrate_trapezoid_fixedstep_opt2(), AngIntegrate_trapezoid_opt(), AngIntegrate_trapezoid_opti(), AngIntegrate_trapezoid_original(), antenna1d_matrix(), Append(), apply_y_unit(), apply_y_unit_single(), AtmFieldsCalc(), AtmFieldsCalcExpand1D(), AtmFieldsRefinePgrid(), batch_atm_fields_compactFromArrayOfMatrix(), BF86_CIA_N2(), calc_lookup_error(), calc_nd_field(), check_retrieval_grids(), GField1::checksize(), chk_atm_field(), chk_atm_grids(), chk_atm_surface(), chk_cloudbox(), chk_if_pnd_zero_lat(), chk_if_pnd_zero_lon(), chk_if_pnd_zero_p(), chk_interpolation_grids(), chk_pnd_data(), chk_single_scattering_data(), chk_size(), chk_vector_length(), choose_abs_nls_pert(), choose_abs_t_pert(), CKD24_H20(), CKD_222_foreign_h2o(), CKD_222_self_h2o(), CKD_241_co2(), CKD_242_foreign_h2o(), CKD_242_self_h2o(), CKD_mt_100_foreign_h2o(), CKD_mt_100_self_h2o(), CKD_mt_CIAfun_n2(), CKD_mt_CIAfun_o2(), CKD_mt_CIArot_n2(), CKD_mt_co2(), CKD_mt_v0v0_o2(), CKD_mt_v1v0_o2(), cloud_atm_vars_by_gp(), cloud_ppath_update3D(), cloud_RT_surface(), cloudbox_ppath_start_stepping(), Cloudbox_ppathCalc(), CloudboxGetIncoming(), CloudboxGetIncoming1DAtm(), cloudboxSetDisort(), cloudboxSetEmpty(), cloudboxSetManually(), cloudboxSetManuallyAltitude(), complex_nWaterLiebe93(), CP98H2OAbsModel(), describe(), do_gridcell_2d(), do_gridrange_1d(), doit_conv_flagAbs(), doit_conv_flagAbsBT(), doit_conv_flagLsq(), doit_i_fieldSetClearsky(), doit_i_fieldUpdate1D(), doit_i_fieldUpdateSeq1D(), doit_i_fieldUpdateSeq1DPP(), doit_i_fieldUpdateSeq3D(), doit_scat_fieldCalc(), doit_scat_fieldCalcLimb(), doit_za_grid_optCalc(), DoitCloudboxFieldPut(), DoitInit(), DoitScatteringDataPrepare(), dtauc_ssalbCalc(), emissionPlanck(), ext_matInit(), Extract(), GasAbsLookup::Extract(), f_gridFromSensorAMSU(), f_gridFromSensorHIRS(), f_gridSelectFIndex(), find_new_grid_in_old_grid(), get_perturbation_gridpos(), get_perturbation_limit(), get_radiative_background(), get_refr_index_2d(), get_refr_index_3d(), GasAbsLookup::GetFgrid(), GasAbsLookup::GetPgrid(), gridpos(), gridpos_poly(), init_x(), init_xy(), Sparse::insert_row(), interp(), interp_atmfield_by_itw(), interp_atmsurface_by_itw(), interp_cloud_coeff1D(), interp_poly(), interpolate_raytracing_points(), InterpSurfaceEmissivityFieldIncLatLon(), interpTArray(), interpweights(), is_decreasing(), is_increasing(), is_size(), is_sorted(), itw2p(), iwp_cloud_opt_pathCalc(), iy_calc(), iy_interp_cloudbox_field(), jacobian_from_path_to_rgrids(), jacobianAddPointing(), jacobianAddPolyfit(), jacobianCalcAbsSpecies(), jacobianCalcPointing(), jacobianCalcPolyfit(), jacobianCalcTemperature(), LagrangeInterpol4(), last(), lineshape_CO2_lorentz(), lineshape_doppler(), lineshape_lorentz(), lineshape_norm_linear(), lineshape_norm_no_norm(), lineshape_norm_quadratic(), lineshape_norm_VVH(), lineshape_rosenkranz_voigt_drayson(), lineshape_rosenkranz_voigt_kuntz6(), lineshape_voigt_drayson(), lineshape_voigt_kuntz3(), lineshape_voigt_kuntz4(), lineshape_voigt_kuntz6(), MaTipping_H2O_foreign_continuum(), Matrix1ColFromVector(), Matrix1RowFromVector(), Matrix2ColFromVectors(), Matrix2RowFromVectors(), Matrix3ColFromVectors(), Matrix3RowFromVectors(), MatrixCBR(), MatrixPlanck(), MatrixUnitIntensity(), MCGeneral(), MCIPA(), mcPathTraceGeneral(), mcPathTraceIPA(), mean(), mixer_matrix(), MPM02H2OAbsModel(), MPM85O2AbsModel(), MPM87H2OAbsModel(), MPM87O2AbsModel(), MPM89H2OAbsModel(), MPM89O2AbsModel(), MPM92O2AbsModel(), MPM93_H2O_continuum(), MPM93_N2_continuum(), MPM93_O2_continuum(), MPM93H2OAbsModel(), MPM93IceCrystalAbs(), MPM93O2AbsModel(), MPM93RainExt(), MPM93WaterDropletAbs(), mult(), nc_write_to_file(), operator*(), MatrixView::operator*=(), VectorView::operator*=(), MatrixView::operator+=(), VectorView::operator+=(), MatrixView::operator-=(), VectorView::operator-=(), MatrixView::operator/=(), VectorView::operator/=(), operator<<(), Matrix::operator=(), MatrixView::operator=(), Vector::operator=(), opt_prop_sptFromMonoData(), p2gridpos(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), ParticleTypeAdd(), ParticleTypeAddAll(), perturbation_field_1d(), pha_mat_singleCalc(), pha_mat_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), pmomCalc(), poly_root_solve(), polynomial_basis_func(), ppath_append(), ppath_calc(), ppath_copy(), ppath_end_1d(), ppath_end_2d(), ppath_end_3d(), ppath_fill_1d(), ppath_fill_2d(), ppath_fill_3d(), ppath_start_2d(), ppath_start_3d(), ppath_start_stepping(), ppath_step_refr_1d(), ppath_step_refr_2d(), ppath_step_refr_3d(), Print(), PWR93O2AbsModel(), PWR98H2OAbsModel(), r_geoidSpherical(), r_geoidWGS84(), raytrace_1d_linear_euler(), raytrace_2d_linear_euler(), raytrace_3d_linear_euler(), refr_index_Boudouris(), refr_index_BoudourisDryAir(), refr_indexFieldAndGradients(), refr_indexIR(), refr_indexThayer(), Rosenkranz_CO2_foreign_continuum(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), Rosenkranz_O2_continuum(), rte_pos_and_losFromTangentPressure(), rte_posAddGeoidWGS84(), rte_posAddRgeoid(), rte_std(), rte_step_std(), rte_step_std_clearsky(), RteCalc(), rtecalc_check_input(), RteCalcMC(), Sample_los(), Sample_ppathlengthLOS(), scat_data_monoCalc(), ScatteringDoit(), ScatteringMonteCarlo(), Select(), sensor_aux_vectors(), sensor_integration_vector(), sensor_responseAntenna(), sensor_responseBackend(), sensor_responseBeamSwitching(), sensor_responseInit(), sensor_responseMixer(), sensor_responseMultiMixerBackend(), sensor_summation_vector(), spectrometer_matrix(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_specular_los(), surface_specular_R_and_b(), surfaceBlackbody(), surfaceFlatRefractiveIndex(), surfaceFlatSingleEmissivity(), surfaceFlatVaryingEmissivity(), Tensor3FillWithVector(), test02(), test04(), test07(), test1(), test11(), test2(), test4(), test7(), test8(), test_and_merge_two_channels(), test_x_fixedstep(), testVector(), transform(), VectorAddScalar(), VectorInsertGridPoints(), VectorLinSpace(), VectorLogSpace(), VectorMatrixMultiply(), VectorScale(), VectorZtanToZa1D(), VectorZtanToZaRefr1D(), xml_read_from_stream(), xml_write_to_stream(), xsec_continuum_tag(), xsec_species(), ybatchCalc_implementation(), ybatchMetProfiles(), ybatchMetProfilesClear(), ybatchUnit(), yUnit(), z_at_lat_2d(), z_at_latlon(), za_gridOpt(), and ZaSatOccultation().
Numeric ConstVectorView::sum | ( | ) | const |
The sum of all elements of a Vector.
Definition at line 176 of file matpackI.cc.
References begin(), and end().
Referenced by interp(), interpolate_raytracing_points(), rte_step_std_clearsky(), spectrometer_matrix(), and test17().
Plain const index operator.
Reimplemented in VectorView.
Definition at line 302 of file matpackI.h.
References mdata, Range::mextent, mrange, Range::mstart, and Range::mstride.
Referenced by VectorView::operator[]().
ConstVectorView ConstVectorView::operator[] | ( | const Range & | r | ) | const |
Const index operator for subrange.
We have to also account for the case, that *this is already a subrange of a Vector. This allows correct recursive behavior.
Reimplemented in VectorView.
Definition at line 191 of file matpackI.cc.
References ConstVectorView(), mdata, and mrange.
ConstIterator1D ConstVectorView::begin | ( | ) | const |
Return const iterator to first element.
Reimplemented in VectorView.
Definition at line 197 of file matpackI.cc.
References mdata, mrange, Range::mstart, and Range::mstride.
Referenced by VectorView::begin(), max(), mean(), min(), operator*(), MatrixView::operator*=(), VectorView::operator*=(), MatrixView::operator+=(), VectorView::operator+=(), MatrixView::operator-=(), VectorView::operator-=(), MatrixView::operator/=(), VectorView::operator/=(), operator<<(), VectorView::operator=(), sum(), transform(), and Vector::Vector().
ConstIterator1D ConstVectorView::end | ( | ) | const |
Return const iterator behind last element.
Reimplemented in VectorView.
Definition at line 203 of file matpackI.cc.
References mdata, Range::mextent, mrange, Range::mstart, and Range::mstride.
Referenced by VectorView::end(), max(), mean(), min(), operator*(), operator<<(), VectorView::operator=(), sum(), transform(), and Vector::Vector().
ConstVectorView::operator ConstMatrixView | ( | ) | const |
Conversion to const 1 column matrix.
Definition at line 212 of file matpackI.cc.
References ConstMatrixView, mdata, mrange, and Range::mstart.
friend class VectorView [friend] |
Definition at line 321 of file matpackI.h.
friend class ConstIterator2D [friend] |
friend class ConstMatrixView [friend] |
friend class ConstTensor3View [friend] |
Definition at line 327 of file matpackI.h.
friend class ConstTensor4View [friend] |
Definition at line 328 of file matpackI.h.
friend class ConstTensor5View [friend] |
Definition at line 329 of file matpackI.h.
friend class ConstTensor6View [friend] |
Definition at line 330 of file matpackI.h.
friend class ConstTensor7View [friend] |
Definition at line 331 of file matpackI.h.
Definition at line 100 of file poly_roots.cc.
void mult | ( | VectorView | , | |
const ConstMatrixView & | , | |||
const ConstVectorView & | ||||
) | [friend] |
y = M*x. Note that the order is different from MTL, output comes first! Dimensions of y, M, and x must match. No memory reallocation takes place, only the data is copied. Using this function on overlapping MatrixViews belonging to the same Matrix will lead to unpredictable results. In particular, this means that A and B must not be the same matrix! The implementation here is different from the other multiplication routines. It does not use iterators but a more drastic approach to gain maximum performance.
Definition at line 1598 of file matpackI.cc.
Range ConstVectorView::mrange [protected] |
The range of mdata that is actually used.
Definition at line 348 of file matpackI.h.
Referenced by VectorView::begin(), begin(), VectorView::end(), end(), VectorView::get_c_array(), mult(), nelem(), operator ConstMatrixView(), VectorView::operator MatrixView(), ConstIterator2D::operator!=(), Iterator2D::operator!=(), VectorView::operator=(), VectorView::operator[](), operator[](), Vector::resize(), and VectorView::VectorView().
Numeric* ConstVectorView::mdata [protected] |
Pointer to the plain C array that holds the data.
Definition at line 350 of file matpackI.h.
Referenced by VectorView::begin(), begin(), VectorView::end(), end(), VectorView::get_c_array(), mult(), operator ConstMatrixView(), VectorView::operator MatrixView(), ConstIterator2D::operator!=(), Iterator2D::operator!=(), ConstIterator2D::operator++(), Iterator2D::operator++(), VectorView::operator[](), operator[](), poly_root_solve(), Vector::resize(), Vector::Vector(), VectorView::VectorView(), and Vector::~Vector().