ARTS
2.4.0(git:4fb77825)
|
A constant view of a Vector. More...
#include <matpackI.h>
Public Types | |
typedef ConstIterator1D | const_iterator |
Public Member Functions | |
constexpr | ConstVectorView (const ConstVectorView &)=default |
constexpr | ConstVectorView (ConstVectorView &&)=default |
ConstVectorView & | operator= (const ConstVectorView &)=default |
ConstVectorView & | operator= (ConstVectorView &&)=default |
bool | empty () const |
Returns true if variable size is zero. More... | |
Index | nelem () const |
Returns the number of elements. More... | |
Numeric | sum () const |
The sum of all elements of a Vector. More... | |
Numeric | operator[] (Index n) const |
Plain const index operator. More... | |
Numeric | get (Index n) const |
Get element implementation without assertions. More... | |
ConstVectorView | operator[] (const Range &r) const |
Const index operator for subrange. More... | |
ConstIterator1D | begin () const |
Return const iterator to first element. More... | |
ConstIterator1D | end () const |
Return const iterator behind last element. More... | |
operator ConstMatrixView () const | |
Conversion to const 1 column matrix. More... | |
virtual | ~ConstVectorView ()=default |
Destructor. More... | |
ConstVectorView (const Numeric &a) | |
A special constructor, which allows to make a ConstVectorView from a scalar. More... | |
Protected Member Functions | |
ConstVectorView ()=default | |
ConstVectorView (Numeric *data, const Range &range) | |
Explicit constructor. More... | |
ConstVectorView (Numeric *data, const Range &p, const Range &n) | |
Recursive constructor. More... | |
Protected Attributes | |
Range | mrange {0, 0} |
The range of mdata that is actually used. More... | |
Numeric * | mdata {nullptr} |
Pointer to the plain C array that holds the data. More... | |
A constant view of a Vector.
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 476 of file matpackI.h.
Definition at line 484 of file matpackI.h.
|
constexprdefault |
|
constexprdefault |
|
virtualdefault |
Destructor.
ConstVectorView::ConstVectorView | ( | const Numeric & | a | ) |
A special constructor, which allows to make a ConstVectorView from a scalar.
Definition at line 89 of file matpackI.cc.
|
protecteddefault |
Referenced by operator[]().
Explicit constructor.
This one is used by Vector to initialize its own VectorView part.
Definition at line 94 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 99 of file matpackI.cc.
ConstIterator1D ConstVectorView::begin | ( | ) | const |
Return const iterator to first element.
Definition at line 67 of file matpackI.cc.
References mdata, mrange, Range::mstart, and Range::mstride.
Referenced by copy(), max(), mean(), min(), operator*(), ComplexMatrixView::operator*=(), MatrixView::operator*=(), ComplexMatrixView::operator+=(), MatrixView::operator+=(), ComplexMatrixView::operator-=(), MatrixView::operator-=(), ComplexMatrixView::operator/=(), MatrixView::operator/=(), operator<<(), VectorView::operator=(), sum(), transform(), and Vector::Vector().
bool ConstVectorView::empty | ( | ) | const |
Returns true if variable size is zero.
Definition at line 49 of file matpackI.cc.
References nelem().
Referenced by covmatDiagonal(), get_variable_value(), and test_empty().
ConstIterator1D ConstVectorView::end | ( | ) | const |
Return const iterator behind last element.
Definition at line 71 of file matpackI.cc.
References mdata, Range::mextent, mrange, Range::mstart, and Range::mstride.
Referenced by max(), mean(), min(), operator*(), operator<<(), VectorView::operator=(), transform(), and Vector::Vector().
Get element implementation without assertions.
Definition at line 514 of file matpackI.h.
Referenced by operator[]().
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 51 of file matpackI.cc.
References Range::mextent, and mrange.
Referenced by _cr_internal_(), abs_lines_per_speciesChangeBaseParameterForMatchingLevels(), abs_lines_per_speciesSetBaseParameterForMatchingLevels(), abs_lines_per_speciesSetZeemanCoefficients(), abs_linesChangeBaseParameterForMatchingLevels(), abs_linesSetBaseParameterForMatchingLevels(), abs_linesSetZeemanCoefficients(), abs_lookupSetup(), abs_lookupTestAccMC(), abs_lookupTestAccuracy(), GasAbsLookup::Adapt(), add_noise(), AddZaAa(), AngularGridsSetFluxCalc(), antenna1d_matrix(), antenna2d_interp_response(), AntennaConstantGaussian1D(), Append(), CIARecord::AppendDataset(), atm_fields_compactAddSpecies(), atm_fields_compactCreateFromField(), AtmFieldPRegrid(), AtmFieldPRegridHelper(), AtmFieldsCalc(), backend_channel_responseGaussian(), BF86_CIA_N2(), calc_lookup_error(), calc_ssp_fixed_test(), calc_ssp_random_test(), calcSingleScatteringDataProperties(), check_disort_input(), check_retrieval_grids(), GriddedField1::checksize(), GriddedField1::checksize_strict(), chk_if_equal(), chk_interpolation_grids(), chk_interpolation_grids_loose_check_data(), chk_interpolation_grids_loose_no_data_check(), chk_interpolation_pgrids(), chk_interpolation_pgrids_loose_no_data_check(), chk_pnd_data(), choose_abs_nls_pert(), choose_abs_t_pert(), cia_interpolation(), CKD24_H20(), CKD_222_foreign_h2o(), CKD_222_self_h2o(), CKD_242_foreign_h2o(), CKD_242_self_h2o(), CKD_mt_100_foreign_h2o(), CKD_mt_100_self_h2o(), CKD_mt_250_CIAfun_n2(), CKD_mt_250_CIArot_n2(), CKD_mt_250_foreign_h2o(), CKD_mt_250_self_h2o(), CKD_mt_320_foreign_h2o(), CKD_mt_320_self_h2o(), CKD_mt_CIAfun_n2(), CKD_mt_CIArot_n2(), CKD_mt_v0v0_o2(), CKD_mt_v1v0_o2(), cloud_atm_vars_by_gp(), cloud_ppath_update3D(), cloudbox_checkedCalc(), Compare(), complex_n_interp(), complex_refr_indexIceMatzler06(), complex_refr_indexWaterLiebe93(), ConvertAzimuthallyRandomSingleScatteringData(), convolve(), covmat1D(), covmat1DMarkov(), covmat_sxExtractSqrtDiagonal(), covmatDiagonal(), CP98H2OAbsModel(), create_sparse_covariance_matrix_1D(), createBji(), dampened_statistical_equilibrium_equation(), Sparse::diagonal(), diagonalize(), DiagonalMatrix(), DiffZaAa(), doit_conv_flagAbs(), doit_conv_flagAbsBT(), doit_conv_flagLsq(), doit_scat_fieldCalcLimb(), dplanck_dt(), ELL07WaterDropletAbs(), empty(), GasAbsLookup::Extract(), Extract(), XsecRecord::Extract(), f_gridFromGasAbsLookup(), f_gridFromSensorAMSUgeneric(), f_gridFromSensorHIRS(), f_gridMetMM(), fillSpeciesAuxDataWithPartitionFunctionsFromSpeciesData(), find_effective_channel_boundaries(), find_new_grid_in_old_grid(), FouComp_1ScatElem(), FrequencyFromCGSAngularWavenumber(), FrequencyFromCGSKayserWavenumber(), FrequencyFromWavelength(), func_2straights(), get_maximum_error(), get_parZ(), get_pmom(), get_stepwise_blackbody_radiation(), get_stepwise_scattersky_source(), get_variable_value(), GriddedFieldLatLonRegrid(), GriddedFieldPRegridHelper(), GriddedFieldZToPRegrid(), GriddedFieldZToPRegridHelper(), gridpos(), gridpos_1to1(), gridpos_poly(), gridpos_poly_cyclic_longitudinal(), gridpos_poly_longitudinal(), Ho66_CO2_self_continuum(), init_x(), insert_elements(), Sparse::insert_row(), integrate_convolved(), integrate_zenith(), interp(), interp_cloud_coeff1D(), interp_cloudfield_gp2itw(), interpweights(), is_lon_cyclic(), itw2p(), jacobianAddSinefit(), jacobianFromTwoY(), jacobianSetAffineTransformation(), lon_shiftgrid(), MagFieldsCalc(), Absorption::PredefinedModel::makarov2020_o2_lines_mpm(), MapToEigen(), MapToEigenCol(), MaTipping_H2O_foreign_continuum(), Matrix1ColFromVector(), Matrix1RowFromVector(), Matrix2ColFromVectors(), Matrix2RowFromVectors(), Matrix3ColFromVectors(), Matrix3RowFromVectors(), MatrixCBR(), MatrixPlanck(), MatrixUnitIntensity(), MatrixVectorMultiply(), mblock_dlos_gridUniformRectangular(), linalg::median(), mgd(), mgd_with_derivatives(), mixer_matrix(), MPM02H2OAbsModel(), MPM85O2AbsModel(), MPM87H2OAbsModel(), MPM87O2AbsModel(), MPM89H2OAbsModel(), MPM89O2AbsModel(), MPM92O2AbsModel(), MPM93_H2O_continuum(), MPM93_N2_continuum(), MPM93_O2_continuum(), MPM93H2OAbsModel(), MPM93IceCrystalAbs(), MPM93O2AbsModel(), MPM93RainExt(), MPM93WaterDropletAbs(), mult(), nca_def_Vector(), nca_put_var_Vector(), nca_write_to_file(), NumericFromVector(), OEM_checks(), EnergyLevelMap::OK(), operator*(), VectorView::operator*=(), VectorView::operator+=(), VectorView::operator-=(), VectorView::operator/=(), operator<<(), MatrixView::operator=(), Vector::operator=(), opt_prop_1ScatElem(), opt_prop_NScatElems(), opt_prop_sptFromMonoData(), p2gridpos(), p2gridpos_poly(), p_gridDensify(), p_gridFromGasAbsLookup(), p_gridRefine(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), PFromZSimple(), pha_mat_1ScatElem(), pha_mat_NScatElems(), pha_matTransform(), planck(), polynomial_basis_func(), pos2true_latlon(), ppath_end_1d(), ppath_end_2d(), ppath_end_3d(), ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), Print(), propmat_clearsky_fieldCalc(), propmat_clearskyAddZeeman(), psd_cloudice_MH97(), psd_rain_W16(), PWR93O2AbsModel(), PWR98H2OAbsModel(), random_fill_vector(), raytrace_1d_linear_basic(), raytrace_2d_linear_basic(), raytrace_3d_linear_basic(), Reduce(), retrievalAddSinefit(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), rte_step_doit_replacement(), run_cdisort(), Sample_los(), scat_data_singleTmatrix(), ScatSpeciesExtendTemperature(), ScatSpeciesMerge(), Select(), select_dims_by_size(), Absorption::Lines::SelfVMR(), sensor_responseAntenna(), sensor_responseBackend(), sensor_responseGenericAMSU(), sensor_responseMetMM(), sensor_responseMixer(), SingleCalculatePartitionFctFromCoeff(), SingleCalculatePartitionFctFromCoeff_dT(), solve(), spectrometer_matrix(), ssd_tinterp_parameters(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), statistical_equilibrium_equation(), surf_albedoCalc(), surface_props_interp(), telsemStandalone(), tessem_prop_nn(), test02(), test04(), test07(), test1(), test11(), test2(), test4(), test47(), test_and_merge_two_channels(), test_diagonal(), test_ecs20(), test_integrate_convolved(), test_integrate_zenith(), test_telsem_interpolate(), test_x_fixedstep(), testVector(), TRE05O2AbsModel(), Vector::Vector(), vector_angle(), VectorAddScalar(), VectorCrop(), VectorFlip(), VectorInsertGridPoints(), VectorMatrixMultiply(), VectorScale(), VectorZtanToZa1D(), VectorZtanToZaRefr1D(), vmr_fieldSetAllConstant(), LineShape::vmrs(), WindFieldsCalc(), write_vector(), x2artsAtmAndSurf(), x2artsSensor(), XINT_FUN(), xml_read_from_stream(), xml_write_to_stream(), ybatchMetProfiles(), ybatchMetProfilesClear(), ybatchTroposphericCorrectionNaiveMedianForward(), yCalcAppend(), yColdAtmHot(), z_at_lat_2d(), z_at_latlon(), and za_gridOpt().
ConstVectorView::operator ConstMatrixView | ( | ) | const |
Conversion to const 1 column matrix.
Definition at line 77 of file matpackI.cc.
|
default |
|
default |
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.
Definition at line 63 of file matpackI.cc.
References ConstVectorView(), mdata, and mrange.
Plain const index operator.
Definition at line 507 of file matpackI.h.
References get(), Range::mextent, and mrange.
Numeric ConstVectorView::sum | ( | ) | const |
The sum of all elements of a Vector.
Definition at line 53 of file matpackI.cc.
References begin().
Referenced by antenna1d_matrix(), antenna2d_interp_response(), interp(), spectrometer_matrix(), test17(), LineShape::vmrs(), and xsec_continuum_tag().
|
friend |
Definition at line 548 of file matpackI.h.
|
friend |
Definition at line 541 of file matpackI.h.
|
friend |
Definition at line 542 of file matpackI.h.
|
friend |
Definition at line 543 of file matpackI.h.
|
friend |
Definition at line 544 of file matpackI.h.
|
friend |
Definition at line 545 of file matpackI.h.
|
friend |
Definition at line 546 of file matpackI.h.
|
friend |
Definition at line 547 of file matpackI.h.
|
friend |
Matrix Diagonalization.
Return P and W from A in the statement diag(P^-1*A*P)-W == 0. The real function will require some manipulation if the eigenvalues are imaginary.
The real version returns WR and WI as returned by dgeev. The complex version just returns W.
The function makes many copies and is thereby not fast. There are no tests on the condition of the returned matrix, so nan and inf can occur.
[out] | P | The right eigenvectors. |
[out] | WR | The real eigenvalues. |
[out] | WI | The imaginary eigenvalues. |
[in] | A | The matrix to diagonalize. |
Definition at line 245 of file lin_alg.cc.
|
friend |
LU backsubstitution.
Solves a set of linear equations Ax=b. It is neccessairy to do a L decomposition using the function ludcp before using this function. The backsubstitution is in-place, i.e. x and b may be the same vector.
x | Output: Solution vector of the equation system. |
LU | Input: LU decomposition of the matrix (output of function ludcp). |
b | Input: Right-hand-side vector of equation system. |
indx | Input: Pivoting information (output of function ludcp). |
Definition at line 91 of file lin_alg.cc.
|
friend |
Definition at line 1660 of file matpackI.cc.
|
friend |
Definition at line 1691 of file matpackI.cc.
|
friend |
Definition at line 1673 of file matpackI.cc.
|
friend |
Definition at line 1702 of file matpackI.cc.
|
friend |
Matrix-Vector Multiplication.
Computes the Matrix-Vector product y = M * x, for a m times n matrix M, a length-m vector y and a length-n vector x.
The product is computed using the dgemv_ routine from the BLAS library if the matrix is contiguous in memory. If this is not the case, the mult_general method is used to compute the product.
No memory is allocated for the computation and the matrix and vector views may not overlap.
[out] | y | The length-m VectorView where the result is stored. |
[in] | M | Reference to the m-times-n ConstMatrixView holding the matrix M. |
[in] | x | Reference to the length-n ConstVectorView holding the vector x. |
Definition at line 1123 of file matpackI.cc.
|
friend |
Sparse matrix - Vector multiplication.
This calculates the product
y = M*x, where M is sparse.
Output comes first!
Dimensions of y, M, and x must match. No memory reallocation takes place, only the data is copied.
y | Output: The multiplication result. |
M | Matrix for multiplication (sparse). |
x | Vector for multiplication. |
Definition at line 417 of file matpackII.cc.
|
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 Matrix and VectorViews belonging to the same Matrix will lead to unpredictable results.
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 1181 of file matpackI.cc.
|
friend |
Definition at line 90 of file poly_roots.cc.
|
friend |
Sparse matrix - Vector multiplication.
This calculates the product
y = M*x, where M is sparse.
Output comes first!
Dimensions of y, M, and x must match. No memory reallocation takes place, only the data is copied.
y | Output: The multiplication result. |
M | Matrix for multiplication (sparse). |
x | Vector for multiplication. |
Definition at line 452 of file matpackII.cc.
|
friend |
Definition at line 540 of file matpackI.h.
|
protected |
Pointer to the plain C array that holds the data.
Definition at line 596 of file matpackI.h.
Referenced by VectorView::begin(), begin(), diagonalize(), VectorView::end(), end(), VectorView::get(), VectorView::get_c_array(), MapToEigen(), MapToEigenCol(), ConstIterator2D::operator!=(), Iterator2D::operator!=(), Iterator2D::operator++(), ConstIterator2D::operator++(), Vector::operator=(), VectorView::operator[](), operator[](), swap(), Vector::Vector(), VectorView::VectorView(), and Vector::~Vector().
|
protected |
The range of mdata that is actually used.
Definition at line 594 of file matpackI.h.
Referenced by VectorView::begin(), begin(), VectorView::end(), end(), VectorView::get(), VectorView::get_c_array(), lubacksub(), MapToEigen(), MapToEigenCol(), nelem(), ConstIterator2D::operator!=(), Iterator2D::operator!=(), VectorView::operator=(), VectorView::operator[](), operator[](), Vector::resize(), swap(), and VectorView::VectorView().