#include <HxVec2Double.h>
Constructors | |
HxVec2Double () | |
Default constructor. More... | |
HxVec2Double (double x, double y) | |
Conversion from native type. More... | |
HxVec2Double (const HxVec2Double &rhs) | |
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 | 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 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 on pixel values | |
int | operator== (const HxVec2Double &v) const |
Equal. More... | |
int | operator!= (const HxVec2Double &v) const |
Not equal. More... | |
int | operator< (const HxVec2Double &v) const |
Less than. More... | |
int | operator<= (const HxVec2Double &v) const |
Less equal. More... | |
int | operator> (const HxVec2Double &v) const |
Greater than. More... | |
int | operator>= (const HxVec2Double &v) const |
Greater equal. More... | |
const HxVec2Double | SMALL_VAL = HxVec2Double(0, 0) |
A small value w.r.t to the comparison operators "<" and ">". More... | |
const HxVec2Double | LARGE_VAL = HxVec2Double(1e300, 1e300) |
A large value w.r.t to the comparison operators "<" and ">". More... | |
Unary operations | |
Mathematical definition: Unary operations on pixel values | |
HxVec2Double | operator- () const |
Negation. More... | |
HxVec2Double | complement () const |
Complement. More... | |
HxVec2Double | abs () const |
Absolute value. More... | |
HxVec2Double | ceil () const |
Ceiling. More... | |
HxVec2Double | floor () const |
Floor. More... | |
HxVec2Double | 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... | |
HxVec2Double | sqrt () const |
Square root. More... | |
HxVec2Double | sin () const |
Sine. More... | |
HxVec2Double | cos () const |
Cosine. More... | |
HxVec2Double | tan () const |
Tangent. More... | |
HxVec2Double | asin () const |
Arc sine. More... | |
HxVec2Double | acos () const |
Arc cosine. More... | |
HxVec2Double | atan () const |
Arc tangent. More... | |
HxScalarDouble | atan2 () const |
Arc tangent. More... | |
HxVec2Double | sinh () const |
Hyperbolic sine. More... | |
HxVec2Double | cosh () const |
Hyperbolic cosine. More... | |
HxVec2Double | tanh () const |
Hyperbolic tangent. More... | |
HxVec2Double | exp () const |
Exponent. More... | |
HxVec2Double | log () const |
Natural logarithm. More... | |
HxVec2Double | log10 () const |
Base 10 logarithm. More... | |
Binary operations | |
Mathematical definition: Binary operations on pixel values | |
HxVec2Double & | operator+= (const HxVec2Double &v) |
Addition and assignment. More... | |
HxVec2Double & | operator-= (const HxVec2Double &v) |
Subtraction and assignment. More... | |
HxVec2Double & | operator *= (const HxVec2Double &v) |
Multiplication and assignment. More... | |
HxVec2Double & | operator/= (const HxVec2Double &v) |
Division and assignment. More... | |
HxVec2Double | min (const HxVec2Double &v) const |
Minimum. More... | |
HxVec2Double & | minAssign (const HxVec2Double &v) |
Minimum and assignment. More... | |
HxVec2Double | max (const HxVec2Double &v) const |
Maximum. More... | |
HxVec2Double & | maxAssign (const HxVec2Double &v) |
Maximum and assignment. More... | |
HxVec2Double | inf (const HxVec2Double &v) const |
Infimum. More... | |
HxVec2Double & | infAssign (const HxVec2Double &v) |
Infimum and assignment. More... | |
HxVec2Double | sup (const HxVec2Double &v) const |
Supremum. More... | |
HxVec2Double & | supAssign (const HxVec2Double &v) |
Supremum and assignment. More... | |
HxVec2Double | pow (const HxVec2Double &v) const |
Power. More... | |
HxVec2Double | mod (const HxVec2Double &v) const |
Modulo. More... | |
HxVec2Double | and (const HxVec2Double &v) const |
And. More... | |
HxVec2Double | or (const HxVec2Double &v) const |
Or. More... | |
HxVec2Double | xor (const HxVec2Double &v) const |
Xor. More... | |
HxVec2Double | leftShift (const HxVec2Double &v) const |
Left shift. More... | |
HxVec2Double | rightShift (const HxVec2Double &v) const |
Right shift. More... | |
HxScalarDouble | dot (const HxVec2Double &v) const |
Dot product. More... | |
HxVec2Double | cross (const HxVec2Double &v) const |
Cross product. More... | |
HxVec2Double | operator+ (const HxVec2Double &v1, const HxVec2Double &v2) |
Addition. More... | |
HxVec2Double | operator- (const HxVec2Double &v1, const HxVec2Double &v2) |
Subtraction. More... | |
HxVec2Double | operator * (const HxVec2Double &v1, const HxVec2Double &v2) |
Multiplication. More... | |
HxVec2Double | operator/ (const HxVec2Double &v1, const HxVec2Double &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) |
HxVec2Double & | operator= (const HxVec2Double &rhs) |
|
Default constructor.
00323 { 00324 } |
|
Conversion from native type.
|
|
Copy constructor.
|
|
Dimensionality.
00356 { 00357 return 2; 00358 } |
|
Value of first element.
00362 { 00363 return _values[0]; 00364 } |
|
Value of second element.
00368 { 00369 return _values[1]; 00370 } |
|
Element in given dimension.
00374 { 00375 return _values[dim - 1]; 00376 } |
|
Cast to HxScalarInt.
00026 { 00027 return (int) _values[0]; 00028 } |
|
Cast to HxScalarDouble.
00031 { 00032 return _values[0]; 00033 } |
|
Cast to HxVec2Int.
00036 { 00037 return HxVec2Int(int(_values[0]), int(_values[1])); 00038 } |
|
Cast to HxVec3Int.
00041 { 00042 return HxVec3Int(int(_values[0]), int(_values[1]), 0); 00043 } |
|
Cast to HxVec3Double.
00046 { 00047 return HxVec3Double(_values[0], _values[1], 0); 00048 } |
|
Cast to HxComplex.
00051 { 00052 return HxComplex(_values[0], _values[1]); 00053 } |
|
Equal.
|
|
Not equal.
|
|
Less than.
|
|
Less equal.
|
|
Greater than.
|
|
Greater equal.
|
|
Negation.
00426 { 00427 return HxVec2Double(-_values[0], -_values[1]); 00428 } |
|
Complement.
00432 { 00433 return HxVec2Double(-_values[0], -_values[1]); 00434 } |
|
Absolute value.
00438 { 00439 return HxVec2Double(fabs(_values[0]), fabs(_values[1])); 00440 } |
|
Ceiling.
00444 { 00445 return HxVec2Double(::ceil(_values[0]), ::ceil(_values[1])); 00446 } |
|
Floor.
00450 { 00451 return HxVec2Double(::floor(_values[0]), ::floor(_values[1])); 00452 } |
|
Round.
00456 { 00457 return HxVec2Double((int) (_values[0] + ((_values[0] >= 0) ? 0.5 : -0.5)), 00458 (int) (_values[1] + ((_values[1] >= 0) ? 0.5 : -0.5))); 00459 } |
|
Sum.
00710 { 00711 return _values[0] + _values[1]; 00712 } |
|
Product.
00716 { 00717 return _values[0] * _values[1]; 00718 } |
|
Minimum.
00722 { 00723 return (_values[0] < _values[1]) ? _values[0] : _values[1]; 00724 } |
|
Maximum.
00728 { 00729 return (_values[0] > _values[1]) ? _values[0] : _values[1]; 00730 } |
|
L1 norm.
00057 { 00058 return fabs(_values[0]) + fabs(_values[1]); 00059 } |
|
L2 norm.
00063 { 00064 return ::sqrt(_values[0]*_values[0] + _values[1]*_values[1]); 00065 } |
|
L infinity norm.
00069 { 00070 return (fabs(_values[0]) > fabs(_values[1])) ? fabs(_values[0]) : 00071 fabs(_values[1]); 00072 } |
|
Square root.
00463 { 00464 return HxVec2Double(::sqrt(_values[0]), ::sqrt(_values[1])); 00465 } |
|
Sine.
00469 { 00470 return HxVec2Double(::sin(_values[0]), ::sin(_values[1])); 00471 } |
|
Cosine.
00475 { 00476 return HxVec2Double(::cos(_values[0]), ::cos(_values[1])); 00477 } |
|
Tangent.
00481 { 00482 return HxVec2Double(::tan(_values[0]), ::tan(_values[1])); 00483 } |
|
Arc sine.
00487 { 00488 return HxVec2Double(::asin(_values[0]), ::asin(_values[1])); 00489 } |
|
Arc cosine.
00493 { 00494 return HxVec2Double(::acos(_values[0]), ::acos(_values[1])); 00495 } |
|
Arc tangent.
00499 { 00500 return HxVec2Double(::atan(_values[0]), ::atan(_values[1])); 00501 } |
|
Arc tangent.
00076 { 00077 return HxScalarDouble(::atan2(_values[0], _values[1])); 00078 } |
|
Hyperbolic sine.
00505 { 00506 return HxVec2Double(::sinh(_values[0]), ::sinh(_values[1])); 00507 } |
|
Hyperbolic cosine.
00511 { 00512 return HxVec2Double(::cosh(_values[0]), ::cosh(_values[1])); 00513 } |
|
Hyperbolic tangent.
00517 { 00518 return HxVec2Double(::tanh(_values[0]), ::tanh(_values[1])); 00519 } |
|
Exponent.
00523 { 00524 return HxVec2Double(::exp(_values[0]), ::exp(_values[1])); 00525 } |
|
Natural logarithm.
00529 { 00530 return HxVec2Double(::log(_values[0]), ::log(_values[1])); 00531 } |
|
Base 10 logarithm.
00535 { 00536 return HxVec2Double(::log10(_values[0]), ::log10(_values[1])); 00537 } |
|
Addition and assignment.
|
|
Subtraction and assignment.
|
|
Multiplication and assignment.
|
|
Division and assignment.
|
|
Minimum.
00601 { 00602 return (operator<(v)) ? (*this) : v; 00603 } |
|
Minimum and assignment.
00607 { 00608 if (operator<(v)) 00609 return *this; 00610 operator=(v); 00611 return *this; 00612 } |
|
Maximum.
00616 { 00617 return (operator>(v)) ? (*this) : v; 00618 } |
|
Maximum and assignment.
00622 { 00623 if (operator>(v)) 00624 return *this; 00625 operator=(v); 00626 return *this; 00627 } |
|
Infimum.
00631 { 00632 return HxVec2Double((_values[0] < v._values[0]) ? _values[0] : v._values[0], 00633 (_values[1] < v._values[1]) ? _values[1] : v._values[1]); 00634 } |
|
Infimum and assignment.
|
|
Supremum.
00646 { 00647 return HxVec2Double((_values[0] > v._values[0]) ? _values[0] : v._values[0], 00648 (_values[1] > v._values[1]) ? _values[1] : v._values[1]); 00649 } |
|
Supremum and assignment.
|
|
Power.
00661 { 00662 return HxVec2Double(::pow(_values[0], v._values[0]), 00663 ::pow(_values[1], v._values[1])); 00664 } |
|
Modulo.
00668 { 00669 return (*this); 00670 } |
|
And.
00674 { 00675 return (*this); 00676 } |
|
Or.
00680 { 00681 return (*this); 00682 } |
|
Xor.
00686 { 00687 return (*this); 00688 } |
|
Left shift.
00692 { 00693 return (*this); 00694 } |
|
Right shift.
00698 { 00699 return (*this); 00700 } |
|
Dot product.
|
|
Cross product.
00704 { 00705 return HxVec2Double(0, 0); 00706 } |
|
Print value on stream. For global operator<<
00088 { 00089 return os << "(" << _values[0] << "," << _values[1] << ")"; 00090 } |
|
Value as a string.
00093 { 00094 return HxString("(") + makeString(_values[0]) + ", " 00095 + makeString(_values[1]) + ")"; 00096 } |
|
Addition.
00573 { 00574 return HxVec2Double(v1._values[0] + v2._values[0], 00575 v1._values[1] + v2._values[1]); 00576 } |
|
Subtraction.
00580 { 00581 return HxVec2Double(v1._values[0] - v2._values[0], 00582 v1._values[1] - v2._values[1]); 00583 } |
|
Multiplication.
00587 { 00588 return HxVec2Double(v1._values[0] * v2._values[0], 00589 v1._values[1] * v2._values[1]); 00590 } |
|
Division.
00594 { 00595 return HxVec2Double(v1._values[0] / v2._values[0], 00596 v1._values[1] / v2._values[1]); 00597 } |
|
A small value w.r.t to the comparison operators "<" and ">". Not actually the minimum to avoid overflow. |
|
A large value w.r.t to the comparison operators "<" and ">". Not actually the maximum to avoid overflow. |