GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GVector.cpp File Reference

Vector class implementation. More...

#include "GVector.hpp"
#include "GTools.hpp"

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. More...
 
double operator* (const GVector &a, const GVector &b)
 Vector scalar product. More...
 
double norm (const GVector &vector)
 Computes vector norm. More...
 
double min (const GVector &vector)
 Computes minimum vector element. More...
 
double max (const GVector &vector)
 Computes maximum vector element. More...
 
double sum (const GVector &vector)
 Computes vector sum. More...
 
double angle (const GVector &a, const GVector &b)
 Computes angle between vectors. More...
 
GVector perm (const GVector &vector, const int *p)
 Computes vector permutation. More...
 
GVector iperm (const GVector &vector, const int *p)
 Computes vector inverse permutation. More...
 
GVector acos (const GVector &vector)
 Computes arccos of vector elements. More...
 
GVector acosh (const GVector &vector)
 Computes acosh of vector elements. More...
 
GVector asin (const GVector &vector)
 Computes arcsin of vector elements. More...
 
GVector asinh (const GVector &vector)
 Computes asinh of vector elements. More...
 
GVector atan (const GVector &vector)
 Computes arctan of vector elements. More...
 
GVector atanh (const GVector &vector)
 Computes atanh of vector elements. More...
 
GVector cos (const GVector &vector)
 Computes cosine of vector elements. More...
 
GVector cosh (const GVector &vector)
 Computes cosh of vector elements. More...
 
GVector exp (const GVector &vector)
 Computes exponential of vector elements. More...
 
GVector abs (const GVector &vector)
 Computes absolute of vector elements. More...
 
GVector log (const GVector &vector)
 Computes natural logarithm of vector elements. More...
 
GVector log10 (const GVector &vector)
 Computes base10 logarithm of vector elements. More...
 
GVector sin (const GVector &vector)
 Computes sine of vector elements. More...
 
GVector sinh (const GVector &vector)
 Computes sinh of vector elements. More...
 
GVector sqrt (const GVector &vector)
 Computes square root of vector elements. More...
 
GVector tan (const GVector &vector)
 Computes tangens of vector elements. More...
 
GVector tanh (const GVector &vector)
 Computes tanh of vector elements. More...
 
GVector pow (const GVector &vector, const double &power)
 Computes tanh of vector elements. More...
 

Detailed Description

Vector class implementation.

Author
Juergen Knoedlseder

Definition in file GVector.cpp.

Macro Definition Documentation

#define G_ANGLE   "angle(GVector&, GVector&)"

Definition at line 42 of file GVector.cpp.

Referenced by angle().

#define G_AT   "GVector::at(int&)"

Definition at line 39 of file GVector.cpp.

Referenced by GVector::at().

#define G_CONSTRUCTOR   "GVector::GVector(int&)"

Definition at line 36 of file GVector.cpp.

Referenced by GVector::GVector().

#define G_CROSS   "cross(GVector&, GVector&)"

Definition at line 40 of file GVector.cpp.

Referenced by cross().

#define G_OP_ADD   "GVector::operator+=(GVector&)"

Definition at line 37 of file GVector.cpp.

Referenced by GVector::operator+=().

#define G_OP_SUB   "GVector::operator-=(GVector&)"

Definition at line 38 of file GVector.cpp.

Referenced by GVector::operator-=().

#define G_SCALAR   "operator*(GVector&, GVector&)"

Definition at line 41 of file GVector.cpp.

Referenced by operator*().

Function Documentation

GVector abs ( const GVector vector)

Computes absolute of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the absolute of every element.

Definition at line 1253 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GMatrixSymmetric::abs(), GMatrix::abs(), GMatrixSparse::abs(), abs(), GIntegral::adaptive_gauss_kronrod(), GIntegral::adaptive_gauss_kronrod_aux(), GIntegral::adaptive_simpson(), GIntegral::adaptive_simpson_aux(), GFitsTable::alloc_column(), GCTAOnOffObservation::arf_rad_max(), GWcs::cel_set(), gammalib::compare(), GCOMDri::compute_dre(), GCTAPsf2D::containment_radius(), GSkyRegionRectangle::contains(), gammalib::cosd(), gammalib::erf(), gammalib::erfinv(), GOptimizerPar::error(), GCTAModelSkyCube::eval(), GCOMIaq::response_kernel::eval(), GCOMBvcs::find(), GIntegral::gauss_kronrod(), GObservations::likelihood::hessian(), GSPIResponse::irf_weight(), GOptimizerLM::iteration(), GWcs::lin_matinv(), GFitsTableCol::load_column_variable(), GSPIResponse::load_irf(), GModelSpectralBins::mc_update(), GModelSpectralFunc::mc_update(), GModelSpectralNodes::mc_update(), GDerivative::minuit2(), GSkyDir::moon(), GCOMInstChars::multi_scatter(), GCOMD1Response::operator()(), GCTACubeBackground::operator()(), GSkyMap::operator()(), operator==(), GOptimizerLM::optimize(), GSkyRegionRectangle::overlaps(), gammalib::plaw_energy_flux(), gammalib::plaw_integral(), gammalib::plaw_photon_flux(), GIntegrals::polint(), GIntegral::polint(), GOptimizerLM::print(), GWcsAZP::prj_s2x(), GWcsMOL::prj_s2x(), GWcsSIN::prj_s2x(), GWcsAZP::prj_set(), GWcsAIT::prj_x2s(), GWcsMOL::prj_x2s(), GWcsAZP::prj_x2s(), GCOMInstChars::read_selfveto(), GSkyMap::read_wcs(), GIntegral::rescale_error(), gammalib::resolution(), GDerivative::ridder(), GHealpix::ring_above(), GIntegral::romberg(), GIntegrals::romberg(), GFitsTableCol::save_column_variable(), GMatrixBase::scale_elements(), GCTACubePsf::set_delta_axis(), GSPIResponse::set_wcs(), GNodeArray::setup(), gammalib::sincosd(), gammalib::sind(), GWcs::sph_s2x(), GWcs::sph_x2s(), gammalib::str(), gammalib::tand(), GCOMBvcs::tdelta(), GTestSuite::test_value(), GFitsTableCol::tform_binary(), GFitsTable::update_header(), GModelSpectralTable::update_mc(), GModelSpectralBrokenPlaw::update_mc_cache(), GCOMD2Response::update_response_vector(), GDerivative::value(), and GPha::write().

GVector acos ( const GVector vector)

Computes arccos of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the arccos of every element.

Definition at line 1064 of file GVector.cpp.

References gammalib::acos(), GVector::m_data, and GVector::m_num.

GVector acosh ( const GVector vector)

Computes acosh of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the acosh of every element.

Definition at line 1085 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by acosh().

double angle ( const GVector a,
const GVector b 
)

Computes angle between vectors.

Parameters
[in]aVector.
[in]bVector.
Returns
Angle between vector a and b in radians.
Exceptions
GException::invalid_argumentMismatch 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.

References gammalib::acos(), G_ANGLE, GVector::m_num, norm(), and gammalib::str().

Referenced by GHealpix::max_pixrad().

GVector asin ( const GVector vector)

Computes arcsin of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the arcsin of every element.

Definition at line 1106 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by gammalib::acos(), asin(), gammalib::asind(), GHorizDir::celvector(), GSkyDir::celvector(), GSkyDir::euler(), GSkyDir::galvector(), GCTAPointing::instdir(), GHealpix::loc2dir(), GSkyDir::moon(), GWcsMOL::prj_x2s(), GCOMOads::read(), and GSkyDir::sun().

GVector asinh ( const GVector vector)

Computes asinh of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the asinh of every element.

Definition at line 1127 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by asinh().

GVector atan ( const GVector vector)
GVector atanh ( const GVector vector)

Computes atanh of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the atanh of every element.

Definition at line 1169 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by atanh().

GVector cos ( const GVector vector)

Computes cosine of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the cosine of every element.

Definition at line 1190 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GHorizDir::celvector(), GSkyDir::celvector(), gammalib::com_energy2(), GCOMDri::compute_drx(), GCOMDri::compute_geometry(), GSkyRegionCircle::compute_solid_angle(), cos(), GSkyDir::cos_dist(), gammalib::cosd(), cta_psf_radial_kerns_delta::cta_psf_radial_kerns_delta(), GHealpix::dir2pix(), GSkyRegionRectangle::dir_to_local(), GHorizDir::dist(), GSkyDir::euler(), GMatrix::eulerx(), GMatrix::eulery(), GMatrix::eulerz(), cta_psf_radial_kerns_delta::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), com_radial_kerns_rho::eval(), GModelSpatialEllipticalGeneralGauss::eval(), GModelSpatialRadialProfileDMBurkert::halo_kernel_los::eval(), GModelSpatialRadialProfileDMEinasto::halo_kernel_los::eval(), cta_psf_radial_kerns_phi::eval(), GModelSpatialRadialProfileDMZhao::halo_kernel_los::eval(), GCTAModelIrfBackground::npred_roi_kern_phi::eval(), com_radial_kerns_omega::eval(), GCTAModelAeffBackground::npred_roi_kern_phi::eval(), GCTAModelSpatial::npred_roi_kern_phi::eval(), com_elliptical_kerns_rho::eval(), cta_irf_radial_kern_rho::eval(), com_elliptical_kerns_omega::eval(), GResponse::irf_radial_kern_phi::eval(), cta_irf_radial_kern_omega::eval(), GResponse::irf_elliptical_kern_phi::eval(), cta_nroi_radial_kern_rho::eval(), cta_nroi_radial_kern_omega::eval(), cta_irf_elliptical_kern_rho::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_irf_diffuse_kern_theta::eval(), cta_irf_diffuse_kern_phi::eval(), cta_nroi_diffuse_kern_phi::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_omega::eval(), cta_psf_radial_kern_delta::eval(), cta_psf_radial_kern_phi::eval(), cta_psf_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_omega::eval(), cta_psf_diffuse_kern_delta::eval(), cta_psf_diffuse_kern_phi::eval(), GModelSpatialRadialShell::f1(), GModelSpatialRadialShell::f2(), GFft::factor7(), GSkyDir::galvector(), GTime::gast(), GCTAPointing::instdir(), GHealpix::interpolator(), GCTAResponseIrf::irf_radial(), GSPIResponse::irf_value(), GCOMIaq::klein_nishina_bin(), GCTABackgroundPerfTable::load(), GHealpix::loc2dir(), GCOMIaq::location_spread(), GCTABackgroundPerfTable::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialGauss::mc(), GModelSpatialRadialDisk::mc(), GCTAPsfTable::mc(), GCTAModelRadialPolynom::mc(), GCTAModelRadialProfile::mc(), GModelSpatialEllipticalDisk::mc(), GModelSpatialDiffuseMap::mc_cone(), GModelSpatialDiffuseCube::mc_cone(), GModelSpatialDiffuseConst::mc_norm(), GSkyDir::moon(), GCOMInstChars::multi_scatter(), GSkyDir::posang(), GSkyDir::precess(), GWcsMOL::prj_s2x(), GWcsSFL::prj_x2s(), gammalib::roi_arclength(), GSkyDir::rotate(), GHorizDir::rotate_deg(), GFftWavetable::set_members(), GSkyRegionMap::set_region_rectangle(), GHealpix::set_z_phi(), gammalib::sincosd(), GCTAPointing::skydir(), GWcs::solidangle(), GSkyDir::sun(), GModelSpatialEllipticalDisk::update(), GModelSpatialRadialDisk::update(), GModelSpatialEllipticalGauss::update(), GModelSpatialRadialRing::update(), and GModelSpatialEllipticalGeneralGauss::update().

GVector cosh ( const GVector vector)

Computes cosh of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the cosh of every element.

Definition at line 1211 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by cosh().

GVector cross ( const GVector a,
const GVector b 
)

Vector cross product.

Parameters
[in]aVector.
[in]bVector.
Returns
Vector cross product.
Exceptions
GException::invalid_argumentMismatch 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.

References G_CROSS, GVector::m_data, GVector::m_num, and gammalib::str().

Referenced by GHealpix::max_pixrad(), and GWcs::solidangle().

GVector exp ( const GVector vector)

Computes exponential of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the exponential of every element.

Definition at line 1232 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GCOMDri::compute_drx(), GSPIResponse::compute_irf(), GCTAPsf2D::containment_radius(), GSkyMap::convolution_kernel(), GModelSpatialDiffuseCube::cube_intensity(), gammalib::erf(), gammalib::erfinv(), GCTAModelSpatialGaussSpectrum::eval(), GModelSpectralExponential::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialRadialGeneralGauss::eval(), GCTAModelRadialGauss::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpatialEllipticalGeneralGauss::eval(), GCTAModelSkyCube::eval(), GModelSpectralGauss::eval(), GCTABackgroundPerfTable::integrand::eval(), GCTAModelRadialGauss::integrand::eval(), GCOMD2Response::kn_gauss_kernel::eval(), GModelSpectralExponential::flux_kern::eval(), GModelSpatialRadialProfileDMEinasto::halo_kernel_los::eval(), GModelSpectralGauss::eflux_kernel::eval(), GCOMD2Response::bkg_gauss_kernel::eval(), GModelSpectralExpPlaw::flux_kernel::eval(), GModelSpectralExpInvPlaw::flux_kernel::eval(), GModelSpectralSuperExpPlaw::flux_kernel::eval(), GCOMIaq::smearing_kernel::eval(), GModelSpectralExpPlaw::eflux_kernel::eval(), GModelSpectralExpInvPlaw::eflux_kernel::eval(), GModelSpectralSuperExpPlaw::eflux_kernel::eval(), GObservation::npred_spec_kern::eval(), GModelSky::flux_kern::eval(), GModelSky::eflux_kern::eval(), exp(), GModelSpatialDiffuseCube::flux(), GCTAEdisp2D::gaussian_array(), GSPIResponse::irf_weight(), GCTABackgroundPerfTable::mc(), GCTAModelRadialGauss::mc(), GModelSpectralBins::mc(), GModelSpectralTable::mc(), GModelSpatialDiffuseCube::mc(), GModelSpectralFunc::mc(), GModelSpectralPlaw::mc(), GModelSpectralExpPlaw::mc(), GModelSpectralLogParabola::mc(), GModelSpectralBrokenPlaw::mc(), GModelSpectralSuperExpPlaw::mc(), GModelSpectralExpInvPlaw::mc(), GModelSpectralPlawPhotonFlux::mc(), GModelSpectralPlawEnergyFlux::mc(), GModelSpectralNodes::mc(), GCOMInstChars::multi_scatter(), GCOMInstChars::ne213a_mfpath(), GCTABackgroundPerfTable::operator()(), GCOMD1Response::operator()(), GCTAAeffPerfTable::operator()(), GCOMD2Response::operator()(), GCTAPsfPerfTable::operator()(), GCTAPsfVector::operator()(), GCTAAeffArf::operator()(), GCTABackground2D::operator()(), GCTABackground3D::operator()(), GCTAPsf2D::operator()(), GCTACubeBackground::operator()(), GCTAEdispPerfTable::operator()(), GArf::operator()(), GRan::poisson(), GCOMInstChars::print(), GWcsMER::prj_x2s(), GCOMInstChars::prob_D1inter(), GCOMInstChars::prob_D2inter(), GCOMInstChars::prob_no_multihit(), GModelSpatialRadialProfileGauss::profile_value(), GCTABackgroundPerfTable::rate(), GCTABackgroundPerfTable::rate_ebin(), GLATMeanPsf::set_offsets(), GEnergies::set_pow(), GCOMInstChars::trans_D1(), GCOMInstChars::trans_D2(), GCOMInstChars::trans_V1(), GCOMInstChars::trans_V23(), GModelSpatialRadialGeneralGauss::update(), GModelSpatialEllipticalGeneralGauss::update(), GModelSpectralExpPlaw::update_eval_cache(), GModelSpectralSuperExpPlaw::update_eval_cache(), GModelSpectralExpInvPlaw::update_eval_cache(), GCOMD2Response::update_response_vector(), and GCOMDris::vetorate_update_activ().

GVector iperm ( const GVector vector,
const int *  p 
)

Computes vector inverse permutation.

Parameters
[in]vectorVector.
[in]pPermutation array.
Returns
Inversely permuted vector.

Definition at line 1038 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GMatrixSparse::cholesky_solver().

GVector log ( const GVector vector)

Computes natural logarithm of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the natural logarithm of every element.

Definition at line 1274 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GRan::chisq2(), GCTAPsfPerfTable::containment_radius(), GCTAPsfVector::containment_radius(), GLog::copy_members(), GModelSpatialDiffuseCube::cube_intensity(), GModelSpectralPlawEnergyFlux::eflux(), GModelSpectralPlawPhotonFlux::eflux(), GModelSky::eflux(), gammalib::erfinv(), GModelSpectralBins::eval(), GCTAModelSkyCube::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GCOMDris::likelihood::eval(), GCOMD2Response::kn_gauss_kernel::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GModelSpectralLogParabola::flux_kern::eval(), GRan::exp(), GModelSpatialRadialShell::f2(), GModelSpatialDiffuseCube::flux(), GModelSpectralPlawPhotonFlux::flux(), GModelSpectralPlawEnergyFlux::flux(), GModelSky::flux(), gammalib::gammln(), GEphemerides::geo2ssb(), GOptimizerLM::GOptimizerLM(), gammalib::iter_phi(), gammalib::iter_rho(), GCOMIaq::klein_nishina_integral(), GCOMInstChars::kn_cross_section(), GCTAOnOffObservation::likelihood_cstat(), GObservation::likelihood_poisson_binned(), GObservation::likelihood_poisson_unbinned(), GCTABackgroundPerfTable::load(), log(), GOptimizerLM::logger(), GModelSpectralBins::mc(), GModelSpatialDiffuseCube::mc(), GModelSpectralTable::mc(), GModelSpectralFunc::mc(), GModelSpectralPlaw::mc(), GModelSpectralExpPlaw::mc(), GModelSpectralLogParabola::mc(), GModelSpectralBrokenPlaw::mc(), GModelSpectralSuperExpPlaw::mc(), GModelSpectralExpInvPlaw::mc(), GModelSpectralPlawEnergyFlux::mc(), GModelSpectralPlawPhotonFlux::mc(), GModelSpectralNodes::mc(), GModelSpectralBins::mc_update(), GModelSpectralFunc::mc_update(), GModelSpectralNodes::mc_update(), GCOMInstChars::ne213a_mfpath(), GRan::normal(), GObservation::npred_spec(), GCTABackground3D::operator()(), GCTABackground2D::operator()(), GCTACubeBackground::operator()(), GArf::operator()(), operator<<(), gammalib::plaw_energy_flux(), gammalib::plaw_integral(), gammalib::plaw_photon_flux(), GRan::poisson(), GWcsMER::prj_s2x(), GCOMInstChars::prob_D1inter(), GCOMInstChars::prob_D2inter(), GCOMInstChars::prob_no_multihit(), GCOMInstChars::read_coeffs(), GModelSpectralFunc::set_cache(), GModelSpectralNodes::set_flux_cache(), GLATMeanPsf::set_offsets(), GEnergies::set_pow(), GCOMBvc::tdelta(), GCOMBvcs::tdelta(), GCOMInstChars::trans_D1(), GCOMInstChars::trans_D2(), GCOMInstChars::trans_V1(), GCOMInstChars::trans_V23(), GModelSpectralPlawPhotonFlux::update(), GModelSpectralPlawEnergyFlux::update(), GModelSpectralPlaw::update_eval_cache(), GModelSpectralLogParabola::update_eval_cache(), GModelSpectralBrokenPlaw::update_eval_cache(), GModelSpectralSmoothBrokenPlaw::update_eval_cache(), GModelSpectralTable::update_flux(), GModelSpectralTable::update_mc(), GModelSpectralPlaw::update_mc_cache(), GModelSpectralExpPlaw::update_mc_cache(), GModelSpectralLogParabola::update_mc_cache(), GModelSpectralBrokenPlaw::update_mc_cache(), GModelSpectralExpInvPlaw::update_mc_cache(), GModelSpectralSuperExpPlaw::update_mc_cache(), GCOMDris::vetorate_fit(), and GCTAOnOffObservation::wstat_value().

double norm ( const GVector vector)

Computes vector norm.

Parameters
[in]vectorVector.
Returns
Vector norm.

Definition at line 864 of file GVector.cpp.

References GVector::m_data, GVector::m_num, and sqrt().

Referenced by angle(), GFft::backward(), GModelSpatialRadialProfile::cache_index(), GCOMObservation::compute_drb_bgdlixa(), GCOMObservation::compute_drb_bgdlixe(), GCOMObservation::compute_drb_bgdlixf(), GCOMObservation::compute_drb_phinor(), GCOMDri::compute_drg(), GSkyMap::convolution_kernel(), GModelSpectralPlawPhotonFlux::eflux(), GModelSpatialDiffuseConst::eval(), GCTAModelIrfBackground::eval(), GCOMDris::likelihood::eval(), cta_psf_radial_kerns_phi::eval(), GCTACubePsf::fill(), GCTACubeEdisp::fill(), GModelSpatialDiffuseConst::flux(), GModelSpectralPlawEnergyFlux::flux(), gammalib::gauss_integral(), GCTAOnOffObservation::GCTAOnOffObservation(), GEphemerides::geo2ssb(), GCTAResponseCube::irf_radial(), GCOMDris::likelihood::likelihood(), GHealpix::max_pixrad(), GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GModelSpectralExpPlaw::mc(), GModelSpectralExpInvPlaw::mc(), GModelSpectralSuperExpPlaw::mc(), GModelSky::mc(), GModelSpatialDiffuseConst::mc_norm(), GModelSpatialDiffuseMap::mc_norm(), GModelSpatialPointSource::mc_norm(), GModelSpatialElliptical::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(), GModelSpectralPlaw::read(), GModelSpectralExpPlaw::read(), GModelSpectralLogParabola::read(), GModelSpectralExpInvPlaw::read(), GModelSpectralSuperExpPlaw::read(), GCTAModelSkyCube::read_xml_spatial(), GCTAOnOffObservation::rmf_stacked(), GCOMBvc::tdelta(), GCOMBvcs::tdelta(), GCTAPsfKing::update(), GModelSpectralBrokenPlaw::update_mc_cache(), GCOMD2Response::update_response_vector(), GCOMDris::vetorate_fit(), GCOMDris::vetorate_update_activ(), GCOMModelDRM::write(), GModelSpectralPlaw::write(), GModelSpectralExpPlaw::write(), GModelSpectralLogParabola::write(), GModelSpectralBrokenPlaw::write(), GModelSpectralExpInvPlaw::write(), GModelSpectralSuperExpPlaw::write(), GModelSpectralSmoothBrokenPlaw::write(), and GCTAModelSkyCube::write_xml_spatial().

double operator* ( const GVector a,
const GVector b 
)

Vector scalar product.

Parameters
[in]aVector.
[in]bVector.
Returns
Product between vector a and b.
Exceptions
GException::invalid_argumentMismatch between vector size.

Returns the scalar product between vector a and b.

Definition at line 836 of file GVector.cpp.

References G_SCALAR, GVector::m_data, GVector::m_num, and gammalib::str().

GVector perm ( const GVector vector,
const int *  p 
)

Computes vector permutation.

Parameters
[in]vectorVector.
[in]pPermutation array.
Returns
Permuted vector.

Definition at line 1011 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GMatrixSparse::cholesky_solver().

GVector pow ( const GVector vector,
const double &  power 
)

Computes tanh of vector elements.

Parameters
[in]vectorVector.
[in]powerPower.
Returns
Vector containing the power of every element.

Definition at line 1422 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GLATPsfV1::base_fct(), GLATPsfV3::base_fct(), GLATPsfV1::base_int(), GLATPsfV3::base_int(), GCTAPsfKing::containment_radius(), GModelSpectralPlawEnergyFlux::eflux(), GModelSpectralPlawPhotonFlux::eflux(), gammalib::elogmean(), GModelSpatialRadialGeneralGauss::eval(), GModelSpectralBins::eval(), GModelSpatialEllipticalGeneralGauss::eval(), GCTAModelRadialProfile::eval(), GModelSpectralFunc::eval(), GModelSpectralNodes::eval(), GCOMD2Response::kn_gauss_kernel::eval(), GModelSpatialRadialProfileDMEinasto::halo_kernel_los::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GModelSpatialRadialProfileDMZhao::halo_kernel_los::eval(), GCOMIaq::response_kernel::eval(), GModelSpectralExpPlaw::flux_kernel::eval(), GModelSpectralLogParabola::flux_kern::eval(), GModelSpectralExpInvPlaw::flux_kernel::eval(), GModelSpectralSuperExpPlaw::flux_kernel::eval(), GModelSpectralExpPlaw::eflux_kernel::eval(), GModelSpectralExpInvPlaw::eflux_kernel::eval(), GModelSpectralSmoothBrokenPlaw::flux_kern::eval(), GModelSpectralSuperExpPlaw::eflux_kernel::eval(), GModelSpectralPlawEnergyFlux::flux(), GModelSpectralPlawPhotonFlux::flux(), GCTABackgroundPerfTable::load(), GEnergy::log10MeV(), GCTAPsfKing::mc(), GModelSpectralLogParabola::mc(), GModelSpectralSuperExpPlaw::mc(), GModelSpectralPlawEnergyFlux::mc(), GModelSpectralPlawPhotonFlux::mc(), GModelSpectralBins::mc_update(), GModelSpectralFunc::mc_update(), GModelSpectralNodes::mc_update(), GCTAPsfKing::operator()(), gammalib::plaw_energy_flux(), gammalib::plaw_integral(), gammalib::plaw_photon_flux(), pow(), GModelSpatialDiffuseCube::print(), GCTAPsfVector::print(), GCTAPsfPerfTable::print(), GCTAEdispPerfTable::print(), GCOMInstChars::psd_correction(), GLATPsfV1::psf(), GCTAPsfKing::r_max(), GLATResponseTable::read(), GIntegral::rescale_error(), GLATPsfBase::scale_factor(), GModelSpectralFunc::set_cache(), GModelSpectralNodes::set_flux_cache(), GEnergies::set_log(), GEnergies::set_pow(), GCTAPsfKing::update(), GModelSpectralPlawEnergyFlux::update(), GModelSpectralPlawPhotonFlux::update(), GModelSpectralPlaw::update_eval_cache(), GModelSpectralExpPlaw::update_eval_cache(), GModelSpectralLogParabola::update_eval_cache(), GModelSpectralBrokenPlaw::update_eval_cache(), GModelSpectralSuperExpPlaw::update_eval_cache(), GModelSpectralExpInvPlaw::update_eval_cache(), GModelSpectralSmoothBrokenPlaw::update_eval_cache(), GModelSpectralTable::update_flux(), GModelSpectralTable::update_mc(), GModelSpectralPlaw::update_mc_cache(), GModelSpectralExpPlaw::update_mc_cache(), GModelSpectralLogParabola::update_mc_cache(), GModelSpectralBrokenPlaw::update_mc_cache(), GModelSpectralSuperExpPlaw::update_mc_cache(), GModelSpectralExpInvPlaw::update_mc_cache(), GModelSpectralSmoothBrokenPlaw::update_mc_cache(), and GModelSpatialDiffuseCube::write().

GVector sin ( const GVector vector)

Computes sine of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the sine of every element.

Definition at line 1316 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GModelSpatialRadialProfile::cache_index(), GHorizDir::celvector(), GSkyDir::celvector(), GCOMDri::compute_geometry(), GSkyRegionRectangle::compute_solid_angle(), GCTAPsfTable::containment_radius(), GSkyDir::cos_dist(), cta_psf_radial_kerns_delta::cta_psf_radial_kerns_delta(), GSkyRegionRectangle::dir_to_local(), GHorizDir::dist(), GSkyDir::euler(), GMatrix::eulerx(), GMatrix::eulery(), GMatrix::eulerz(), cta_psf_radial_kerns_delta::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpatialEllipticalGeneralGauss::eval(), com_radial_kerns_rho::eval(), GModelSpatialRadialShell::eval(), GLATPsfV1::base_integrand::eval(), GLATPsfV3::base_integrand::eval(), GCTABackgroundPerfTable::integrand::eval(), cta_npsf_kern_rad_azsym::eval(), GCTAModelRadialGauss::integrand::eval(), GCTAModelRadialPolynom::integrand::eval(), GCTAModelIrfBackground::npred_roi_kern_theta::eval(), GCTAModelRadialProfile::integrand::eval(), GCTAModelAeffBackground::npred_roi_kern_theta::eval(), cta_psf_radial_kerns_phi::eval(), GCTAModelRadialAcceptance::roi_kern::eval(), GCTAModelSpatial::npred_roi_kern_theta::eval(), GCTAModelIrfBackground::npred_roi_kern_phi::eval(), com_radial_kerns_omega::eval(), GCTAModelAeffBackground::npred_roi_kern_phi::eval(), GCTAModelSpatial::npred_roi_kern_phi::eval(), GModelSpatial::circle_int_kern_rho::eval(), com_elliptical_kerns_rho::eval(), cta_irf_radial_kern_rho::eval(), GResponse::irf_radial_kern_theta::eval(), com_elliptical_kerns_omega::eval(), GResponse::irf_radial_kern_phi::eval(), GResponse::irf_elliptical_kern_theta::eval(), GResponse::irf_elliptical_kern_phi::eval(), cta_nroi_radial_kern_rho::eval(), cta_nroi_radial_kern_omega::eval(), cta_irf_elliptical_kern_rho::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_irf_diffuse_kern_theta::eval(), cta_irf_diffuse_kern_phi::eval(), cta_nroi_diffuse_kern_theta::eval(), cta_nroi_diffuse_kern_phi::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_delta::eval(), cta_psf_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_omega::eval(), cta_psf_diffuse_kern_delta::eval(), cta_psf_diffuse_kern_phi::eval(), GFft::factor5(), GFft::factor7(), GSkyDir::galvector(), GTime::gast(), GCTAPointing::instdir(), GLATMeanPsf::integral(), GCOMResponse::irf_diffuse(), GCTAResponseIrf::irf_radial(), GSPIResponse::irf_value(), GHealpix::loc2dir(), GCOMIaq::location_spread(), GCTABackgroundPerfTable::mc(), GModelSpatialRadialGeneralGauss::mc(), GCTAModelRadialGauss::mc(), GCTAModelRadialPolynom::mc(), GCTAModelRadialProfile::mc(), GModelSpatialEllipticalGeneralGauss::mc(), GModelSpatialRadialShell::mc(), GCTAModelRadialPolynom::mc_max_value(), GCTAModelRadialProfile::mc_max_value(), GSkyDir::moon(), GCOMInstChars::multi_scatter(), GSkyDir::posang(), GSkyDir::precess(), GCTAPsfTable::precompute(), GWcsMOL::prj_s2x(), GCOMResponse::read(), gammalib::roi_arclength(), GSkyDir::rotate(), GHorizDir::rotate_deg(), GFftWavetable::set_members(), GSkyRegionMap::set_region_rectangle(), GHealpix::set_z_phi(), sin(), gammalib::sincosd(), gammalib::sind(), GCTAPointing::skydir(), GWcs::solidangle(), GSkyDir::sun(), GModelSpatialEllipticalGauss::update(), GModelSpatialEllipticalGeneralGauss::update(), GModelSpatialRadialShell::update(), and GCOMResponse::write().

GVector sinh ( const GVector vector)

Computes sinh of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the sinh of every element.

Definition at line 1337 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by sinh().

GVector sqrt ( const GVector vector)

Computes square root of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the square root of every element.

Definition at line 1358 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GIntegral::adaptive_gauss_kronrod(), GIntegral::adaptive_gauss_kronrod_aux(), GHealpix::ang2pix_z_phi_nest(), GHealpix::ang2pix_z_phi_ring(), GCTAResponseTable::axis_log10(), GWcs::cel_set(), GRan::chisq2(), GMatrixSymmetric::cholesky_decompose(), GSparseNumeric::cholesky_numeric_analysis(), GCOMDri::compute_geometry(), GCOMDri::compute_overlap(), GCOMDri::compute_surface(), GCOMDri::compute_tof_correction(), GCTAPsfPerfTable::containment_radius(), GCTAPsfVector::containment_radius(), GCTAPsfKing::containment_radius(), GSkyMap::convolution_kernel(), GSparseSymbolic::cs_amd(), GModelSky::eflux_error(), GEbounds::elogmean(), GCTAEventBin::emin(), gammalib::erfinv(), GLATEventBin::error(), GCOMEventBin::error(), GCTAEventBin::error(), GSPIEventBin::error(), GEventBin::error(), GOptimizerLM::errors(), GObservations::errors_hessian(), GCTAEdisp2D::etrue(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpatialEllipticalGeneralGauss::eval(), GModelSpatialRadialShell::eval(), GModelSpatialRadialProfileDMBurkert::halo_kernel_los::eval(), GModelSpatialRadialProfileDMEinasto::halo_kernel_los::eval(), cta_psf_radial_kerns_phi::eval(), GModelSpatialRadialProfileDMZhao::halo_kernel_los::eval(), GCOMIaq::response_kernel::eval(), cta_irf_elliptical_kern_rho::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_psf_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_omega::eval(), GModelSpatialRadialShell::f1(), GFft::factor3(), GFft::factor5(), GFft::factor6(), GModelSky::flux_error(), GCTACubePsf::GCTACubePsf(), GCTAEdisp2D::get_mean_rms(), GHealpix::get_ring_info(), GObservations::likelihood::hessian(), GHealpix::isqrt(), GHealpix::loc2dir(), GSkyRegionRectangle::local_to_dir(), GCOMIaq::location_spread(), GModelSpatialRadialProfileDMBurkert::mass_density(), GModelSpatialRadialProfileDMEinasto::mass_density(), GModelSpatialRadialProfileDMZhao::mass_density(), GCTABackgroundPerfTable::mc(), GCTAModelRadialGauss::mc(), GCTAPsfKing::mc(), GModelSpatialEllipticalGauss::mc(), GModelTemporalLightCurve::mc(), GDerivative::minuit2(), GCOMInstChars::multi_scatter(), norm(), GRan::normal(), GCTAModelRadialGauss::omega(), GCTABackgroundPerfTable::operator()(), GCOMD2Response::operator()(), GCTABackground2D::operator()(), GRan::poisson(), GWcsAZP::prj_s2x(), GWcsAIT::prj_s2x(), GWcsSIN::prj_x2s(), GWcsMOL::prj_x2s(), GWcsAZP::prj_x2s(), GWcsSTG::prj_x2s(), GWcsARC::prj_x2s(), GWcsAIT::prj_x2s(), GWcsTAN::prj_x2s(), GCTAPsfKing::r_max(), GCTABackground2D::rate_ebin(), GCOMOads::read(), GHealpix::ring_above(), GLATPsfBase::scale_factor(), GModelSpectralBins::set_cache(), GModelSpectralFunc::set_cache(), GCTACubePsf::set_delta_axis(), GModelSpectralNodes::set_flux_cache(), GCTABackground3D::set_members(), GCTABackground2D::set_members(), GHealpix::set_z_phi(), GCTAPointing::skydir(), GCTABackground3D::solid_angle(), GCTABackground2D::solid_angle(), GWcs::solidangle(), GCTABackgroundPerfTable::solidangle(), GSkyMap::solidangle(), GWcs::sph_s2x(), GWcs::sph_x2s(), sqrt(), GCTAInstDir::theta(), GModelSpatialEllipticalDisk::update(), GCTACubePsf::update(), GModelSpectralTable::update_flux(), GPha::write(), and GCTAOnOffObservation::wstat_value().

GVector tan ( const GVector vector)

Computes tangens of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the tangens of every element.

Definition at line 1379 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by GCOMDri::compute_geometry(), cta_psf_radial_kerns_delta::cta_psf_radial_kerns_delta(), GSkyDir::moon(), GRan::poisson(), GSkyDir::posang(), GCTABackground3D::solid_angle(), GCTABackground2D::solid_angle(), GWcs::solidangle(), GSkyMap::solidangle(), tan(), and gammalib::tand().

GVector tanh ( const GVector vector)

Computes tanh of vector elements.

Parameters
[in]vectorVector.
Returns
Vector containing the tanh of every element.

Definition at line 1400 of file GVector.cpp.

References GVector::m_data, and GVector::m_num.

Referenced by tanh().