Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxScalarDouble Class Reference

Class definition scalar double. More...

#include <HxScalarDouble.h>

List of all members.

Constructors

 HxScalarDouble ()
 Default constructor. More...

 HxScalarDouble (double v)
 Conversion from native type. More...

 HxScalarDouble (const HxScalarDouble &rhs)
 Copy constructor. More...


Inquiry

int dim () const
 Dimensionality. More...

double x () const
 Value of (first) 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 HxVec2Int () const
 Cast to HxVec2Int. More...

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

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

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

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


Operators

Mathematical definition: Binary operations

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

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

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

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

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

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

const HxScalarDouble SMALL_VAL = -1e300
 A small value w.r.t to the comparison operators "<" and ">". More...

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


Unary operations

Mathematical definition: Unary operations

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

HxScalarDouble complement () const
 Complement. More...

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

HxScalarDouble ceil () const
 Ceiling. More...

HxScalarDouble floor () const
 Floor. More...

HxScalarDouble 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...

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

HxScalarDouble sin () const
 Sine. More...

HxScalarDouble cos () const
 Cosine. More...

HxScalarDouble tan () const
 Tangent. More...

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

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

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

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

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

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

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

HxScalarDouble exp () const
 Exponent. More...

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

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


Binary operations

Mathematical definition: Binary operations

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

HxScalarDouble operator/ (const HxScalarDouble &v1, const HxScalarDouble &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)
HxScalarDouble & operator= (const double &v)
HxScalarDouble & operator= (const HxScalarDouble &rhs)


Detailed Description

Class definition scalar double.


Constructor & Destructor Documentation

HxScalarDouble::HxScalarDouble (    )  [inline]
 

Default constructor.

00320 { 
00321 }

HxScalarDouble::HxScalarDouble (  double    v )  [inline]
 

Conversion from native type.

00325     : _value(v)
00326 { 
00327 }

HxScalarDouble::HxScalarDouble (  const HxScalarDouble &    rhs )  [inline]
 

Copy constructor.

00331     : _value(rhs._value)
00332 {
00333 }


Member Function Documentation

int HxScalarDouble::dim (    )  const [inline]
 

Dimensionality.

00357 { 
00358     return 1; 
00359 }

double HxScalarDouble::x (    )  const [inline]
 

Value of (first) element.

00363 { 
00364     return _value; 
00365 }

double HxScalarDouble::getValue (  int    dimension )  const [inline]
 

Element in given dimension.

00369 { 
00370     return _value; 
00371 }

HxScalarDouble::operator HxScalarInt (    )  const
 

Cast to HxScalarInt.

00026 {
00027     return int(_value);
00028 }

HxScalarDouble::operator HxVec2Int (    )  const
 

Cast to HxVec2Int.

00031 {
00032     return HxVec2Int(int(_value), int(_value));
00033 }

HxScalarDouble::operator HxVec2Double (    )  const
 

Cast to HxVec2Double.

00036 {
00037     return HxVec2Double(_value, _value);
00038 }

HxScalarDouble::operator HxVec3Int (    )  const
 

Cast to HxVec3Int.

00041 {
00042     return HxVec3Int(int(_value), int(_value), int(_value));
00043 }

HxScalarDouble::operator HxVec3Double (    )  const
 

Cast to HxVec3Double.

00046 {
00047     return HxVec3Double(_value, _value, _value);
00048 }

HxScalarDouble::operator HxComplex (    )  const
 

Cast to HxComplex.

00051 {
00052     return HxComplex(_value, 0.0);
00053 }

int HxScalarDouble::operator== (  const HxScalarDouble &    v )  const [inline]
 

Equal.

00387 {
00388     return (_value == v._value);
00389 }

int HxScalarDouble::operator!= (  const HxScalarDouble &    v )  const [inline]
 

Not equal.

00393 {
00394     return (_value != v._value);
00395 }

int HxScalarDouble::operator< (  const HxScalarDouble &    v )  const [inline]
 

Less than.

00399 {
00400     return (_value < v._value);
00401 }

int HxScalarDouble::operator<= (  const HxScalarDouble &    v )  const [inline]
 

Less equal.

00405 {
00406     return (_value <= v._value);
00407 }

int HxScalarDouble::operator> (  const HxScalarDouble &    v )  const [inline]
 

Greater than.

00411 {
00412     return (_value > v._value);
00413 }

int HxScalarDouble::operator>= (  const HxScalarDouble &    v )  const [inline]
 

Greater equal.

00417 {
00418     return (_value >= v._value);
00419 }

HxScalarDouble HxScalarDouble::operator- (    )  const [inline]
 

Negation.

00423 {
00424     return HxScalarDouble(-_value);
00425 }

HxScalarDouble HxScalarDouble::complement (    )  const [inline]
 

Complement.

00429 {
00430     return HxScalarDouble(-_value);
00431 }

HxScalarDouble HxScalarDouble::abs (    )  const [inline]
 

Absolute value.

00435 {
00436     return HxScalarDouble(fabs(_value));
00437 }

HxScalarDouble HxScalarDouble::ceil (    )  const [inline]
 

Ceiling.

00441 {
00442     return HxScalarDouble(::ceil(_value));
00443 }

HxScalarDouble HxScalarDouble::floor (    )  const [inline]
 

Floor.

00447 {
00448     return HxScalarDouble(::floor(_value));
00449 }

HxScalarDouble HxScalarDouble::round (    )  const [inline]
 

Round.

00453 {
00454     return HxScalarDouble((int) (_value + ((_value >= 0) ? 0.5 : -0.5)));
00455 }

HxScalarDouble HxScalarDouble::sum (    )  const [inline]
 

Sum.

00459 {
00460     return *this;
00461 }

HxScalarDouble HxScalarDouble::product (    )  const [inline]
 

Product.

00465 {
00466     return *this;
00467 }

HxScalarDouble HxScalarDouble::min (    )  const [inline]
 

Minimum.

00471 {
00472     return *this;
00473 }

HxScalarDouble HxScalarDouble::max (    )  const [inline]
 

Maximum.

00477 {
00478     return *this;
00479 }

HxScalarDouble HxScalarDouble::norm1 (    )  const [inline]
 

L1 norm.

00483 {
00484     return HxScalarDouble(fabs(_value));
00485 }

HxScalarDouble HxScalarDouble::norm2 (    )  const
 

L2 norm.

00057 {
00058     return HxScalarDouble(fabs(_value));
00059 }

HxScalarDouble HxScalarDouble::normInf (    )  const [inline]
 

L infinity norm.

00489 {
00490     return HxScalarDouble(fabs(_value));
00491 }

HxScalarDouble HxScalarDouble::sqrt (    )  const [inline]
 

Square root.

00495 {
00496     return HxScalarDouble(::sqrt(_value));
00497 }

HxScalarDouble HxScalarDouble::sin (    )  const [inline]
 

Sine.

00501 {
00502     return HxScalarDouble(::sin(_value));
00503 }

HxScalarDouble HxScalarDouble::cos (    )  const [inline]
 

Cosine.

00507 {
00508     return HxScalarDouble(::cos(_value));
00509 }

HxScalarDouble HxScalarDouble::tan (    )  const [inline]
 

Tangent.

00513 {
00514     return HxScalarDouble(::tan(_value));
00515 }

HxScalarDouble HxScalarDouble::asin (    )  const [inline]
 

Arc sine.

00519 {
00520     return HxScalarDouble(::asin(_value));
00521 }

HxScalarDouble HxScalarDouble::acos (    )  const [inline]
 

Arc cosine.

00525 {
00526     return HxScalarDouble(::acos(_value));
00527 }

HxScalarDouble HxScalarDouble::atan (    )  const [inline]
 

Arc tangent.

00531 {
00532     return HxScalarDouble(::atan(_value));
00533 }

HxScalarDouble HxScalarDouble::atan2 (    )  const
 

Arc tangent.

00063 {
00064     return HxScalarDouble(::atan(_value));
00065 }

HxScalarDouble HxScalarDouble::sinh (    )  const [inline]
 

Hyperbolic sine.

00537 {
00538     return HxScalarDouble(::sinh(_value));
00539 }

HxScalarDouble HxScalarDouble::cosh (    )  const [inline]
 

Hyperbolic cosine.

00543 {
00544     return HxScalarDouble(::cosh(_value));
00545 }

HxScalarDouble HxScalarDouble::tanh (    )  const [inline]
 

Hyperbolic tangent.

00549 {
00550     return HxScalarDouble(::tanh(_value));
00551 }

HxScalarDouble HxScalarDouble::exp (    )  const [inline]
 

Exponent.

00555 {
00556     return HxScalarDouble(::exp(_value));
00557 }

HxScalarDouble HxScalarDouble::log (    )  const [inline]
 

Natural logarithm.

00561 {
00562     return HxScalarDouble(::log(_value));
00563 }

HxScalarDouble HxScalarDouble::log10 (    )  const [inline]
 

Base 10 logarithm.

00567 {
00568     return HxScalarDouble(::log10(_value));
00569 }

HxScalarDouble & HxScalarDouble::operator+= (  const HxScalarDouble &    v )  [inline]
 

Addition and assignment.

00573 {
00574     _value += v._value;
00575     return *this;
00576 }

HxScalarDouble & HxScalarDouble::operator-= (  const HxScalarDouble &    v )  [inline]
 

Subtraction and assignment.

00580 {
00581     _value -= v._value;
00582     return *this;
00583 }

HxScalarDouble & HxScalarDouble::operator *= (  const HxScalarDouble &    v )  [inline]
 

Multiplication and assignment.

00587 {
00588     _value *= v._value;
00589     return *this;
00590 }

HxScalarDouble & HxScalarDouble::operator/= (  const HxScalarDouble &    v )  [inline]
 

Division and assignment.

00594 {
00595     _value /= v._value;
00596     return *this;
00597 }

HxScalarDouble HxScalarDouble::min (  const HxScalarDouble &    v )  const [inline]
 

Minimum.

00625 {
00626     return (operator<(v)) ? (*this) : v;
00627 }

HxScalarDouble & HxScalarDouble::minAssign (  const HxScalarDouble &    v )  [inline]
 

Minimum and assignment.

00631 {
00632     if (operator<(v))
00633         return *this;
00634     operator=(v);
00635     return *this;
00636 }

HxScalarDouble HxScalarDouble::max (  const HxScalarDouble &    v )  const [inline]
 

Maximum.

00640 {
00641     return (operator>(v)) ? (*this) : v;
00642 }

HxScalarDouble & HxScalarDouble::maxAssign (  const HxScalarDouble &    v )  [inline]
 

Maximum and assignment.

00646 {
00647     if (operator>(v))
00648         return *this;
00649     operator=(v);
00650     return *this;
00651 }

HxScalarDouble HxScalarDouble::inf (  const HxScalarDouble &    v )  const [inline]
 

Infimum.

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

HxScalarDouble & HxScalarDouble::infAssign (  const HxScalarDouble &    v )  [inline]
 

Infimum and assignment.

00661 {
00662     _value = (_value < v._value) ? _value : v._value;
00663     return *this;
00664 }

HxScalarDouble HxScalarDouble::sup (  const HxScalarDouble &    v )  const [inline]
 

Supremum.

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

HxScalarDouble & HxScalarDouble::supAssign (  const HxScalarDouble &    v )  [inline]
 

Supremum and assignment.

00674 {
00675     _value = (_value > v._value) ? _value : v._value;
00676     return *this;
00677 }

HxScalarDouble HxScalarDouble::pow (  const HxScalarDouble &    v )  const [inline]
 

Power.

00681 {
00682     return HxScalarDouble(::pow(_value, v._value));
00683 }

HxScalarDouble HxScalarDouble::mod (  const HxScalarDouble &    v )  const [inline]
 

Modulo.

00687 {
00688     return (*this);
00689 }

HxScalarDouble HxScalarDouble::and (  const HxScalarDouble &    v )  const [inline]
 

And.

00693 {
00694     return (*this);
00695 }

HxScalarDouble HxScalarDouble::or (  const HxScalarDouble &    v )  const [inline]
 

Or.

00699 {
00700     return (*this);
00701 }

HxScalarDouble HxScalarDouble::xor (  const HxScalarDouble &    v )  const [inline]
 

Xor.

00705 {
00706     return (*this);
00707 }

HxScalarDouble HxScalarDouble::leftShift (  const HxScalarDouble &    v )  const [inline]
 

Left shift.

00711 {
00712     return (*this);
00713 }

HxScalarDouble HxScalarDouble::rightShift (  const HxScalarDouble &    v )  const [inline]
 

Right shift.

00717 {
00718     return (*this);
00719 }

HxScalarDouble HxScalarDouble::dot (  const HxScalarDouble &    v )  const
 

Dot product.

00069 {
00070     return _value * v._value;
00071 }

HxScalarDouble HxScalarDouble::cross (  const HxScalarDouble &    v )  const [inline]
 

Cross product.

00723 {
00724     return HxScalarDouble(0.0);
00725 }

STD_OSTREAM & HxScalarDouble::put (  STD_OSTREAM &    os )  const
 

Print value on stream.

For global operator<<

00075 {
00076     return os << _value;
00077 }

HxString HxScalarDouble::toString (    )  const [inline]
 

Value as a string.

00729 { 
00730     return makeString(_value); 
00731 }


Friends And Related Function Documentation

HxScalarDouble operator+ (  const HxScalarDouble &    v1,
const HxScalarDouble &    v2
)  [friend]
 

Addition.

00601 {
00602     return HxScalarDouble(v1._value + v2._value);
00603 }

HxScalarDouble operator- (  const HxScalarDouble &    v1,
const HxScalarDouble &    v2
)  [friend]
 

Subtraction.

00607 {
00608     return HxScalarDouble(v1._value - v2._value);
00609 }

HxScalarDouble operator * (  const HxScalarDouble &    v1,
const HxScalarDouble &    v2
)  [friend]
 

Multiplication.

00613 {
00614     return HxScalarDouble(v1._value * v2._value);
00615 }

HxScalarDouble operator/ (  const HxScalarDouble &    v1,
const HxScalarDouble &    v2
)  [friend]
 

Division.

00619 {
00620     return HxScalarDouble(v1._value / v2._value);
00621 }


Member Data Documentation

const HxScalarDouble HxScalarDouble::SMALL_VAL = -1e300 [static]
 

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

Not actually the minimum to avoid overflow.

const HxScalarDouble HxScalarDouble::LARGE_VAL = 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 Tue Jan 8 13:59:35 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001