GammaLib 2.0.0
|
Vector class implementation. More...
Go to the source code of this file.
Macros | |
#define | G_CONSTRUCTOR "GVector::GVector(int&)" |
#define | G_OP_ADD "GVector::operator+=(GVector&)" |
#define | G_OP_SUB "GVector::operator-=(GVector&)" |
#define | G_AT "GVector::at(int&)" |
#define | G_CROSS "cross(GVector&, GVector&)" |
#define | G_SCALAR "operator*(GVector&, GVector&)" |
#define | G_ANGLE "angle(GVector&, GVector&)" |
Functions | |
GVector | cross (const GVector &a, const GVector &b) |
Vector cross product. | |
double | operator* (const GVector &a, const GVector &b) |
Vector scalar product. | |
double | norm (const GVector &vector) |
Computes vector norm. | |
double | min (const GVector &vector) |
Computes minimum vector element. | |
double | max (const GVector &vector) |
Computes maximum vector element. | |
double | sum (const GVector &vector) |
Computes vector sum. | |
double | angle (const GVector &a, const GVector &b) |
Computes angle between vectors. | |
GVector | perm (const GVector &vector, const int *p) |
Computes vector permutation. | |
GVector | iperm (const GVector &vector, const int *p) |
Computes vector inverse permutation. | |
GVector | acos (const GVector &vector) |
Computes arccos of vector elements. | |
GVector | acosh (const GVector &vector) |
Computes acosh of vector elements. | |
GVector | asin (const GVector &vector) |
Computes arcsin of vector elements. | |
GVector | asinh (const GVector &vector) |
Computes asinh of vector elements. | |
GVector | atan (const GVector &vector) |
Computes arctan of vector elements. | |
GVector | atanh (const GVector &vector) |
Computes atanh of vector elements. | |
GVector | cos (const GVector &vector) |
Computes cosine of vector elements. | |
GVector | cosh (const GVector &vector) |
Computes cosh of vector elements. | |
GVector | exp (const GVector &vector) |
Computes exponential of vector elements. | |
GVector | abs (const GVector &vector) |
Computes absolute of vector elements. | |
GVector | log (const GVector &vector) |
Computes natural logarithm of vector elements. | |
GVector | log10 (const GVector &vector) |
Computes base10 logarithm of vector elements. | |
GVector | sin (const GVector &vector) |
Computes sine of vector elements. | |
GVector | sinh (const GVector &vector) |
Computes sinh of vector elements. | |
GVector | sqrt (const GVector &vector) |
Computes square root of vector elements. | |
GVector | tan (const GVector &vector) |
Computes tangens of vector elements. | |
GVector | tanh (const GVector &vector) |
Computes tanh of vector elements. | |
GVector | pow (const GVector &vector, const double &power) |
Computes tanh of vector elements. | |
Vector class implementation.
Definition in file GVector.cpp.
Definition at line 42 of file GVector.cpp.
#define G_AT "GVector::at(int&)" |
Definition at line 39 of file GVector.cpp.
#define G_CONSTRUCTOR "GVector::GVector(int&)" |
Definition at line 36 of file GVector.cpp.
Definition at line 40 of file GVector.cpp.
#define G_OP_ADD "GVector::operator+=(GVector&)" |
Definition at line 37 of file GVector.cpp.
#define G_OP_SUB "GVector::operator-=(GVector&)" |
Definition at line 38 of file GVector.cpp.
Definition at line 41 of file GVector.cpp.
Computes absolute of vector elements.
[in] | vector | Vector. |
Definition at line 1253 of file GVector.cpp.
Referenced by GIntegrals::romberg().
Computes arccos of vector elements.
[in] | vector | Vector. |
Definition at line 1064 of file GVector.cpp.
Computes acosh of vector elements.
[in] | vector | Vector. |
Definition at line 1085 of file GVector.cpp.
Computes angle between vectors.
[in] | a | Vector. |
[in] | b | Vector. |
a
and b
in radians.GException::invalid_argument | Mismatch between vector size. |
Returns the angle \(\alpha\) between vector a
and b
in radians. The computation is done using
\[ \alpha = \arccos{\frac{\vec{a} \cdot \vec{b}}{|\vec{a}||\vec{b}|}} \]
Definition at line 974 of file GVector.cpp.
Referenced by gammalib::cosd(), GMatrix::eulerx(), GMatrix::eulery(), GMatrix::eulerz(), GModelSpatialRadialProfileDMBurkert::jfactor(), GModelSpatialRadialProfileDMEinasto::jfactor(), GModelSpatialRadialProfileDMZhao::jfactor(), GHealpix::max_pixrad(), gammalib::sincosd(), gammalib::sind(), and gammalib::tand().
Computes arcsin of vector elements.
[in] | vector | Vector. |
Definition at line 1106 of file GVector.cpp.
Computes asinh of vector elements.
[in] | vector | Vector. |
Definition at line 1127 of file GVector.cpp.
Computes arctan of vector elements.
[in] | vector | Vector. |
Definition at line 1148 of file GVector.cpp.
Computes atanh of vector elements.
[in] | vector | Vector. |
Definition at line 1169 of file GVector.cpp.
Computes cosine of vector elements.
[in] | vector | Vector. |
Definition at line 1190 of file GVector.cpp.
Referenced by GSkyDir::cos_dist(), and GHealpix::dir2pix().
Computes cosh of vector elements.
[in] | vector | Vector. |
Definition at line 1211 of file GVector.cpp.
Vector cross product.
[in] | a | Vector. |
[in] | b | Vector. |
GException::invalid_argument | Mismatch between vector size or vector not of size 3. |
Computes the cross product between two 3-element vectors (note that the cross product is only defined for 3-element vectors).
Definition at line 793 of file GVector.cpp.
Referenced by GHealpix::max_pixrad(), and GWcs::solidangle().
Computes exponential of vector elements.
[in] | vector | Vector. |
Definition at line 1232 of file GVector.cpp.
Referenced by GModelSpectralExponential::flux_kern::eval(), GCTABackgroundPerfTable::mc(), GCTAModelRadialGauss::mc(), GCTAAeffArf::operator()(), and GLATMeanPsf::set_offsets().
Computes vector inverse permutation.
[in] | vector | Vector. |
[in] | p | Permutation array. |
Definition at line 1038 of file GVector.cpp.
Referenced by GMatrixSparse::cholesky_solver().
Computes natural logarithm of vector elements.
[in] | vector | Vector. |
Definition at line 1274 of file GVector.cpp.
Referenced by GLog::copy_members(), GCTACubeBackground::fill(), GCTACubeEdisp::fill(), GCTACubeExposure::fill(), GCTACubePsf::fill(), GCTACubeEdisp::fill_cube(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GLog::GLog(), GOptimizerLM::GOptimizerLM(), GOptimizerLM::logger(), GLog::operator<<(), operator<<(), operator<<(), GLog::operator=(), and GLATMeanPsf::set_offsets().
Computes base10 logarithm of vector elements.
[in] | vector | Vector. |
Definition at line 1295 of file GVector.cpp.
Referenced by GCTAPsfVector::read(), GLATResponseTable::read(), and GLATEventCube::set_energies().
double max | ( | const GVector & | vector | ) |
Computes maximum vector element.
[in] | vector | Vector. |
Definition at line 915 of file GVector.cpp.
Referenced by cta_irf_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_rho::eval(), GEbounds::extend(), GEbounds::insert_eng(), gammalib::limit_omega(), GModelSpectralTable::load_par(), GCOMInstChars::max_coeff(), GModelSpatialDiffuseCube::mc(), GModelSpectralTable::print(), GRmf::read(), and GModelSpatialComposite::write().
double min | ( | const GVector & | vector | ) |
Computes minimum vector element.
[in] | vector | Vector. |
Definition at line 886 of file GVector.cpp.
Referenced by cta_irf_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_rho::eval(), GEbounds::extend(), GEbounds::insert_eng(), gammalib::limit_omega(), GModelSpectralTable::load_par(), GCOMInstChars::min_coeff(), GModelSpectralTable::print(), and GModelSpatialComposite::write().
double norm | ( | const GVector & | vector | ) |
Computes vector norm.
[in] | vector | Vector. |
Definition at line 864 of file GVector.cpp.
Referenced by GFft::backward(), GModelSpatialRadialProfile::cache_index(), GCOMObservation::compute_drb_bgdlixa(), GCOMObservation::compute_drb_bgdlixe(), GCOMObservation::compute_drb_phinor(), GCOMDri::compute_drg(), GSkyMap::convolution_kernel(), GModelSpectralPlawPhotonFlux::eflux(), cta_psf_radial_kerns_phi::eval(), GCTAModelIrfBackground::eval(), GModelSpatialDiffuseConst::eval(), GCTACubeEdisp::fill(), GCTACubePsf::fill(), GModelSpatialDiffuseConst::flux(), GModelSpectralPlawEnergyFlux::flux(), gammalib::gauss_integral(), GCTAOnOffObservation::GCTAOnOffObservation(), GEphemerides::geo2ssb(), GEphemerides::geo2ssb(), GCTAResponseCube::irf_radial(), GHealpix::max_pixrad(), GCTAModelAeffBackground::mc(), GCTAModelIrfBackground::mc(), GModelSky::mc(), GModelSpectralExpInvPlaw::mc(), GModelSpectralExpPlaw::mc(), GModelSpectralSuperExpPlaw::mc(), GModelSpatialDiffuseConst::mc_norm(), GModelSpatialDiffuseMap::mc_norm(), GModelSpatialElliptical::mc_norm(), GModelSpatialPointSource::mc_norm(), GModelSpatialRadial::mc_norm(), GModelSpectralBins::mc_update(), GModelSpectralNodes::mc_update(), GCTAOnOffObservation::N_bgd(), GCOMInstChars::ne213a_mfpath(), GLATPsfV3::normalize_psf(), GLATPsfV1::psf(), GCOMModelDRM::read(), GModelSpectralConst::read(), GModelSpectralExpInvPlaw::read(), GModelSpectralExpPlaw::read(), GModelSpectralLogParabola::read(), GModelSpectralPlaw::read(), GModelSpectralSuperExpPlaw::read(), GCTAModelSkyCube::read_xml_spatial(), GCTAOnOffObservation::rmf_stacked(), GCOMBvc::tdelta(), GCOMBvcs::tdelta(), GCTAPsfKing::update(), GModelSpectralBrokenPlaw::update_mc_cache(), GCOMD2Response::update_response_vector(), GCOMModelDRM::write(), GModelSpectralBrokenPlaw::write(), GModelSpectralExpInvPlaw::write(), GModelSpectralExpPlaw::write(), GModelSpectralLogParabola::write(), GModelSpectralPlaw::write(), GModelSpectralSmoothBrokenPlaw::write(), GModelSpectralSuperExpPlaw::write(), and GCTAModelSkyCube::write_xml_spatial().
Vector scalar product.
[in] | a | Vector. |
[in] | b | Vector. |
a
and b
.GException::invalid_argument | Mismatch between vector size. |
Returns the scalar product between vector a
and b
.
Definition at line 836 of file GVector.cpp.
Computes vector permutation.
[in] | vector | Vector. |
[in] | p | Permutation array. |
Definition at line 1011 of file GVector.cpp.
Referenced by GMatrixSparse::cholesky_solver().
Computes tanh of vector elements.
[in] | vector | Vector. |
[in] | power | Power. |
Definition at line 1422 of file GVector.cpp.
Referenced by GLATPsfV1::psf().
Computes sine of vector elements.
[in] | vector | Vector. |
Definition at line 1316 of file GVector.cpp.
Referenced by GSkyDir::cos_dist(), GLATMeanPsf::integral(), and GCTAModelRadialGauss::mc().
Computes sinh of vector elements.
[in] | vector | Vector. |
Definition at line 1337 of file GVector.cpp.
Computes square root of vector elements.
[in] | vector | Vector. |
Definition at line 1358 of file GVector.cpp.
Referenced by GSparseNumeric::cholesky_numeric_analysis(), GSparseSymbolic::cs_amd(), GCTAEventBin::error(), GEventBin::error(), GLATEventBin::error(), GOptimizerLM::errors(), GObservations::errors_hessian(), GCTAModelRadialGauss::omega(), GWcsAZP::prj_s2x(), GWcsAZP::prj_x2s(), GWcs::sph_s2x(), and GWcs::sph_x2s().
double sum | ( | const GVector & | vector | ) |
Computes vector sum.
[in] | vector | Vector. |
Definition at line 944 of file GVector.cpp.
Referenced by GCOMIaq::compton_kinematics(), GCTAOnOffObservation::compute_arf_cut(), GCTAPsfTable::containment_radius(), GSkyMap::convolution_kernel(), GSkyMap::counts(), GCTAEdisp2D::get_mean_rms(), GCTAEdisp2D::get_moments(), GResponse::irf_composite(), GResponse::irf_composite(), GCOMIaq::klein_nishina(), GCTAPsf2D::mc(), GModelSpatialComposite::mc(), GModelSpatialDiffuseMap::mc_cone(), GModelTemporalPhaseCurve::normalize_nodes(), GLATPsfV3::normalize_psf(), GCTAEdisp2D::normalize_table(), GCTAResponseIrf::nroi_composite(), GLATLtCubeMap::operator()(), GLATLtCubeMap::operator()(), GLATLtCubeMap::operator()(), GLATLtCubeMap::operator()(), GCTAPsfTable::precompute(), GModelSpatialDiffuseMap::prepare_map(), GCOMIaq::print(), GLATPsfV1::psf(), GCTAOnOffObservation::rmf_stacked(), GCOMIaq::set(), GLATMeanPsf::set_map_corrections(), GCTAEdispRmf::set_matrix(), GSkyMap::stack_maps(), GModelSpatialComposite::sum_of_scales(), GIntegral::trapzd(), and GModelSpectralComposite::update_mc_cache().
Computes tangens of vector elements.
[in] | vector | Vector. |
Definition at line 1379 of file GVector.cpp.
Computes tanh of vector elements.
[in] | vector | Vector. |
Definition at line 1400 of file GVector.cpp.