Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
JACOUSTICS::JGeometry::JString Struct Reference

String geometry. More...

#include <JGeometry.hh>

Inheritance diagram for JACOUSTICS::JGeometry::JString:
JGEOMETRY3D::JPosition3D JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t > JGEOMETRY3D::JVector3D JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t >, JHashMapEvaluator< JEvaluator_t > > JTOOLS::JMappableCollection< JKey_t, JValue_t > JMATH::JMath< JVector3D > std::vector< std::pair< JKey_t, JValue_t > >

Public Types

typedef JKey_t key_type
 
typedef JValue_t mapped_type
 
typedef std::pair< JKey_t,
JValue_t > 
value_type
 
typedef JHashMapEvaluator
< JEvaluator_t > 
evaluator_type
 
typedef JHashCollection
< value_type, evaluator_type
collection_type
 
typedef
collection_type::container_type 
container_type
 
typedef
container_type::const_iterator 
const_iterator
 
typedef
container_type::const_reverse_iterator 
const_reverse_iterator
 
typedef container_type::iterator iterator
 
typedef
container_type::reverse_iterator 
reverse_iterator
 

Public Member Functions

 JString ()
 Default constructor. More...
 
 JString (const JVector3D &position)
 Constructor. More...
 
template<class T >
 JString (const JVector3D &position, T __begin, T __end)
 Constructor. More...
 
JPosition3D getPosition (const JModel::JString &parameters, const double height) const
 Get position at given height according to actual string parameters. More...
 
JPosition3D getPosition (const JModel::JString &parameters, const int floor) const
 Get position of given floor according to actual string parameters. More...
 
JPosition3D getPosition (const double height) const
 Get position at given height according to default string parameters. More...
 
JPosition3D getPosition (const int floor) const
 Get position of given floor according to default string parameters. More...
 
double getDistance (const JModel::JString &parameters, const JVector3D &position, const int floor) const
 Get distance between given position and floor according to actual string parameters. More...
 
JModel::JString getGradient (const JModel::JString &parameters, const JVector3D &position, const int floor) const
 Get model gradient of distance between given position and floor according to actual string parameters. More...
 
const JPosition3DgetPosition () const
 Get position. More...
 
JPosition3DgetPosition ()
 Get position. More...
 
void setPosition (const JVector3D &pos)
 Set position. More...
 
 operator JAngle3D () const
 Type conversion operator. More...
 
 operator JVersor3D () const
 Type conversion operator. More...
 
JPosition3Drotate (const JRotation3D &R)
 Rotate. More...
 
JPosition3Drotate (const JRotation3X &R)
 Rotate around X-axis. More...
 
JPosition3Drotate (const JRotation3Y &R)
 Rotate around Y-axis. More...
 
JPosition3Drotate (const JRotation3Z &R)
 Rotate around Z-axis. More...
 
JPosition3Drotate (const JQuaternion3D &Q)
 Rotate. More...
 
JPosition3Drotate_back (const JRotation3D &R)
 Rotate back. More...
 
JPosition3Drotate_back (const JRotation3X &R)
 Rotate back around X-axis. More...
 
JPosition3Drotate_back (const JRotation3Y &R)
 Rotate back around Y-axis. More...
 
JPosition3Drotate_back (const JRotation3Z &R)
 Rotate back around Z-axis. More...
 
JPosition3Drotate_back (const JQuaternion3D &Q)
 Rotate back. More...
 
void transform (const JRotation3D &R, const JVector3D &pos)
 Transform position. More...
 
JVector3Dtransform (const JMatrix3D &T)
 Transform. More...
 
void transform_back (const JRotation3D &R, const JVector3D &pos)
 Transform back position. More...
 
double getDot (const JAngle3D &angle) const
 Get dot product. More...
 
double getDot (const JVersor3D &dir) const
 Get dot product. More...
 
double getDot (const JVersor3Z &dir) const
 Get dot product. More...
 
double getDot (const JVector3D &vector) const
 Get dot product. More...
 
 operator JVector2D () const
 Type conversion operator. More...
 
double getX () const
 Get x position. More...
 
double getY () const
 Get y position. More...
 
double getZ () const
 Get z position. More...
 
JVector3Dnegate ()
 Negate vector. More...
 
JVector3Dadd (const JVector3D &vector)
 Add vector. More...
 
JVector3Dsub (const JVector3D &vector)
 Subtract vector. More...
 
JVector3Dmul (const double factor)
 Scale vector. More...
 
JVector3Dmul (const JNullType &object)
 Multiply with object. More...
 
JVector3Ddiv (const double factor)
 Scale vector. More...
 
bool equals (const JVector3D &vector, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
double getLengthSquared () const
 Get length squared. More...
 
double getLength () const
 Get length. More...
 
double getDistanceSquared (const JVector3D &pos) const
 Get squared of distance to point. More...
 
double getDistance (const JVector3D &pos) const
 Get distance to point. More...
 
JVector3Dcross (const JVector3D &first, const JVector3D &second)
 Get cross product. More...
 
virtual void clear ()
 Clear. More...
 
virtual mapped_typeget (typename JClass< key_type >::argument_type key)
 Get mapped value. More...
 
virtual const mapped_typeget (typename JClass< key_type >::argument_type key) const
 Get mapped value. More...
 
value_typeget (const T &value)
 Get element with given value. More...
 
const value_typeget (const T &value) const
 Get element with given value. More...
 
const_iterator find (const T &value) const
 Find element with given value. More...
 
iterator find (const T &value)
 Find element with given value. More...
 
virtual bool insert (const value_type &element)
 Insert element. More...
 
void erase (iterator pos)
 Erase element at given position. More...
 
void erase (iterator __begin, iterator __end)
 Erase elements in given range. More...
 
bool erase (const T &value)
 Erase element with given value. More...
 
bool has (const T &value) const
 Test whether given value is present. More...
 
int getIndex (const T &value) const
 Get index of given value. More...
 
const mapped_typeoperator[] (typename JClass< key_type >::argument_type key) const
 Get mapped value. More...
 
mapped_typeoperator[] (typename JClass< key_type >::argument_type key)
 Get mapped value. More...
 
void put (typename JClass< key_type >::argument_type key, typename JClass< mapped_type >::argument_type value)
 Put pair-wise element (key,value) into collection. More...
 

Public Attributes

JPosition3D hydrophone
 Hydrophone. More...
 
JHashMapEvaluator< JEvaluator_t > getValue
 Function object for evaluation of element. More...
 

Protected Attributes

double __x
 
double __y
 
double __z
 
JRouter< int > router
 

Friends

std::ostream & operator<< (std::ostream &out, const JString &string)
 Write string parameters to output stream. More...
 

Detailed Description

String geometry.

A piezo sensor is mounted in each optical module.
The position of the piezo is determined from the actual string parameters and the floor number of the optical module.
A hydrophone is mounted on the anchor which corresponds to floor zero.
It has a fixed position which is relative to the reference position of the string.

Definition at line 102 of file JGeometry.hh.

Member Typedef Documentation

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JKey_t JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::key_type
inherited

Definition at line 77 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JValue_t JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::mapped_type
inherited

Definition at line 78 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef std::pair<JKey_t, JValue_t> JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::value_type
inherited

Definition at line 79 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JHashMapEvaluator<JEvaluator_t> JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::evaluator_type
inherited

Definition at line 80 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JHashCollection<value_type, evaluator_type> JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::collection_type
inherited

Definition at line 82 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef collection_type::container_type JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::container_type
inherited

Definition at line 83 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::const_iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::const_iterator
inherited

Definition at line 85 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::const_reverse_iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::const_reverse_iterator
inherited

Definition at line 86 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::iterator
inherited

Definition at line 87 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::reverse_iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::reverse_iterator
inherited

Definition at line 88 of file JHashMap.hh.

Constructor & Destructor Documentation

JACOUSTICS::JGeometry::JString::JString ( )
inline

Default constructor.

Definition at line 112 of file JGeometry.hh.

113  {}
JACOUSTICS::JGeometry::JString::JString ( const JVector3D position)
inline

Constructor.

The given position corresponds to the reference point of the string from which the positions of the piezo sensors and hydrophone are calculated.

Parameters
positionposition

Definition at line 124 of file JGeometry.hh.

124  :
125  JPosition3D(position)
126  {}
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:47
template<class T >
JACOUSTICS::JGeometry::JString::JString ( const JVector3D position,
T  __begin,
T  __end 
)
inline

Constructor.

The template parameter should correspond to a data type which implements the following policy methods.

    int          getFloor();
    JPosition3D  getPosition();

The given position corresponds to the reference point of the string from which the positions of the piezo sensors and hydrophone are calculated.

Note that the position of the piezo is offset by JACOUSTICS::getPiezoPosition and that the position of the hydrophone should manually be set.

Parameters
positionposition
__beginbegin of optical modules
__endend of optical modules

Definition at line 149 of file JGeometry.hh.

151  :
152  JPosition3D(position)
153  {
154  for (T i = __begin; i != __end; ++i) {
155  (*this)[i->getFloor()] = this->getDistance(i->getPosition() + getPiezoPosition());
156  }
157  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:47
double getDistance(const JModel::JString &parameters, const JVector3D &position, const int floor) const
Get distance between given position and floor according to actual string parameters.
Definition: JGeometry.hh:231
JPosition3D getPiezoPosition()
Get relative position of piezo in optical module.

Member Function Documentation

JPosition3D JACOUSTICS::JGeometry::JString::getPosition ( const JModel::JString parameters,
const double  height 
) const
inline

Get position at given height according to actual string parameters.

Parameters
parametersparameters
heightheight
Returns
position

Definition at line 167 of file JGeometry.hh.

169  {
170  const double tx = parameters.tx;
171  const double ty = parameters.ty;
172  const double tz = sqrt(1.0 - tx*tx - ty*ty);
173 
174  return JPosition3D(this->getX() + tx * height,
175  this->getY() + ty * height,
176  this->getZ() + tz * height);
177  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:47
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JPosition3D JACOUSTICS::JGeometry::JString::getPosition ( const JModel::JString parameters,
const int  floor 
) const
inline

Get position of given floor according to actual string parameters.

Parameters
parametersparameters
floorfloor
Returns
position

Definition at line 187 of file JGeometry.hh.

189  {
190  if (floor == 0)
191  return getPosition() + hydrophone.getPosition();
192  else if (this->has(floor))
193  return getPosition(parameters, this->get(floor).getHeight());
194  else
195  THROW(JValueOutOfRange, "Invalid floor " << floor);
196  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JPosition3D hydrophone
Hydrophone.
Definition: JGeometry.hh:304
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
bool has(const T &value) const
Test whether given value is present.
JPosition3D JACOUSTICS::JGeometry::JString::getPosition ( const double  height) const
inline

Get position at given height according to default string parameters.

Parameters
heightheight
Returns
position

Definition at line 205 of file JGeometry.hh.

206  {
207  return getPosition(JModel::JString(), height);
208  }
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JPosition3D JACOUSTICS::JGeometry::JString::getPosition ( const int  floor) const
inline

Get position of given floor according to default string parameters.

Parameters
floorfloor
Returns
position

Definition at line 217 of file JGeometry.hh.

218  {
219  return getPosition(JModel::JString(), floor);
220  }
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
double JACOUSTICS::JGeometry::JString::getDistance ( const JModel::JString parameters,
const JVector3D position,
const int  floor 
) const
inline

Get distance between given position and floor according to actual string parameters.

Parameters
parametersparameters
positionposition
floorfloor
Returns
distance

Definition at line 231 of file JGeometry.hh.

234  {
235  return this->getPosition(parameters, floor).getDistance(position);
236  }
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:269
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JModel::JString JACOUSTICS::JGeometry::JString::getGradient ( const JModel::JString parameters,
const JVector3D position,
const int  floor 
) const
inline

Get model gradient of distance between given position and floor according to actual string parameters.

Parameters
parametersparameters
positionposition
floorfloor
Returns
gradient

Definition at line 247 of file JGeometry.hh.

250  {
251  if (floor == 0) {
252 
253  return JModel::JString();
254 
255  } else if (this->has(floor)) {
256 
257  const double height = this->get(floor).getHeight();
258  const JPosition3D pos = this->getPosition(parameters, height);
259 
260  const double tx = parameters.tx;
261  const double ty = parameters.ty;
262  const double tz = sqrt(1.0 - tx*tx - ty*ty);
263 
264  const double dx = pos.getX() - position.getX();
265  const double dy = pos.getY() - position.getY();
266  const double dz = pos.getZ() - position.getZ();
267 
268  const double D = sqrt(dx*dx + dy*dy + dz*dz);
269 
270  return JModel::JString(height * dx / D - (tx / tz) * dz / D,
271  height * dy / D - (ty / tz) * dz / D);
272 
273  } else {
274 
275  THROW(JValueOutOfRange, "Invalid floor " << floor);
276  }
277  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:47
bool has(const T &value) const
Test whether given value is present.
const JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 129 of file JPosition3D.hh.

130  {
131  return static_cast<const JPosition3D&>(*this);
132  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( )
inlineinherited

Get position.

Returns
position

Definition at line 140 of file JPosition3D.hh.

141  {
142  return static_cast<JPosition3D&>(*this);
143  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
void JGEOMETRY3D::JPosition3D::setPosition ( const JVector3D pos)
inlineinherited

Set position.

Parameters
posposition

Definition at line 151 of file JPosition3D.hh.

152  {
153  static_cast<JVector3D&>(*this) = pos;
154  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
JGEOMETRY3D::JPosition3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 162 of file JPosition3D.hh.

163  {
164  return JAngle3D(getX(), getY(), getZ());
165  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:31
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JGEOMETRY3D::JPosition3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 173 of file JPosition3D.hh.

174  {
175  return JVersor3D(getX(), getY(), getZ());
176  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:23
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3D R)
inlineinherited

Rotate.

Parameters
Rrotation matrix
Returns
this position

Definition at line 185 of file JPosition3D.hh.

186  {
187  R.rotate(__x, __y, __z);
188 
189  return *this;
190  }
void rotate(double &__x, double &__y, double &__z) const
Rotate.
Definition: JRotation3D.hh:336
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3X R)
inlineinherited

Rotate around X-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 213 of file JPosition3D.hh.

214  {
215  R.rotate(__y, __z);
216 
217  return *this;
218  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3Y R)
inlineinherited

Rotate around Y-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 241 of file JPosition3D.hh.

242  {
243  R.rotate(__x, __z);
244 
245  return *this;
246  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3Z R)
inlineinherited

Rotate around Z-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 269 of file JPosition3D.hh.

270  {
271  R.rotate(__x, __y);
272 
273  return *this;
274  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JQuaternion3D Q)
inlineinherited

Rotate.

Parameters
Qquaternion
Returns
this position

Definition at line 297 of file JPosition3D.hh.

298  {
299  Q.rotate(__x, __y, __z);
300 
301  return *this;
302  }
void rotate(double &__x, double &__y, double &__z) const
Rotate.
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3D R)
inlineinherited

Rotate back.

Parameters
Rrotation matrix
Returns
this position

Definition at line 199 of file JPosition3D.hh.

200  {
201  R.rotate_back(__x, __y, __z);
202 
203  return *this;
204  }
void rotate_back(double &__x, double &__y, double &__z) const
Rotate back.
Definition: JRotation3D.hh:355
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3X R)
inlineinherited

Rotate back around X-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 227 of file JPosition3D.hh.

228  {
229  R.rotate_back(__y, __z);
230 
231  return *this;
232  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3Y R)
inlineinherited

Rotate back around Y-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 255 of file JPosition3D.hh.

256  {
257  R.rotate_back(__x, __z);
258 
259  return *this;
260  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3Z R)
inlineinherited

Rotate back around Z-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 283 of file JPosition3D.hh.

284  {
285  R.rotate_back(__x, __y);
286 
287  return *this;
288  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JQuaternion3D Q)
inlineinherited

Rotate back.

Parameters
Qquaternion
Returns
this position

Definition at line 311 of file JPosition3D.hh.

312  {
313  Q.rotate_back(__x, __y, __z);
314 
315  return *this;
316  }
void rotate_back(double &__x, double &__y, double &__z) const
Rotate back.
void JGEOMETRY3D::JPosition3D::transform ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform position.

The final position is obtained as follows:

  1. rotation of the position according matrix R;
  2. offset position with pos;
  3. rotation of position around z-axis, such that final position lies in x-z plane;
Parameters
Rrotation matrix
posposition of origin (after rotation)

Definition at line 330 of file JPosition3D.hh.

332  {
333  // rotate geometry to system with particle direction along z-axis
334 
335  rotate(R);
336 
337  // offset with respect to origin
338 
339  sub(pos);
340 
341  // rotate geometry to x-z plane
342 
343  __x = sqrt(__x*__x + __y*__y);
344  __y = 0.0;
345  }
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Definition: JVector3D.hh:157
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
JVector3D& JGEOMETRY3D::JVector3D::transform ( const JMatrix3D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 205 of file JVector3D.hh.

206  {
207  T.transform(__x, __y, __z);
208 
209  return *this;
210  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
void JGEOMETRY3D::JPosition3D::transform_back ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform back position.

The final position is obtained as follows:

  1. offset position with position pos;
  2. rotation of postion according matrix R;
Parameters
Rrotation matrix
posposition of origin (before rotation)

Definition at line 358 of file JPosition3D.hh.

360  {
361  // offset with respect to origin
362 
363  add(pos);
364 
365  // rotate back geometry to system with particle direction along z-axis
366 
367  rotate_back(R);
368  }
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:199
JVector3D & add(const JVector3D &vector)
Add vector.
Definition: JVector3D.hh:141
double JGEOMETRY3D::JPosition3D::getDot ( const JAngle3D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 377 of file JPosition3D.hh.

378  {
379  return
380  getX() * angle.getDX() +
381  getY() * angle.getDY() +
382  getZ() * angle.getDZ();
383  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double getDX() const
Get x direction.
Definition: JAngle3D.hh:106
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:128
double getDY() const
Get y direction.
Definition: JAngle3D.hh:117
double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3D dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 392 of file JPosition3D.hh.

393  {
394  return
395  getX() * dir.getDX() +
396  getY() * dir.getDY() +
397  getZ() * dir.getDZ();
398  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3Z dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 407 of file JPosition3D.hh.

408  {
409  return
410  getX() * dir.getDX() +
411  getY() * dir.getDY() +
412  getZ() * dir.getDZ();
413  }
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:156
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:145
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:167
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double JGEOMETRY3D::JVector3D::getDot ( const JVector3D vector) const
inlineinherited

Get dot product.

Parameters
vectorvector
Returns
dot product

Definition at line 281 of file JVector3D.hh.

282  {
283  return
284  getX() * vector.getX() +
285  getY() * vector.getY() +
286  getZ() * vector.getZ();
287  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JGEOMETRY3D::JVector3D::operator JVector2D ( ) const
inlineinherited

Type conversion operator.

Returns
JVector2D

Definition at line 82 of file JVector3D.hh.

83  {
84  return JVector2D(this->getX(), this->getY());
85  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double JGEOMETRY3D::JVector3D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 93 of file JVector3D.hh.

94  {
95  return __x;
96  }
double JGEOMETRY3D::JVector3D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 103 of file JVector3D.hh.

104  {
105  return __y;
106  }
double JGEOMETRY3D::JVector3D::getZ ( ) const
inlineinherited

Get z position.

Returns
z position

Definition at line 114 of file JVector3D.hh.

115  {
116  return __z;
117  }
JVector3D& JGEOMETRY3D::JVector3D::negate ( )
inlineinherited

Negate vector.

Returns
this vector

Definition at line 125 of file JVector3D.hh.

126  {
127  __x = -__x;
128  __y = -__y;
129  __z = -__z;
130 
131  return *this;
132  }
JVector3D& JGEOMETRY3D::JVector3D::add ( const JVector3D vector)
inlineinherited

Add vector.

Parameters
vectorvector
Returns
this vector

Definition at line 141 of file JVector3D.hh.

142  {
143  __x += vector.getX();
144  __y += vector.getY();
145  __z += vector.getZ();
146 
147  return *this;
148  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JVector3D& JGEOMETRY3D::JVector3D::sub ( const JVector3D vector)
inlineinherited

Subtract vector.

Parameters
vectorvector
Returns
this vector

Definition at line 157 of file JVector3D.hh.

158  {
159  __x -= vector.getX();
160  __y -= vector.getY();
161  __z -= vector.getZ();
162 
163  return *this;
164  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JVector3D& JGEOMETRY3D::JVector3D::mul ( const double  factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 173 of file JVector3D.hh.

174  {
175  __x *= factor;
176  __y *= factor;
177  __z *= factor;
178 
179  return *this;
180  }
JVector3D & JMATH::JMath< JVector3D , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JVector3D& JGEOMETRY3D::JVector3D::div ( const double  factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 189 of file JVector3D.hh.

190  {
191  __x /= factor;
192  __y /= factor;
193  __z /= factor;
194 
195  return *this;
196  }
bool JGEOMETRY3D::JVector3D::equals ( const JVector3D vector,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
vectorvector
precisionprecision
Returns
true if vectors are equal; else false

Definition at line 220 of file JVector3D.hh.

222  {
223  return (fabs(getX() - vector.getX()) <= precision &&
224  fabs(getY() - vector.getY()) <= precision &&
225  fabs(getZ() - vector.getZ()) <= precision);
226  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double JGEOMETRY3D::JVector3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 234 of file JVector3D.hh.

235  {
236  return getX()*getX() + getY()*getY() + getZ()*getZ();
237  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double JGEOMETRY3D::JVector3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 245 of file JVector3D.hh.

246  {
247  return sqrt(getLengthSquared());
248  }
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:234
double JGEOMETRY3D::JVector3D::getDistanceSquared ( const JVector3D pos) const
inlineinherited

Get squared of distance to point.

Parameters
posposition
Returns
square of distance

Definition at line 257 of file JVector3D.hh.

258  {
259  return JVector3D(pos).sub(*this).getLengthSquared();
260  }
JVector3D()
Default constructor.
Definition: JVector3D.hh:40
double JGEOMETRY3D::JVector3D::getDistance ( const JVector3D pos) const
inlineinherited

Get distance to point.

Parameters
posposition
Returns
distance

Definition at line 269 of file JVector3D.hh.

270  {
271  return sqrt(getDistanceSquared(pos));
272  }
double getDistanceSquared(const JVector3D &pos) const
Get squared of distance to point.
Definition: JVector3D.hh:257
JVector3D& JGEOMETRY3D::JVector3D::cross ( const JVector3D first,
const JVector3D second 
)
inlineinherited

Get cross product.

Note that this vector should not overlap with the first or second vector,

Parameters
firstfirst vector
secondsecond vector
Returns
this vector

Definition at line 298 of file JVector3D.hh.

300  {
301  __x = first .getY() * second.getZ() - second.getY() * first .getZ();
302  __y = second.getX() * first .getZ() - first .getX() * second.getZ();
303  __z = first .getX() * second.getY() - second.getX() * first .getY();
304 
305  return *this;
306  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
virtual void JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::clear ( )
inlinevirtualinherited

Clear.

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 106 of file JHashMap.hh.

107  {
109  }
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
virtual mapped_type& JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::get ( typename JClass< key_type >::argument_type  key)
inlinevirtualinherited

Get mapped value.

Parameters
keykey
Returns
mapped value

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 118 of file JHashMap.hh.

119  {
120  const int ival = this->getValue(key);
121 
122  if (!this->router.has(ival)) {
124  }
125 
126  return container_type::operator[](this->router.get(ival)).second;
127  }
JValue_t mapped_type
Definition: JHashMap.hh:78
virtual bool insert(const value_type &element)
Insert element.
std::pair< JKey_t, JValue_t > value_type
Definition: JHashMap.hh:79
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
virtual const mapped_type& JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::get ( typename JClass< key_type >::argument_type  key) const
inlinevirtualinherited

Get mapped value.

This method will throw an exception if given key is not present following the prerequisite of constness.

Parameters
keykey
Returns
mapped value

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 138 of file JHashMap.hh.

139  {
140  const int ival = this->getValue(key);
141 
142  if (this->router.has(ival))
143  return container_type::operator[](this->router.get(ival)).second;
144  else
145  THROW(JIndexOutOfRange, "JHasMap::get(): invalid key.");
146  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
value_type& JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::get ( const T value)
inlineinherited

Get element with given value.

This method will throw an exception if given value is not present following the prerequisite of constness.

Parameters
valuevalue
Returns
element

Definition at line 140 of file JHashCollection.hh.

141  {
142  const int ival = this->getValue(value);
143 
144  if (!router.has(ival)) {
145  this->insert(value);
146  }
147 
148  return container_type::operator[](router.get(ival)).second;
149  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
const value_type& JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::get ( const T value) const
inlineinherited

Get element with given value.

This method will throw an exception if given value is not present following the prerequisite of constness.

Parameters
valuevalue
Returns
element

Definition at line 161 of file JHashCollection.hh.

162  {
163  const int ival = this->getValue(value);
164 
165  if (router.has(ival)) {
166  return container_type::operator[](router.get(ival)).second;
167  }
168 
169  THROW(JIndexOutOfRange, "JHasCollection::get(): invalid value.");
170  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
const_iterator JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::find ( const T value) const
inlineinherited

Find element with given value.

Parameters
valuevalue
Returns
position of element with given value or end()

Definition at line 102 of file JHashCollection.hh.

103  {
104  const int ival = this->getValue(value);
105 
106  if (router.has(ival))
107  return this->begin() + router.get(ival);
108  else
109  return this->end();
110  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
iterator JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::find ( const T value)
inlineinherited

Find element with given value.

Parameters
valuevalue
Returns
position of element with given value or end()

Definition at line 120 of file JHashCollection.hh.

121  {
122  const int ival = this->getValue(value);
123 
124  if (router.has(ival))
125  return this->begin() + router.get(ival);
126  else
127  return this->end();
128  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
virtual bool JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::insert ( const value_type element)
inlinevirtualinherited

Insert element.

Parameters
elementelement
Returns
true if inserted; else false

Definition at line 179 of file JHashCollection.hh.

180  {
181  const int ival = this->getValue(element);
182 
183  if (!router.has(ival)) {
184 
185  container_type::push_back(element);
186 
187  router.put(ival, this->size() - 1);
188 
189  return true;
190  }
191 
192  return false;
193  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
void JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::erase ( iterator  pos)
inlineinherited

Erase element at given position.

Parameters
posvalid position

Definition at line 201 of file JHashCollection.hh.

202  {
203  router.put(this->getValue(*pos), router.getDefaultAddress());
204 
205  for (iterator i = container_type::erase(pos); i != this->end(); ++i) {
206  router.put(this->getValue(*i), distance(this->begin(), i));
207  }
208  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
void JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::erase ( iterator  __begin,
iterator  __end 
)
inlineinherited

Erase elements in given range.

Parameters
__beginbegin position (included)
__endend position (excluded)

Definition at line 217 of file JHashCollection.hh.

218  {
219  for (iterator i = __begin; i != __end; ++i) {
220  router.put(this->getValue(*i), router.getDefaultAddress());
221  }
222 
223  for (iterator i = container_type::erase(__begin, __end); i != this->end(); ++i) {
224  router.put(this->getValue(*i), distance(this->begin(), i));
225  }
226  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
bool JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::erase ( const T value)
inlineinherited

Erase element with given value.

Parameters
valuevalue
Returns
true if element has been erased; else false

Definition at line 236 of file JHashCollection.hh.

237  {
238  const int ival = this->getValue(value);
239 
240  if (router.has(ival)) {
241 
242  this->erase(this->begin() + router.get(ival));
243 
244  return true;
245  }
246 
247  return false;
248  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
bool JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::has ( const T value) const
inlineinherited

Test whether given value is present.

Parameters
valuevalue
Returns
true if present; else false

Definition at line 258 of file JHashCollection.hh.

259  {
260  return router.has(this->getValue(value));
261  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
int JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::getIndex ( const T value) const
inlineinherited

Get index of given value.

Parameters
valuevalue
Returns
indecx

Definition at line 271 of file JHashCollection.hh.

272  {
273  return router.get(this->getValue(value));
274  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
template<class JKey_t, class JValue_t>
const mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type  key) const
inlineinherited

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 73 of file JMappableCollection.hh.

74  {
75  return get(key);
76  }
template<class JKey_t, class JValue_t>
mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type  key)
inlineinherited

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 85 of file JMappableCollection.hh.

86  {
87  return get(key);
88  }
template<class JKey_t, class JValue_t>
void JTOOLS::JMappableCollection< JKey_t, JValue_t >::put ( typename JClass< key_type >::argument_type  key,
typename JClass< mapped_type >::argument_type  value 
)
inlineinherited

Put pair-wise element (key,value) into collection.

Parameters
keykey
valuevalue

Definition at line 97 of file JMappableCollection.hh.

99  {
100  get(key) = value;
101  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JString string 
)
friend

Write string parameters to output stream.

Parameters
outoutput stream
stringstring
Returns
output stream

Definition at line 287 of file JGeometry.hh.

288  {
289  using namespace std;
290 
291  for (JString::const_iterator i = string.begin(); i != string.end(); ++i) {
292  out << setw(2) << i->first << ' ' << i->second << " | " << string.getPosition(i->first) << endl;
293  }
294 
295  return out;
296  }
container_type::const_iterator const_iterator
Definition: JHashMap.hh:85

Member Data Documentation

JPosition3D JACOUSTICS::JGeometry::JString::hydrophone

Hydrophone.

The position of the hydrophone is relative to the reference position of the string.

Definition at line 304 of file JGeometry.hh.

double JGEOMETRY3D::JVector3D::__x
protectedinherited

Definition at line 309 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__y
protectedinherited

Definition at line 310 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__z
protectedinherited

Definition at line 311 of file JVector3D.hh.

JHashMapEvaluator< JEvaluator_t > JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::getValue
inherited

Function object for evaluation of element.

Definition at line 280 of file JHashCollection.hh.

JRouter<int> JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::router
protectedinherited

Definition at line 284 of file JHashCollection.hh.


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