Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxVec3Double Class Reference

Class definition vector of 3 doubles. More...

#include <HxVec3Double.h>

List of all members.

Constructors

 HxVec3Double ()
 Default constructor. More...

 HxVec3Double (double x, double y, double z)
 Conversion from native type. More...

 HxVec3Double (const HxVec3Double &v)
 Copy constructor. More...


Inquiry

int dim () const
 Dimensionality. More...

double x () const
 Value of first element. More...

double y () const
 Value of second element. More...

double z () const
 Value of third element. More...

double getValue (int dimension) const
 Element in given dimension. More...

void setValue (int dimension, double value)

Conversion

 operator HxScalarInt () const
 Cast to HxScalarInt. More...

 operator HxScalarDouble () const
 Cast to HxScalarDouble. More...

 operator HxVec2Int () const
 Cast to HxVec2Int. More...

 operator HxVec2Double () const
 Cast to HxVec2Double. More...

 operator HxVec3Int () const
 Cast to HxVec3Int. More...

 operator HxComplex () const
 Cast to HxComplex. More...


Operators

Mathematical definition: Binary operations on pixel values

int operator== (const HxVec3Double &v) const
 Equal. More...

int operator!= (const HxVec3Double &v) const
 Not equal. More...

int operator< (const HxVec3Double &v) const
 Less than. More...

int operator<= (const HxVec3Double &v) const
 Less equal. More...

int operator> (const HxVec3Double &v) const
 Greater than. More...

int operator>= (const HxVec3Double &v) const
 Greater equal. More...

const HxVec3Double SMALL_VAL = HxVec3Double(0, 0, 0)
 A small value w.r.t to the comparison operators "<" and ">". More...

const HxVec3Double LARGE_VAL = HxVec3Double(1e300, 1e300, 1e300)
 A large value w.r.t to the comparison operators "<" and ">". More...


Unary operations

Mathematical definition: Unary operations on pixel values

HxVec3Double operator- () const
 Negation. More...

HxVec3Double complement () const
 Complement. More...

HxVec3Double abs () const
 Absolute value. More...

HxVec3Double ceil () const
 Ceiling. More...

HxVec3Double floor () const
 Floor. More...

HxVec3Double round () const
 Round. More...

HxScalarDouble sum () const
 Sum. More...

HxScalarDouble product () const
 Product. More...

HxScalarDouble min () const
 Minimum. More...

HxScalarDouble max () const
 Maximum. More...

HxScalarDouble norm1 () const
 L1 norm. More...

HxScalarDouble norm2 () const
 L2 norm. More...

HxScalarDouble normInf () const
 L infinity norm. More...

HxVec3Double sqrt () const
 Square root. More...

HxVec3Double sin () const
 Sine. More...

HxVec3Double cos () const
 Cosine. More...

HxVec3Double tan () const
 Tangent. More...

HxVec3Double asin () const
 Arc sine. More...

HxVec3Double acos () const
 Arc cosine. More...

HxVec3Double atan () const
 Arc tangent. More...

HxScalarDouble atan2 () const
 Arc tangent. More...

HxVec3Double sinh () const
 Hyperbolic sine. More...

HxVec3Double cosh () const
 Hyperbolic cosine. More...

HxVec3Double tanh () const
 Hyperbolic tangent. More...

HxVec3Double exp () const
 Exponent. More...

HxVec3Double log () const
 Natural logarithm. More...

HxVec3Double log10 () const
 Base 10 logarithm. More...


Binary operations

Mathematical definition: Binary operations on pixel values

HxVec3Double & operator+= (const HxVec3Double &v)
 Addition and assignment. More...

HxVec3Double & operator-= (const HxVec3Double &v)
 Subtraction and assignment. More...

HxVec3Double & operator *= (const HxVec3Double &v)
 Multiplication and assignment. More...

HxVec3Double & operator/= (const HxVec3Double &v)
 Division and assignment. More...

HxVec3Double min (const HxVec3Double &v) const
 Minimum. More...

HxVec3Double & minAssign (const HxVec3Double &v)
 Minimum and assignment. More...

HxVec3Double max (const HxVec3Double &v) const
 Maximum. More...

HxVec3Double & maxAssign (const HxVec3Double &v)
 Maximum and assignment. More...

HxVec3Double inf (const HxVec3Double &v) const
 Infimum. More...

HxVec3Double & infAssign (const HxVec3Double &v)
 Infimum and assignment. More...

HxVec3Double sup (const HxVec3Double &v) const
 Supremum. More...

HxVec3Double & supAssign (const HxVec3Double &v)
 Supremum and assignment. More...

HxVec3Double pow (const HxVec3Double &v) const
 Power. More...

HxVec3Double mod (const HxVec3Double &v) const
 Modulo. More...

HxVec3Double and (const HxVec3Double &v) const
 And. More...

HxVec3Double or (const HxVec3Double &v) const
 Or. More...

HxVec3Double xor (const HxVec3Double &v) const
 Xor. More...

HxVec3Double leftShift (const HxVec3Double &v) const
 Left shift. More...

HxVec3Double rightShift (const HxVec3Double &v) const
 Right shift. More...

HxScalarDouble dot (const HxVec3Double &v) const
 Dot product. More...

HxVec3Double cross (const HxVec3Double &v) const
 Cross product. More...

HxVec3Double operator+ (const HxVec3Double &v1, const HxVec3Double &v2)
 Addition. More...

HxVec3Double operator- (const HxVec3Double &v1, const HxVec3Double &v2)
 Subtraction. More...

HxVec3Double operator * (const HxVec3Double &v1, const HxVec3Double &v2)
 Multiplication. More...

HxVec3Double operator/ (const HxVec3Double &v1, const HxVec3Double &v2)
 Division. More...


Output

STD_OSTREAM & put (STD_OSTREAM &os) const
 Print value on stream. More...

HxString toString () const
 Value as a string. More...


Public Methods

void * operator new (size_t, void *=0)


Detailed Description

Class definition vector of 3 doubles.


Constructor & Destructor Documentation

HxVec3Double::HxVec3Double   [inline]
 

Default constructor.

00323 { 
00324 }

HxVec3Double::HxVec3Double double    x,
double    y,
double    z
[inline]
 

Conversion from native type.

00328 {
00329     _values[0] = x;
00330     _values[1] = y;
00331     _values[2] = z;
00332 }

HxVec3Double::HxVec3Double const HxVec3Double &    v [inline]
 

Copy constructor.

00336 {
00337     _values[0] = v._values[0];
00338     _values[1] = v._values[1];
00339     _values[2] = v._values[2];
00340 }


Member Function Documentation

int HxVec3Double::dim   const [inline]
 

Dimensionality.

00350 {
00351     return 3;
00352 }

double HxVec3Double::x   const [inline]
 

Value of first element.

00356 {
00357     return _values[0];
00358 }

double HxVec3Double::y   const [inline]
 

Value of second element.

00362 {
00363     return _values[1];
00364 }

double HxVec3Double::z   const [inline]
 

Value of third element.

00368 {
00369     return _values[2];
00370 }

double HxVec3Double::getValue int    dimension const [inline]
 

Element in given dimension.

00374 {
00375     return _values[dimension - 1];
00376 }

HxVec3Double::operator HxScalarInt   const
 

Cast to HxScalarInt.

00028 {
00029     return (int) _values[0];
00030 }

HxVec3Double::operator HxScalarDouble   const
 

Cast to HxScalarDouble.

00033 {
00034     return _values[0];
00035 }

HxVec3Double::operator HxVec2Int   const
 

Cast to HxVec2Int.

00038 {
00039     return HxVec2Int(int(_values[0]), int(_values[1]));
00040 }

HxVec3Double::operator HxVec2Double   const
 

Cast to HxVec2Double.

00043 {
00044     return HxVec2Double(_values[0], _values[1]);
00045 }

HxVec3Double::operator HxVec3Int   const
 

Cast to HxVec3Int.

00048 {
00049     return HxVec3Int(int(_values[0]), int(_values[1]), int(_values[2]));
00050 }

HxVec3Double::operator HxComplex   const
 

Cast to HxComplex.

00053 {
00054     return HxComplex(_values[0], _values[1]);
00055 }

int HxVec3Double::operator== const HxVec3Double &    v const [inline]
 

Equal.

00386 {
00387     return (_values[0] == v._values[0]) && (_values[1] == v._values[1]) &&
00388            (_values[2] == v._values[2]);
00389 }

int HxVec3Double::operator!= const HxVec3Double &    v const [inline]
 

Not equal.

00393 {
00394     return (_values[0] != v._values[0]) || (_values[1] != v._values[1]) ||
00395            (_values[2] != v._values[2]);
00396 }

int HxVec3Double::operator< const HxVec3Double &    v const [inline]
 

Less than.

00400 {
00401     return (fabs(_values[0]) + fabs(_values[1]) + fabs(_values[2])) < 
00402            (fabs(v._values[0]) + fabs(v._values[1]) + fabs(v._values[2]));
00403 }

int HxVec3Double::operator<= const HxVec3Double &    v const [inline]
 

Less equal.

00407 {
00408     return (fabs(_values[0]) + fabs(_values[1]) + fabs(_values[2])) <=
00409            (fabs(v._values[0]) + fabs(v._values[1]) + fabs(v._values[2]));
00410 }

int HxVec3Double::operator> const HxVec3Double &    v const [inline]
 

Greater than.

00414 {
00415     return (fabs(_values[0]) + fabs(_values[1]) + fabs(_values[2])) >
00416            (fabs(v._values[0]) + fabs(v._values[1]) + fabs(v._values[2]));
00417 }

int HxVec3Double::operator>= const HxVec3Double &    v const [inline]
 

Greater equal.

00421 {
00422     return (fabs(_values[0]) + fabs(_values[1]) + fabs(_values[2])) >=
00423            (fabs(v._values[0]) + fabs(v._values[1]) + fabs(v._values[2]));
00424 }

HxVec3Double HxVec3Double::operator-   const [inline]
 

Negation.

00428 {
00429     return HxVec3Double(-_values[0], -_values[1], -_values[2]);
00430 }

HxVec3Double HxVec3Double::complement   const [inline]
 

Complement.

00434 {
00435     return HxVec3Double(-_values[0], -_values[1], -_values[2]);
00436 }

HxVec3Double HxVec3Double::abs   const [inline]
 

Absolute value.

00440 {
00441     return HxVec3Double(fabs(_values[0]), fabs(_values[1]), fabs(_values[2]));
00442 }

HxVec3Double HxVec3Double::ceil   const [inline]
 

Ceiling.

00446 {
00447     return HxVec3Double(::ceil(_values[0]),
00448                         ::ceil(_values[1]),
00449                         ::ceil(_values[2]));
00450 }

HxVec3Double HxVec3Double::floor   const [inline]
 

Floor.

00454 {
00455     return HxVec3Double(::floor(_values[0]),
00456                         ::floor(_values[1]),
00457                         ::floor(_values[2]));
00458 }

HxVec3Double HxVec3Double::round   const [inline]
 

Round.

00462 {
00463     return HxVec3Double((int) (_values[0] + ((_values[0] >= 0) ? 0.5 : -0.5)),
00464                         (int) (_values[1] + ((_values[1] >= 0) ? 0.5 : -0.5)),
00465                         (int) (_values[2] + ((_values[2] >= 0) ? 0.5 : -0.5)));
00466 }

HxScalarDouble HxVec3Double::sum   const [inline]
 

Sum.

00470 {
00471     return _values[0] + _values[1] + _values[2];
00472 }

HxScalarDouble HxVec3Double::product   const [inline]
 

Product.

00476 {
00477     return _values[0] * _values[1] * _values[2];
00478 }

HxScalarDouble HxVec3Double::min   const
 

Minimum.

00059 {
00060     return (_values[0] < _values[1]) ?
00061         ((_values[0] < _values[2]) ? _values[0] : _values[2]) :
00062         ((_values[1] < _values[2]) ? _values[1] : _values[2]);
00063 }

HxScalarDouble HxVec3Double::max   const
 

Maximum.

00067 {
00068     return (_values[0] > _values[1]) ?
00069         ((_values[0] > _values[2]) ? _values[0] : _values[2]) :
00070         ((_values[1] > _values[2]) ? _values[1] : _values[2]);
00071 }

HxScalarDouble HxVec3Double::norm1   const
 

L1 norm.

00075 {
00076     return fabs(_values[0]) + fabs(_values[1]) + fabs(_values[2]);
00077 }

HxScalarDouble HxVec3Double::norm2   const
 

L2 norm.

00081 {
00082     return ::sqrt(_values[0]*_values[0] +
00083                   _values[1]*_values[1] +
00084                   _values[2]*_values[2]);
00085 }

HxScalarDouble HxVec3Double::normInf   const
 

L infinity norm.

00089 {
00090     return (fabs(_values[0]) > fabs(_values[1])) ?
00091         ((fabs(_values[0]) > fabs(_values[2])) ? fabs(_values[0]) :
00092                                                     fabs(_values[2])) :
00093         ((fabs(_values[1]) > fabs(_values[2])) ? fabs(_values[1]) :
00094                                                     fabs(_values[2]));
00095 }

HxVec3Double HxVec3Double::sqrt   const [inline]
 

Square root.

00482 {
00483     return HxVec3Double(::sqrt(_values[0]),
00484                         ::sqrt(_values[1]),
00485                         ::sqrt(_values[2]));
00486 }

HxVec3Double HxVec3Double::sin   const [inline]
 

Sine.

00490 {
00491     return HxVec3Double(::sin(_values[0]),
00492                         ::sin(_values[1]),
00493                         ::sin(_values[2]));
00494 }

HxVec3Double HxVec3Double::cos   const [inline]
 

Cosine.

00498 {
00499     return HxVec3Double(::cos(_values[0]),
00500                         ::cos(_values[1]),
00501                         ::cos(_values[2]));
00502 }

HxVec3Double HxVec3Double::tan   const [inline]
 

Tangent.

00506 {
00507     return HxVec3Double(::tan(_values[0]),
00508                         ::tan(_values[1]),
00509                         ::tan(_values[2]));
00510 }

HxVec3Double HxVec3Double::asin   const [inline]
 

Arc sine.

00514 {
00515     return HxVec3Double(::asin(_values[0]),
00516                         ::asin(_values[1]),
00517                         ::asin(_values[2]));
00518 }

HxVec3Double HxVec3Double::acos   const [inline]
 

Arc cosine.

00522 {
00523     return HxVec3Double(::acos(_values[0]),
00524                         ::acos(_values[1]),
00525                         ::acos(_values[2]));
00526 }

HxVec3Double HxVec3Double::atan   const [inline]
 

Arc tangent.

00530 {
00531     return HxVec3Double(::atan(_values[0]),
00532                         ::atan(_values[1]),
00533                         ::atan(_values[2]));
00534 }

HxScalarDouble HxVec3Double::atan2   const
 

Arc tangent.

00099 {
00100     return HxScalarDouble(::atan2(_values[0], _values[1]));
00101 }

HxVec3Double HxVec3Double::sinh   const [inline]
 

Hyperbolic sine.

00538 {
00539     return HxVec3Double(::sinh(_values[0]),
00540                         ::sinh(_values[1]),
00541                         ::sinh(_values[2]));
00542 }

HxVec3Double HxVec3Double::cosh   const [inline]
 

Hyperbolic cosine.

00546 {
00547     return HxVec3Double(::cosh(_values[0]),
00548                         ::cosh(_values[1]),
00549                         ::cosh(_values[2]));
00550 }

HxVec3Double HxVec3Double::tanh   const [inline]
 

Hyperbolic tangent.

00554 {
00555     return HxVec3Double(::tanh(_values[0]),
00556                         ::tanh(_values[1]),
00557                         ::tanh(_values[2]));
00558 }

HxVec3Double HxVec3Double::exp   const [inline]
 

Exponent.

00562 {
00563     return HxVec3Double(::exp(_values[0]),
00564                         ::exp(_values[1]),
00565                         ::exp(_values[2]));
00566 }

HxVec3Double HxVec3Double::log   const [inline]
 

Natural logarithm.

00570 {
00571     return HxVec3Double(::log(_values[0]),
00572                         ::log(_values[1]),
00573                         ::log(_values[2]));
00574 }

HxVec3Double HxVec3Double::log10   const [inline]
 

Base 10 logarithm.

00578 {
00579     return HxVec3Double(::log10(_values[0]),
00580                         ::log10(_values[1]),
00581                         ::log10(_values[2]));
00582 }

HxVec3Double & HxVec3Double::operator+= const HxVec3Double &    v [inline]
 

Addition and assignment.

00586 {
00587     _values[0] += v._values[0];
00588     _values[1] += v._values[1];
00589     _values[2] += v._values[2];
00590     return *this;
00591 }

HxVec3Double & HxVec3Double::operator-= const HxVec3Double &    v [inline]
 

Subtraction and assignment.

00595 {
00596     _values[0] -= v._values[0];
00597     _values[1] -= v._values[1];
00598     _values[2] -= v._values[2];
00599     return *this;
00600 }

HxVec3Double & HxVec3Double::operator *= const HxVec3Double &    v [inline]
 

Multiplication and assignment.

00604 {
00605     _values[0] *= v._values[0];
00606     _values[1] *= v._values[1];
00607     _values[2] *= v._values[2];
00608     return *this;
00609 }

HxVec3Double & HxVec3Double::operator/= const HxVec3Double &    v [inline]
 

Division and assignment.

00613 {
00614     _values[0] /= v._values[0];
00615     _values[1] /= v._values[1];
00616     _values[2] /= v._values[2];
00617     return *this;
00618 }

HxVec3Double HxVec3Double::min const HxVec3Double &    v const [inline]
 

Minimum.

00654 {
00655     return (operator<(v)) ? (*this) : v;
00656 }

HxVec3Double & HxVec3Double::minAssign const HxVec3Double &    v [inline]
 

Minimum and assignment.

00660 {
00661     if (operator<(v))
00662         return *this;
00663     operator=(v);
00664     return *this;
00665 }

HxVec3Double HxVec3Double::max const HxVec3Double &    v const [inline]
 

Maximum.

00669 {
00670     return (operator>(v)) ? (*this) : v;
00671 }

HxVec3Double & HxVec3Double::maxAssign const HxVec3Double &    v [inline]
 

Maximum and assignment.

00675 {
00676     if (operator>(v))
00677         return *this;
00678     operator=(v);
00679     return *this;
00680 }

HxVec3Double HxVec3Double::inf const HxVec3Double &    v const [inline]
 

Infimum.

00684 {
00685     return HxVec3Double((_values[0] < v._values[0]) ? _values[0] : v._values[0],
00686                         (_values[1] < v._values[1]) ? _values[1] : v._values[1],
00687                        (_values[2] < v._values[2]) ? _values[2] : v._values[2]);
00688 }

HxVec3Double & HxVec3Double::infAssign const HxVec3Double &    v [inline]
 

Infimum and assignment.

00692 {
00693     _values[0] = (_values[0] < v._values[0]) ? _values[0] : v._values[0];
00694     _values[1] = (_values[1] < v._values[1]) ? _values[1] : v._values[1];
00695     _values[2] = (_values[2] < v._values[2]) ? _values[2] : v._values[2];
00696     return *this;
00697 }

HxVec3Double HxVec3Double::sup const HxVec3Double &    v const [inline]
 

Supremum.

00701 {
00702     return HxVec3Double((_values[0] > v._values[0]) ? _values[0] : v._values[0],
00703                         (_values[1] > v._values[1]) ? _values[1] : v._values[1],
00704                        (_values[2] > v._values[2]) ? _values[2] : v._values[2]);
00705 }

HxVec3Double & HxVec3Double::supAssign const HxVec3Double &    v [inline]
 

Supremum and assignment.

00709 {
00710     _values[0] = (_values[0] > v._values[0]) ? _values[0] : v._values[0];
00711     _values[1] = (_values[1] > v._values[1]) ? _values[1] : v._values[1];
00712     _values[2] = (_values[2] > v._values[2]) ? _values[2] : v._values[2];
00713     return *this;
00714 }

HxVec3Double HxVec3Double::pow const HxVec3Double &    v const [inline]
 

Power.

00718 {
00719     return HxVec3Double(::pow(_values[0], v._values[0]),
00720                         ::pow(_values[1], v._values[1]),
00721                         ::pow(_values[2], v._values[2]));
00722 }

HxVec3Double HxVec3Double::mod const HxVec3Double &    v const [inline]
 

Modulo.

00726 {
00727     return (*this);
00728 }

HxVec3Double HxVec3Double::and const HxVec3Double &    v const [inline]
 

And.

00732 {
00733     return (*this);
00734 }

HxVec3Double HxVec3Double::or const HxVec3Double &    v const [inline]
 

Or.

00738 {
00739     return (*this);
00740 }

HxVec3Double HxVec3Double::xor const HxVec3Double &    v const [inline]
 

Xor.

00744 {
00745     return (*this);
00746 }

HxVec3Double HxVec3Double::leftShift const HxVec3Double &    v const [inline]
 

Left shift.

00750 {
00751     return (*this);
00752 }

HxVec3Double HxVec3Double::rightShift const HxVec3Double &    v const [inline]
 

Right shift.

00756 {
00757     return (*this);
00758 }

HxScalarDouble HxVec3Double::dot const HxVec3Double &    v const
 

Dot product.

00105 {
00106     return (_values[0] * v._values[0]) +
00107            (_values[1] * v._values[1]) +
00108            (_values[2] * v._values[2]);
00109 }

HxVec3Double HxVec3Double::cross const HxVec3Double &    v const [inline]
 

Cross product.

00762 {
00763     return HxVec3Double(_values[1] * v._values[2] - _values[2] * v._values[1],
00764                         _values[2] * v._values[0] - _values[0] * v._values[2],
00765                         _values[0] * v._values[1] - _values[1] * v._values[0]);
00766 }

STD_OSTREAM & HxVec3Double::put STD_OSTREAM &    os const
 

Print value on stream.

For global operator<<

00113 {
00114     return os << "(" << _values[0] << "," << _values[1] << "," <<
00115         _values[2] << ")";
00116 }

HxString HxVec3Double::toString   const
 

Value as a string.

00119                              {
00120     return HxString("(") + makeString(_values[0]) + ", "
00121             + makeString(_values[1]) + ", "
00122             + makeString(_values[2]) + ")";
00123 }


Friends And Related Function Documentation

HxVec3Double operator+ const HxVec3Double &    v1,
const HxVec3Double &    v2
[friend]
 

Addition.

00622 {
00623     return HxVec3Double(v1._values[0] + v2._values[0],
00624                         v1._values[1] + v2._values[1],
00625                         v1._values[2] + v2._values[2]);
00626 }

HxVec3Double operator- const HxVec3Double &    v1,
const HxVec3Double &    v2
[friend]
 

Subtraction.

00630 {
00631     return HxVec3Double(v1._values[0] - v2._values[0],
00632                         v1._values[1] - v2._values[1],
00633                         v1._values[2] - v2._values[2]);
00634 }

HxVec3Double operator * const HxVec3Double &    v1,
const HxVec3Double &    v2
[friend]
 

Multiplication.

00638 {
00639     return HxVec3Double(v1._values[0] * v2._values[0],
00640                         v1._values[1] * v2._values[1],
00641                         v1._values[2] * v2._values[2]);
00642 }

HxVec3Double operator/ const HxVec3Double &    v1,
const HxVec3Double &    v2
[friend]
 

Division.

00646 {
00647     return HxVec3Double(v1._values[0] / v2._values[0],
00648                         v1._values[1] / v2._values[1],
00649                         v1._values[2] / v2._values[2]);
00650 }


Member Data Documentation

const HxVec3Double HxVec3Double::SMALL_VAL = HxVec3Double(0, 0, 0) [static]
 

A small value w.r.t to the comparison operators "<" and ">".

Not actually the minimum to avoid overflow.

const HxVec3Double HxVec3Double::LARGE_VAL = HxVec3Double(1e300, 1e300, 1e300) [static]
 

A large value w.r.t to the comparison operators "<" and ">".

Not actually the maximum to avoid overflow.


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:49:12 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001