Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JMATH::JMath< JFirst_t, JSecond_t > Struct Template Reference

Auxiliary base class for aritmetic operations of derived class types. More...

#include <JMath.hh>

Inheritance diagram for JMATH::JMath< JFirst_t, JSecond_t >:
JTOOLS::JArray< NUMBER_OF_DIMENSIONS, abscissa_type > JTOOLS::JArray< NUMBER_OF_DIMENSIONS, argument_type > JTOOLS::JCollection< JElement_t, JDistance< typename JElement_t::abscissa_type > > JTOOLS::JCollection< JElement2D< JKey_t, JValue_t >, JDistance< JKey_t > > JTOOLS::JCollection< JElement2D< JKey_t, JHistogram_t >, JDistance< JKey_t > > JTOOLS::JCollection< JElement2D_t > JTOOLS::JMap< JKey_t, JHistogram_t, JDistance< JKey_t > > JTOOLS::JMap< JKey_t, JValue_t, JDistance< JKey_t > > JTOOLS::JRange< double > JTOOLS::JRange< counter_type > JTOOLS::JRange< JAbscissa_t > JTOOLS::JRange< JDAQHit::JTOT_t > JTOOLS::JRange< abscissa_type > JTOOLS::JRange< int > JTOOLS::JTable2D< N, N, double > JTOOLS::JTuple< JHead_t > JTOOLS::JTuple< JTail_t > JACOUSTICS::JKatoomba< JType >::H_t JACOUSTICS::JMODEL::JEmission JACOUSTICS::JMODEL::JString JACOUSTICS::JModel JCALIBRATE::JParameter_t JCOMPASS::JModel JDATABASE::JPBSSequences JDATABASE::JSelector JFIT::JEnergy JFIT::JLine3EZ JFIT::JLine3Z JFIT::JShower3EZ JFIT::JShower3Z JFIT::JShowerEH JGEOMETRY2D::JAngle2D JGEOMETRY2D::JVector2D JGEOMETRY3D::JAngle3D JGEOMETRY3D::JEulerAngle3D JGEOMETRY3D::JQuaternion3D JGEOMETRY3D::JQuaternion3D JGEOMETRY3D::JQuaternion3D JGEOMETRY3D::JQuaternion3D JGEOMETRY3D::JRotation3D JGEOMETRY3D::JVector3D JGEOMETRY3D::JVersor3D JGEOMETRY3D::JVersor3Z JGEOMETRY3D::JVertex3D JTOOLS::JArray< N, T > JTOOLS::JArray< 1, T > JTOOLS::JBin2D< JAbscissa_t, JOrdinate_t > JTOOLS::JCollection< JElement_t, JDistance_t > JTOOLS::JHistogram1D< JElement_t, JContainer_t, JDistance_t > JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t > JTOOLS::JMap< JKey_t, JValue_t, JDistance_t > JTOOLS::JMultiMap< JAbscissa_t, JOrdinate_t, JMapList< JHead_t, JLANG::JNullType >, JDistance_t > JTOOLS::JMultiMap< JAbscissa_t, JOrdinate_t, JMapList< JHead_t, JTail_t >, JDistance_t > JTOOLS::JQuantile JTOOLS::JRange< T, JComparator_t > JTOOLS::JResultDerivative< JResult_t > JTOOLS::JResultHesse< JResult_t > JTOOLS::JResultPDF< JResult_t > JTOOLS::JResultPolynome< N, JResult_t > JTOOLS::JTable2D< NX, NY, JData_t > JTOOLS::JTuple< T > JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > > JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > > JUTM::JUTMPosition

Public Member Functions

JFirst_t & mul (const JSecond_t &object)
 Multiply with object.
 

Friends

JFirst_t & operator*= (JFirst_t &first, const JSecond_t &second)
 Multiply with object.
 
JFirst_t operator* (const JFirst_t &first, const JSecond_t &second)
 Multiply objects.
 

Detailed Description

template<class JFirst_t, class JSecond_t>
struct JMATH::JMath< JFirst_t, JSecond_t >

Auxiliary base class for aritmetic operations of derived class types.

Specialisation of JMath for two data types.

This class provides for the object multiplication operators *= *. The template parameter should then have the member method:

      JFirst_t& mul(const JFirst_t&, const JSecond_t&);

where JFirst_t and JSecond_t refer to the first and second template parameter, respectively.

This class uses in-class friend operators (see Barton-Nackman trick).

Definition at line 346 of file JMath.hh.

Member Function Documentation

◆ mul()

template<class JFirst_t , class JSecond_t >
JFirst_t & JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t & object)
inline

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 354 of file JMath.hh.

355 {
356 return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357 }

Friends And Related Symbol Documentation

◆ operator*=

template<class JFirst_t , class JSecond_t >
JFirst_t & operator*= ( JFirst_t & first,
const JSecond_t & second )
friend

Multiply with object.

Parameters
firstfirst object
secondsecond object
Returns
result object

Definition at line 367 of file JMath.hh.

368 {
369 return first.mul(second);
370 }

◆ operator*

template<class JFirst_t , class JSecond_t >
JFirst_t operator* ( const JFirst_t & first,
const JSecond_t & second )
friend

Multiply objects.

Parameters
firstfirst object
secondsecond object
Returns
result object

Definition at line 380 of file JMath.hh.

381 {
382 return JFirst_t(first).mul(second);
383 }

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