#include <HxScalarInt.h>
Constructors | |
HxScalarInt () | |
Default constructor. More... | |
HxScalarInt (int v) | |
Conversion from native type. More... | |
HxScalarInt (const HxScalarInt &v) | |
Copy constructor. More... | |
Inquiry | |
int | dim () const |
Dimensionality. More... | |
int | x () const |
Value of (first) element. More... | |
int | getValue (int dimension) const |
Element in given dimension. More... | |
void | setValue (int dimension, int value) |
Conversion | |
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 HxVec3Double () const | |
Cast to HxVec3Double. More... | |
operator HxComplex () const | |
Cast to HxComplex. More... | |
Operators | |
Mathematical definition: Binary operations on pixel values | |
int | operator== (const HxScalarInt &v) const |
Equal. More... | |
int | operator!= (const HxScalarInt &v) const |
Not equal. More... | |
int | operator< (const HxScalarInt &v) const |
Less than. More... | |
int | operator<= (const HxScalarInt &v) const |
Less equal. More... | |
int | operator> (const HxScalarInt &v) const |
Greater than. More... | |
int | operator>= (const HxScalarInt &v) const |
Greater equal. More... | |
const HxScalarInt | SMALL_VAL = -200000000 |
A small value w.r.t to the comparison operators "<" and ">". More... | |
const HxScalarInt | LARGE_VAL = 200000000 |
A large value w.r.t to the comparison operators "<" and ">". More... | |
Unary operations | |
Mathematical definition: Unary operations on pixel values | |
HxScalarInt | operator- () const |
Negation. More... | |
HxScalarInt | complement () const |
Complement. More... | |
HxScalarInt | abs () const |
Absolute value. More... | |
HxScalarInt | ceil () const |
Ceiling. More... | |
HxScalarInt | floor () const |
Floor. More... | |
HxScalarInt | round () const |
Round. More... | |
HxScalarInt | sum () const |
Sum. More... | |
HxScalarInt | product () const |
Product. More... | |
HxScalarInt | min () const |
Minimum. More... | |
HxScalarInt | max () const |
Maximum. More... | |
HxScalarInt | norm1 () const |
L1 norm. More... | |
HxScalarDouble | norm2 () const |
L2 norm. More... | |
HxScalarInt | 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 on pixel values | |
HxScalarInt & | operator+= (const HxScalarInt &v) |
Addition and assignment. More... | |
HxScalarInt & | operator-= (const HxScalarInt &v) |
Subtraction and assignment. More... | |
HxScalarInt & | operator *= (const HxScalarInt &v) |
Multiplication and assignment. More... | |
HxScalarInt & | operator/= (const HxScalarInt &v) |
Division and assignment. More... | |
HxScalarInt | min (const HxScalarInt &v) const |
Minimum. More... | |
HxScalarInt & | minAssign (const HxScalarInt &v) |
Minimum and assignment. More... | |
HxScalarInt | max (const HxScalarInt &v) const |
Maximum. More... | |
HxScalarInt & | maxAssign (const HxScalarInt &v) |
Maximum and assignment. More... | |
HxScalarInt | inf (const HxScalarInt &v) const |
Infimum. More... | |
HxScalarInt & | infAssign (const HxScalarInt &v) |
Infimum and assignment. More... | |
HxScalarInt | sup (const HxScalarInt &v) const |
Supremum. More... | |
HxScalarInt & | supAssign (const HxScalarInt &v) |
Supremum and assignment. More... | |
HxScalarInt | pow (const HxScalarInt &v) const |
Power. More... | |
HxScalarInt | mod (const HxScalarInt &v) const |
Modulo. More... | |
HxScalarInt | and (const HxScalarInt &v) const |
And. More... | |
HxScalarInt | or (const HxScalarInt &v) const |
Or. More... | |
HxScalarInt | xor (const HxScalarInt &v) const |
Xor. More... | |
HxScalarInt | leftShift (const HxScalarInt &v) const |
Left shift. More... | |
HxScalarInt | rightShift (const HxScalarInt &v) const |
Right shift. More... | |
HxScalarInt | dot (const HxScalarInt &v) const |
Dot product. More... | |
HxScalarInt | cross (const HxScalarInt &v) const |
Cross product. More... | |
HxScalarInt | operator+ (const HxScalarInt &v1, const HxScalarInt &v2) |
Addition. More... | |
HxScalarInt | operator- (const HxScalarInt &v1, const HxScalarInt &v2) |
Subtraction. More... | |
HxScalarInt | operator * (const HxScalarInt &v1, const HxScalarInt &v2) |
Multiplication. More... | |
HxScalarInt | operator/ (const HxScalarInt &v1, const HxScalarInt &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) |
|
Default constructor.
00317 { 00318 } |
|
Conversion from native type.
00322 { 00323 _value = v; 00324 } |
|
Copy constructor.
00328 { 00329 _value = v._value; 00330 } |
|
Dimensionality.
00340 { 00341 return 1; 00342 } |
|
Value of (first) element.
00346 { 00347 return _value; 00348 } |
|
Element in given dimension.
00352 { 00353 return _value; 00354 } |
|
Cast to HxScalarDouble.
00026 { 00027 return HxScalarDouble(_value); 00028 } |
|
Cast to HxVec2Int.
00031 { 00032 return HxVec2Int(_value, _value); 00033 } |
|
Cast to HxVec2Double.
00036 { 00037 return HxVec2Double(_value, _value); 00038 } |
|
Cast to HxVec3Int.
00041 { 00042 return HxVec3Int(_value, _value, _value); 00043 } |
|
Cast to HxVec3Double.
00046 { 00047 return HxVec3Double(_value, _value, _value); 00048 } |
|
Cast to HxComplex.
00051 { 00052 return HxComplex(_value, 0.0); 00053 } |
|
Equal.
00370 { 00371 return (_value == v._value); 00372 } |
|
Not equal.
00376 { 00377 return (_value != v._value); 00378 } |
|
Less than.
00382 { 00383 return (_value < v._value); 00384 } |
|
Less equal.
00388 { 00389 return (_value <= v._value); 00390 } |
|
Greater than.
00394 { 00395 return (_value > v._value); 00396 } |
|
Greater equal.
00400 { 00401 return (_value >= v._value); 00402 } |
|
Negation.
00406 { 00407 return HxScalarInt(-_value); 00408 } |
|
Complement.
00412 { 00413 return HxScalarInt(~_value); 00414 } |
|
Absolute value.
00418 { 00419 return HxScalarInt(::abs(_value)); 00420 } |
|
Ceiling.
00424 { 00425 return *this; 00426 } |
|
Floor.
00430 { 00431 return *this; 00432 } |
|
Round.
00436 { 00437 return *this; 00438 } |
|
Sum.
00442 { 00443 return *this; 00444 } |
|
Product.
00448 { 00449 return *this; 00450 } |
|
Minimum.
00454 { 00455 return *this; 00456 } |
|
Maximum.
00460 { 00461 return *this; 00462 } |
|
L1 norm.
00466 { 00467 return HxScalarInt(::abs(_value)); 00468 } |
|
L2 norm.
00057 { 00058 return HxScalarDouble(::abs(_value)); 00059 } |
|
L infinity norm.
00472 { 00473 return HxScalarInt(::abs(_value)); 00474 } |
|
Square root.
00063 { 00064 return HxScalarDouble(::sqrt(double(_value))); 00065 } |
|
Sine.
00069 { 00070 return HxScalarDouble(::sin(double(_value))); 00071 } |
|
Cosine.
00075 { 00076 return HxScalarDouble(::cos(double(_value))); 00077 } |
|
Tangent.
00081 { 00082 return HxScalarDouble(::tan(double(_value))); 00083 } |
|
Arc sine.
00087 { 00088 return HxScalarDouble(::asin(double(_value))); 00089 } |
|
Arc cosine.
00093 { 00094 return HxScalarDouble(::acos(double(_value))); 00095 } |
|
Arc tangent.
00099 { 00100 return HxScalarDouble(::atan(double(_value))); 00101 } |
|
Arc tangent.
00105 { 00106 return HxScalarDouble(::atan(double(_value))); 00107 } |
|
Hyperbolic sine.
00111 { 00112 return HxScalarDouble(::sinh(double(_value))); 00113 } |
|
Hyperbolic cosine.
00117 { 00118 return HxScalarDouble(::cosh(double(_value))); 00119 } |
|
Hyperbolic tangent.
00123 { 00124 return HxScalarDouble(::tanh(double(_value))); 00125 } |
|
Exponent.
00129 { 00130 return HxScalarDouble(::exp(double(_value))); 00131 } |
|
Natural logarithm.
00135 { 00136 return HxScalarDouble(::log(double(_value))); 00137 } |
|
Base 10 logarithm.
00141 { 00142 return HxScalarDouble(::log10(double(_value))); 00143 } |
|
Addition and assignment.
00478 { 00479 _value += v._value; 00480 return *this; 00481 } |
|
Subtraction and assignment.
00485 { 00486 _value -= v._value; 00487 return *this; 00488 } |
|
Multiplication and assignment.
00492 { 00493 _value *= v._value; 00494 return *this; 00495 } |
|
Division and assignment.
00499 { 00500 _value /= v._value; 00501 return *this; 00502 } |
|
Minimum.
00530 { 00531 return (operator<(v)) ? (*this) : v; 00532 } |
|
Minimum and assignment.
00536 { 00537 if (operator<(v)) 00538 return *this; 00539 operator=(v); 00540 return *this; 00541 } |
|
Maximum.
00545 { 00546 return (operator>(v)) ? (*this) : v; 00547 } |
|
Maximum and assignment.
00551 { 00552 if (operator>(v)) 00553 return *this; 00554 operator=(v); 00555 return *this; 00556 } |
|
Infimum.
00560 { 00561 return (operator<(v)) ? (*this) : v; 00562 } |
|
Infimum and assignment.
|
|
Supremum.
00573 { 00574 return (operator>(v)) ? (*this) : v; 00575 } |
|
Supremum and assignment.
|
|
Power.
00586 { 00587 return HxScalarInt((int) (::pow(_value, v._value) + 0.5)); 00588 } |
|
Modulo.
00592 { 00593 return HxScalarInt(_value % v._value); 00594 } |
|
And.
00598 { 00599 return HxScalarInt(_value & v._value); 00600 } |
|
Or.
00604 { 00605 return HxScalarInt(_value | v._value); 00606 } |
|
Xor.
00610 { 00611 return HxScalarInt(_value ^ v._value); 00612 } |
|
Left shift.
00616 { 00617 return HxScalarInt(_value << v._value); 00618 } |
|
Right shift.
00622 { 00623 return HxScalarInt(_value >> v._value); 00624 } |
|
Dot product.
00147 { 00148 return _value * v._value; 00149 } |
|
Cross product.
00628 { 00629 return 0; 00630 } |
|
Print value on stream. For global operator<<
00153 { 00154 return os << _value; 00155 } |
|
Value as a string.
00634 { 00635 return makeString(_value); 00636 } |
|
Addition.
00506 { 00507 return HxScalarInt(v1._value + v2._value); 00508 } |
|
Subtraction.
00512 { 00513 return HxScalarInt(v1._value - v2._value); 00514 } |
|
Multiplication.
00518 { 00519 return HxScalarInt(v1._value * v2._value); 00520 } |
|
Division.
00524 { 00525 return HxScalarInt(v1._value / v2._value); 00526 } |
|
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. |