58 template<
class SrcIterator,
class DstIterator,
unsigned int N>
59 static void optimized_copy(SrcIterator srcBegin, SrcIterator srcEnd, DstIterator dstBegin){
63 while(srcBegin != srcEnd){
76 template<
class T,
unsigned int COLS,
unsigned int ROWS>
class FixedMatrix;
91 template<
class T,
unsigned int N,
class Iterator>
112 FixedMatrixBase::optimized_copy<Iterator,Iterator,N>(other.
begin,other.
end,
begin);
119 template<
class OtherIterator,
class OtherT>
121 std::transform(other.
begin,other.
end,
begin,utils::clipped_cast<OtherT,T>);
127 template<
unsigned int COLS>
132 template<
class T2,
unsigned int COLS>
171 template<
class T,
unsigned int COLS,
unsigned int ROWS>
189 static const unsigned int DIM = COLS*ROWS;
208 FixedMatrixBase::optimized_copy<const T*,T*,DIM>(srcdata,srcdata+
dim(),
begin());
217 const T& v4=0,
const T& v5=0,
const T& v6=0,
const T& v7=0,
218 const T& v8=0,
const T& v9=0,
const T& v10=0,
const T& v11=0,
219 const T& v12=0,
const T& v13=0,
const T& v14=0,
const T& v15=0){
220 #define C1(N) if(DIM>N) utils::FixedArray<T,COLS*ROWS>::m_data[N]=v##N 221 #define C4(A,B,C,D) C1(A);C1(B);C1(C);C1(D) 222 C4(0,1,2,3);
C4(4,5,6,7);
C4(8,9,10,11);
C4(12,13,14,15);
229 template<
class OtherIterator>
231 FixedMatrixBase::optimized_copy<OtherIterator,T*,DIM>(
begin,
end,this->
begin());
237 FixedMatrixBase::optimized_copy<const T*,T*,DIM>(other.
begin(),other.
end(),
begin());
242 template<
class otherT>
248 template<
class Iterator>
250 FixedMatrixBase::optimized_copy<Iterator,T*,DIM>(r.
begin,r.
end,
begin());
254 template<
class otherT,
class Iterator>
256 std::transform(r.
begin,r.
end,
begin(),utils::clipped_cast<otherT,T>);
261 if(
this == &other)
return *
this;
262 FixedMatrixBase::optimized_copy<const T*,T*,DIM>(other.
begin(),other.
end(),
begin());
269 template<
class otherT>
271 if(
this == &other)
return *
this;
283 template<
class Iterator>
286 FixedMatrixBase::optimized_copy<Iterator,T*,DIM>(r.
begin,r.
end,
begin());
291 template<
class otherT,
class Iterator>
293 std::transform(r.
begin,r.
end,
begin(),utils::clipped_cast<otherT,T>);
314 std::transform(
begin(),
end(),d.
begin(),std::bind2nd(std::multiplies<T>(),f));
320 std::transform(
begin(),
end(),
begin(),std::bind2nd(std::multiplies<T>(),f));
327 std::transform(
begin(),
end(),d.
begin(),std::bind2nd(std::divides<T>(),f));
333 std::transform(
begin(),
end(),
begin(),std::bind2nd(std::divides<T>(),f));
340 std::transform(
begin(),
end(),d.
begin(),std::bind2nd(std::plus<T>(),t));
346 std::transform(
begin(),
end(),
begin(),std::bind2nd(std::plus<T>(),t));
354 std::transform(
begin(),
end(),d.
begin(),std::bind2nd(std::minus<T>(),t));
360 std::transform(
begin(),
end(),
begin(),std::bind2nd(std::minus<T>(),t));
394 std::transform(cpy.
begin(),cpy.
end(),cpy.
begin(),std::negate<T>());
416 const T &
at(
unsigned int col,
unsigned int row)
const {
417 return const_cast<FixedMatrix*>(
this)->at(
col,
row);
447 static unsigned int rows(){
return ROWS; }
450 static unsigned int cols(){
return COLS; }
459 static unsigned int dim() {
return DIM; }
462 struct col_iterator :
public std::iterator<std::random_access_iterator_tag,T>{
666 template<
unsigned int MCOLS>
668 for(
unsigned int c=0;c<MCOLS;++c){
669 for(
unsigned int r=0;r<ROWS;++r){
699 template<
unsigned int MCOLS>
730 for(
unsigned int i=0;i<
cols();++i){
731 FixedMatrixBase::optimized_copy<const_col_iterator, typename FixedMatrix<T,ROWS,COLS>::row_iterator,
DIM>(
col_begin(i),
col_end(i),d.
row_begin(i));
739 template<
unsigned int OTHER_COLS>
749 template<
unsigned int OTHER_COLS>
751 return this->
transp() * M;
755 double cond(
const double p=2)
const {
764 for(
int i=0;i<
DIM;i+=COLS+1){
791 template<
unsigned int X,
unsigned int Y,
unsigned int WIDTH,
unsigned int HEIGHT>
799 template<
unsigned int X,
unsigned int Y,
unsigned int WIDTH,
unsigned int HEIGHT>
810 template<
unsigned int NEW_WIDTH,
unsigned int NEW_HEIGHT>
813 for(
unsigned int x=0;x<COLS && x < NEW_WIDTH; ++x){
814 for(
unsigned int y=0;y<ROWS && y < NEW_HEIGHT; ++y){
815 M(x,y) = (*this)(x,y);
828 for(
unsigned int i=0;i<ROWS && i<COLS;++i){
836 double sumSquares = 0;
837 for(
unsigned int i=0;i<
DIM;++i){
838 sumSquares += ::pow((
double)(*
this)[i],(
double)
norm);
840 return ::pow( sumSquares, 1.0/
norm);
852 return l ? (*this)/l : *
this;
856 template<
class otherT>
858 for(
unsigned int i=0;i<
DIM;++i){
859 if(
begin()[i] != m[i])
return false;
864 template<
class otherT>
874 for(
unsigned int i=0;i<ROWS;++i){
884 dyn().decompose_QR(Qd,Rd);
891 dyn().decompose_RQ(Rd,Qd);
898 return dyn().svd(Ud,sd,Vd);
924 return dyn().eigen(evecs,evals);
932 template<
class T,
unsigned int WIDTH,
unsigned int HEIGHT,
unsigned int HEIGHT2>
936 for(
unsigned int i=0;i<HEIGHT;++i) M.
row(i) = a.
row(i);
937 for(
unsigned int i=0;i<HEIGHT2;++i) M.
row(i+HEIGHT) = b.
row(i);
943 template<
class T,
unsigned int WIDTH,
unsigned int HEIGHT,
unsigned int WIDTH2>
947 for(
unsigned int i=0;i<WIDTH;++i) M.
col(i) = a.
col(i);
948 for(
unsigned int i=0;i<WIDTH2;++i) M.
col(i+WIDTH) = b.
col(i);
958 template<
class T,
unsigned int M_ROWS_AND_COLS,
unsigned int V_COLS>
966 template<
class T,
unsigned int COLS,
unsigned int ROWS>
973 template<
class T,
unsigned int COLS,
unsigned int ROWS>
1015 T dx=0, T dy=0, T dz=0,
1016 T v0=0, T v1=0, T v2=0,
1044 template<
class T,
unsigned int N,
class Iterator>
template<
unsigned int COLS>
1046 FixedMatrixBase::optimized_copy<const T*,Iterator,N>(m.
begin(),m.
end(),begin);
1050 template<
class T,
unsigned int N,
class Iterator>
template<
class T2,
unsigned int COLS>
1058 #define OPTIMIZED_MATRIX_MULTIPLICATION(LEFT_COLS,LEFT_ROWS,RIGHT_COLS,TYPE,IPPSUFFIX) \ 1059 template<> template<> \ 1061 FixedMatrix<TYPE,RIGHT_COLS,LEFT_ROWS>::mult \ 1063 const FixedMatrix<TYPE,RIGHT_COLS,LEFT_COLS> &m, \ 1064 FixedMatrix<TYPE,RIGHT_COLS,LEFT_ROWS> &dst \ 1066 static const unsigned int ST=sizeof(TYPE); \ 1067 ippmMul_mm_##IPPSUFFIX(data(),LEFT_COLS*ST,ST,LEFT_COLS,LEFT_ROWS, \ 1068 m.data(),RIGHT_COLS*ST,ST,RIGHT_COLS,LEFT_COLS, \ 1069 dst.data(),RIGHT_COLS*ST,ST); \ 1079 #undef OPTIMIZED_MATRIX_MULTIPLICATION 1084 #define USE_OPTIMIZED_INV_AND_DET_FOR_2X2_3X3_AND_4X4_MATRICES 1086 #ifdef USE_OPTIMIZED_INV_AND_DET_FOR_2X2_3X3_AND_4X4_MATRICES 1093 void icl_util_get_fixed_4x4_matrix_inv(
const T *src, T*dst);
1095 void icl_util_get_fixed_3x3_matrix_inv(
const T *src, T*dst);
1097 void icl_util_get_fixed_2x2_matrix_inv(
const T *src, T*dst);
1100 T icl_util_get_fixed_4x4_matrix_det(
const T *src);
1102 T icl_util_get_fixed_3x3_matrix_det(
const T *src);
1104 T icl_util_get_fixed_2x2_matrix_det(
const T *src);
1106 #define SPECIALISED_MATRIX_INV_AND_DET(D,T) \ 1108 inline FixedMatrix<T,D,D> FixedMatrix<T,D,D>::inv() const \ 1110 FixedMatrix<T,D,D> r; \ 1111 icl_util_get_fixed_##D##x##D##_matrix_inv<T>(begin(),r.begin()); \ 1115 inline T FixedMatrix<T,D,D>::det() const \ 1117 return icl_util_get_fixed_##D##x##D##_matrix_det<T>(begin()); \ 1121 SPECIALISED_MATRIX_INV_AND_DET(2,
float);
1122 SPECIALISED_MATRIX_INV_AND_DET(3,
float);
1123 SPECIALISED_MATRIX_INV_AND_DET(4,
float);
1124 SPECIALISED_MATRIX_INV_AND_DET(2,
double);
1125 SPECIALISED_MATRIX_INV_AND_DET(3,
double);
1126 SPECIALISED_MATRIX_INV_AND_DET(4,
double);
1129 #undef SPECIALISED_MATRIX_INV_AND_DET 1139 template class ICLMath_API FixedMatrix<float, 3, 3>;
1140 template class ICLMath_API FixedMatrix<double, 3, 3>;
FixedMatrix< T, 3, 3 > create_hom_3x3_trans(T dx, T dy)
creates a 2D homogen matrix with translation part only (defined for float and double)
Definition: FixedMatrix.h:990
Definition: FixedMatrix.h:999
unsigned int difference_type
just for compatibility with STL
Definition: FixedMatrix.h:465
difference_type operator-(const col_iterator &i) const
steps between two iterators ... (todo: check!)
Definition: FixedMatrix.h:580
FixedMatrix & operator/=(T f)
Divide all elements by a scalar.
Definition: FixedMatrix.h:332
Definition: FixedMatrix.h:1000
const col_iterator const_col_iterator
Definition: FixedMatrix.h:615
FixedMatrixPart< T, ROWS, col_iterator > col(unsigned int idx)
returns a matrix col-reference iterator pair
Definition: FixedMatrix.h:781
Definition: FixedMatrix.h:1002
const col_iterator & operator-=(difference_type n) const
jump backward next n elements (inplace) (const)
Definition: FixedMatrix.h:545
const T * const_row_iterator
const row_iterator
Definition: FixedMatrix.h:444
FixedMatrix(const FixedMatrixPart< otherT, DIM, Iterator > &r)
Create matrix of a sub-part of another matrix (compatible types)
Definition: FixedMatrix.h:255
ICLMath_IMP FixedMatrix< T, 2, 2 > create_rot_2D(T angle)
creates a 2D rotation matrix (defined for float and double)
col_iterator & operator+=(difference_type n)
jump next n elements (inplace)
Definition: FixedMatrix.h:526
Definition: FixedMatrix.h:1002
const T & at(unsigned int col, unsigned int row) const
Element access index save (with exception if index is invalid) (const)
Definition: FixedMatrix.h:416
Powerful and highly flexible matrix class implementation.
Definition: FixedMatrix.h:172
bool operator!=(const FixedMatrix< otherT, COLS, ROWS > &m) const
Element-wise comparison with other matrix.
Definition: FixedMatrix.h:865
ICLMath_IMP FixedMatrix< T, 4, 4 > create_rot_4x4(T axisX, T axisY, T axisZ, T angle)
create 4D homogeneous matrix that rotates about given axis by given angle (defined for float and doub...
FixedMatrixPart & operator=(const FixedMatrixPart< OtherT, N, OtherIterator > &other)
Assignment with another (compatible) instance of FixedMatrixPart.
Definition: FixedMatrix.h:120
undocument this line if you encounter any issues!
Definition: Any.h:37
ICLMath_IMP FixedMatrix< T, 1, 3 > extract_euler_angles(const FixedMatrix< T, 3, 3 > &m, AXES axes=AXES_DEFAULT)
compute euler angles for rotation matrix assuming specified axes order
const_row_iterator row_begin(unsigned int row) const
returns an iterator iterating over a certain row (const)
Definition: FixedMatrix.h:648
FixedMatrix & operator=(const FixedMatrixPart< otherT, DIM, Iterator > &r)
Assign matrix elements with sup-part of another matrix (compatible types)
Definition: FixedMatrix.h:292
ICLQt_API core::Img< T > norm(const core::Img< T > &image)
normalize an images range to [0,255]
#define ICLMath_API
Definition: CompatMacros.h:173
Definition: FixedMatrix.h:999
col_iterator col_begin(unsigned int col)
returns an iterator iterating over a certain column
Definition: FixedMatrix.h:630
FixedMatrixPart< T, WIDTH *HEIGHT, MatrixSubRectIterator< T > > part()
extracts a rectangular matrix sub region
Definition: FixedMatrix.h:792
FixedMatrix operator-(const T &t) const
Substract a scalar from each element.
Definition: FixedMatrix.h:352
FixedMatrixPart(Iterator begin, Iterator end)
Creates a new FixedMatrixPart instance with given Iterator Pair.
Definition: FixedMatrix.h:102
Fixed C++-array wrapper class for data handling.
Definition: FixedArray.h:45
const_iterator end() const
returns an iterator after the last element (const)
Definition: FixedMatrix.h:627
void svd(FixedMatrix< T, COLS, ROWS > &U, FixedMatrix< T, 1, COLS > &s, FixedMatrix< T, COLS, COLS > &V) const
computes Singular Value Decomposition of this Matrix A = U diag(s) V'
Definition: FixedMatrix.h:896
Definition: FixedMatrix.h:1001
FixedMatrix operator+(const FixedMatrix &m) const
Element-wise matrix addition.
Definition: FixedMatrix.h:365
iterator begin()
returns an iterator to first element iterating over each element (row-major order)
Definition: FixedMatrix.h:618
D clipped_cast(S src)
utility cast function wrapping the standard lib's numerical_limits template
Definition: ClippedCast.h:57
FixedMatrixPart< T, COLS, const_row_iterator > row(unsigned int idx) const
returns a matrix row-reference iterator pair (const)
Definition: FixedMatrix.h:776
Highly flexible and optimized matrix class implementation.
Definition: DynMatrix.h:81
Definition: FixedMatrix.h:1002
T element_wise_inner_product(const FixedMatrix< T, OTHER_COLS, DIM/OTHER_COLS > &other) const
inner product of data pointers (not matrix-mulitiplication)
Definition: FixedMatrix.h:740
Iterator begin
Start iterator.
Definition: FixedMatrix.h:96
FixedMatrixPart< T, COLS, row_iterator > row(unsigned int idx)
returns a matrix row-reference iterator pair
Definition: FixedMatrix.h:771
static unsigned int cols()
compatibility-function returns template parameter COLS
Definition: FixedMatrix.h:450
Definition: FixedMatrix.h:1001
Definition: FixedMatrix.h:1001
T * p
wrapped data pointer (held shallowly)
Definition: FixedMatrix.h:468
DynMatrix< T > operator,(const DynMatrix< T > &left, const DynMatrix< T > &right)
vertical concatenation of matrices
Definition: DynMatrix.h:1270
const col_iterator operator+(difference_type n) const
jump next n elements (const)
Definition: FixedMatrix.h:559
FixedMatrix & operator=(const FixedMatrix< otherT, COLS, ROWS > &other)
Assignment operator (with compatible data type) (deep copy)
Definition: FixedMatrix.h:270
ICLMath_IMP std::ostream & operator<<(std::ostream &s, const DynMatrix< T > &m)
ostream operator implemented for uchar, short, int, float and double matrices
FixedMatrix< T, 1, ROWS > diag() const
returns a vector of the diagonal elements (only for squared matrices)
Definition: FixedMatrix.h:871
FixedMatrix(const FixedMatrixPart< T, DIM, Iterator > &r)
Create matrix of a sub-part of another matrix (identical types)
Definition: FixedMatrix.h:249
Utility struct for FixedMatrix sub-parts.
Definition: FixedMatrix.h:92
Definition: FixedMatrix.h:1001
const FixedMatrixPart< T, WIDTH *HEIGHT, MatrixSubRectIterator< T > > part() const
extracts a rectangular matrix sub region (const)
Definition: FixedMatrix.h:800
static const unsigned int DIM
count of matrix elements (COLS x ROWS)
Definition: FixedMatrix.h:189
FixedMatrixPart< T, ROWS, const_col_iterator > col(unsigned int idx) const
returns a matrix col-reference iterator pair (const)
Definition: FixedMatrix.h:786
FixedMatrix< T, COLS, ROWS > normalized(T norm=2) const
create a normalized version of this matrix
Definition: FixedMatrix.h:850
col_iterator & operator-=(difference_type n)
jump backward next n elements (inplace)
Definition: FixedMatrix.h:539
Definition: FixedMatrix.h:999
const col_iterator operator--(int) const
postfix decrement operator (const)
Definition: FixedMatrix.h:519
static const MatrixSubRectIterator< Type > create_end_iterator(const Type *dataOrigin, int matrixWidth, int subRectX, int subRectY, int subRectWidth, int subRectHeight)
Definition: MatrixSubRectIterator.h:83
const DynMatrix< T > dyn() const
creates a shallow copied DynMatrix instance wrapping this' data (const)
Definition: FixedMatrix.h:180
DynMatrix< T > operator%(const DynMatrix< T > &top, const DynMatrix< T > &bottom)
horizontal concatenation of matrices
Definition: DynMatrix.h:1286
FixedMatrix< T, NEW_WIDTH, NEW_HEIGHT > resize(const T &init=T(0)) const
extends/shrinks matrix dimensions while preserving content on remaining elements (without scaling)
Definition: FixedMatrix.h:811
bool operator==(const col_iterator &i) const
comparison operator ==
Definition: FixedMatrix.h:595
const_row_iterator row_end(unsigned int row) const
row end iterator (const)
Definition: FixedMatrix.h:651
Special linear algebra exception type .
Definition: DynMatrix.h:66
FixedMatrix(const FixedMatrix &other)
Definition: FixedMatrix.h:236
FixedMatrix & operator=(const FixedMatrix &other)
Assignment operator (with compatible data type) (deep copy)
Definition: FixedMatrix.h:260
T trace() const
computes the sum of all diagonal elements
Definition: FixedMatrix.h:761
T * data()
return internal data pointer
Definition: FixedMatrix.h:453
Special linear algebra exception type .
Definition: DynMatrix.h:56
FixedMatrix operator-() const
Prefix - operator.
Definition: FixedMatrix.h:392
ICLMath_API const AXES AXES_DEFAULT
col_iterator & operator++()
prefix increment operator
Definition: FixedMatrix.h:477
void decompose_RQ(FixedMatrix< T, ROWS, ROWS > &R, FixedMatrix< T, ROWS, ROWS > &Q) const
computes the RQ decomposition of a matrix
Definition: FixedMatrix.h:889
FixedMatrix operator/(T f) const
Divide all elements by a scalar.
Definition: FixedMatrix.h:325
const col_iterator & operator++() const
prefix increment operator (const)
Definition: FixedMatrix.h:482
FixedMatrix< T, V_COLS, M_ROWS_AND_COLS > & operator *=(FixedMatrix< T, V_COLS, M_ROWS_AND_COLS > &v, const FixedMatrix< T, M_ROWS_AND_COLS, M_ROWS_AND_COLS > &m)
Matrix multiplication (inplace)
Definition: FixedMatrix.h:959
Definition: FixedMatrix.h:1000
FixedMatrix operator-(const FixedMatrix &m) const
Element-wise matrix subtraction.
Definition: FixedMatrix.h:378
Definition: FixedMatrix.h:1000
Iterator class used to iterate through a sub rect of 2D data.
Definition: MatrixSubRectIterator.h:70
#define ICLASSERT_RETURN_VAL(X, VALUE)
Definition: Macros.h:148
ICLQt_API void fill(float r, float g=-1, float b=-1, float alpha=255)
sets the current fill color to given r,g,b,alpha value
FixedMatrix & operator=(const FixedMatrixPart< T, DIM, Iterator > &r)
Assign matrix elements with sup-part of another matrix (identical types)
Definition: FixedMatrix.h:284
double cond(const double p=2) const
computes the condition of a fixed matrix
Definition: FixedMatrix.h:755
FixedMatrix(OtherIterator begin, OtherIterator end)
Range based constructor for STL compatiblitiy.
Definition: FixedMatrix.h:230
internal struct for row-wise iteration with stride=COLS
Definition: FixedMatrix.h:462
const T * data() const
return internal data pointer (const)
Definition: FixedMatrix.h:456
const col_iterator operator-(difference_type n) const
jump backward next n elements (const)
Definition: FixedMatrix.h:573
const_col_iterator col_begin(unsigned int col) const
returns an iterator iterating over a certain column (const)
Definition: FixedMatrix.h:636
const col_iterator & operator+=(difference_type n) const
jump next n elements (inplace) (const)
Definition: FixedMatrix.h:532
FixedMatrix inv() const
invert the matrix (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f)
Definition: FixedMatrix.h:715
col_iterator operator-(difference_type n)
jump backward next n elements
Definition: FixedMatrix.h:566
FixedMatrix & operator=(const T &t)
Assign all elements with given value.
Definition: FixedMatrix.h:277
static FixedMatrix< T, ROWS, COLS > id()
create identity matrix
Definition: FixedMatrix.h:826
T & at(unsigned int col, unsigned int row)
Element access index save (with exception if index is invalid)
Definition: FixedMatrix.h:410
void normalize(T norm=2)
inplace normalization
Definition: FixedMatrix.h:844
Definition: FixedMatrix.h:1001
double length(T norm=2) const
Calculates the length of the matrix data vector.
Definition: FixedMatrix.h:835
FixedMatrix operator+(const T &t) const
Add a scalar to each element.
Definition: FixedMatrix.h:338
AXES
axes order specifications for euler angles
Definition: FixedMatrix.h:999
const T * const_iterator
const iterator type
Definition: FixedMatrix.h:438
ICLMath_IMP std::istream & operator>>(std::istream &s, DynMatrix< T > &m)
istream operator implemented for uchar, short, int, float and double matrices
T & operator[](unsigned int idx)
linear data view element access
Definition: FixedMatrix.h:423
Definition: FixedMatrix.h:1001
Definition: FixedMatrix.h:1000
FixedMatrix()
Default constructor.
Definition: FixedMatrix.h:195
FixedMatrix(const T *srcdata)
Create matrix with given data pointer (const version)
Definition: FixedMatrix.h:207
bool operator<(const col_iterator &i) const
comparison operator <
Definition: FixedMatrix.h:601
bool operator>(const col_iterator &i) const
comparison operator >
Definition: FixedMatrix.h:610
void mult(const FixedMatrix< T, MCOLS, COLS > &m, FixedMatrix< T, MCOLS, ROWS > &dst) const
inplace matrix multiplication (dst = (*this)*m)
Definition: FixedMatrix.h:667
iterator end()
returns an iterator after the last element
Definition: FixedMatrix.h:621
col_iterator & operator--()
prefix decrement operator
Definition: FixedMatrix.h:500
row_iterator row_end(unsigned int row)
row end iterator
Definition: FixedMatrix.h:645
T & operator()(unsigned int col, unsigned int row)
Element access operator.
Definition: FixedMatrix.h:400
FixedMatrix operator *(T f) const
Multiply all elements by a scalar.
Definition: FixedMatrix.h:312
T & operator *()
Dereference operator.
Definition: FixedMatrix.h:585
row_iterator row_begin(unsigned int row)
returns an iterator iterating over a certain row
Definition: FixedMatrix.h:642
static const unsigned int STRIDE
the stride is equal to parent Matrix' classes COLS template parameter
Definition: FixedMatrix.h:471
FixedMatrix operator/(const FixedMatrix &m) const
Matrix devision.
Definition: FixedMatrix.h:302
col_iterator operator+(difference_type n)
jump next n elements
Definition: FixedMatrix.h:552
const col_iterator & operator--() const
prefix decrement operator (const)
Definition: FixedMatrix.h:506
FixedMatrixPart & operator=(const T &value)
Assignment with a new value (all data in range will be assigned with that value)
Definition: FixedMatrix.h:105
FixedMatrixPart & operator=(const FixedMatrixPart &other)
Assignment with another (identical) instance of FixedMatrixPart.
Definition: FixedMatrix.h:111
Iterator end
End iterator.
Definition: FixedMatrix.h:99
FixedMatrix & operator+=(const T &t)
Add a scalar to each element (inplace)
Definition: FixedMatrix.h:345
FixedMatrix & operator+=(const FixedMatrix &m)
Element-wise matrix addition (inplace)
Definition: FixedMatrix.h:372
T det() const
calculate matrix determinant (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f)
Definition: FixedMatrix.h:723
FixedMatrix< T, ROWS, COLS > transp() const
returns matrix's transposed
Definition: FixedMatrix.h:728
bool operator<=(const col_iterator &i) const
comparison operator <=
Definition: FixedMatrix.h:604
FixedMatrix & operator-=(const T &t)
Substract a scalar from each element (inplace)
Definition: FixedMatrix.h:359
const col_iterator operator++(int) const
postfix increment operator (const)
Definition: FixedMatrix.h:493
static unsigned int rows()
compatibility-function returns template parameter ROWS
Definition: FixedMatrix.h:447
T cond(const double p=2) const
computes the condition of a matrix
Definition: DynMatrix.h:1069
Definition: FixedMatrix.h:1002
col_iterator operator--(int)
postfix decrement operator
Definition: FixedMatrix.h:512
#define ICLMath_IMP
Definition: CompatMacros.h:172
const_iterator begin() const
returns an iterator to first element iterating over each element (row-major order) (const)
Definition: FixedMatrix.h:624
FixedMatrix< T, ROWS, COLS > pinv(bool useSVD=0, float zeroThreshold=0.00000000000000001) const
Computes the Matrix's pseudo-inverse.
Definition: FixedMatrix.h:903
void eigen(FixedMatrix &eigenvectors, FixedMatrix< T, 1, COLS > &eigenvalues) const
Extracts the matrix's eigenvalues and eigenvectors.
Definition: FixedMatrix.h:921
bool operator>=(const col_iterator &i) const
comparison operator >=
Definition: FixedMatrix.h:607
const T & operator[](unsigned int idx) const
linear data view element access (const)
Definition: FixedMatrix.h:429
col_iterator operator++(int)
postfix increment operator
Definition: FixedMatrix.h:487
T * row_iterator
row_iterator
Definition: FixedMatrix.h:441
T * iterator
iterator type
Definition: FixedMatrix.h:435
FixedMatrix & operator/=(const FixedMatrix &m)
Matrix devision (inplace)
Definition: FixedMatrix.h:307
FixedMatrix< T, OTHER_COLS, COLS > dot(const FixedMatrix< T, OTHER_COLS, ROWS > &M) const
returns the inner product of two matrices (i.e. dot-product)
Definition: FixedMatrix.h:750
static unsigned int dim()
return static member variable DIM (COLS*ROWS)
Definition: FixedMatrix.h:459
OPTIMIZED_MATRIX_MULTIPLICATION(2, 2, 2, float, 32f)
const_col_iterator col_end(unsigned int col) const
row end iterator const
Definition: FixedMatrix.h:639
bool operator==(const FixedMatrix< otherT, COLS, ROWS > &m) const
Element-wise comparison with other matrix.
Definition: FixedMatrix.h:857
ICLMath_IMP FixedMatrix< T, 3, 3 > create_hom_3x3(T angle, T dx=0, T dy=0, T v0=0, T v1=0)
creates a 2D homogen matrix (defined for float and double)
void copy(const T *src, const T *srcEnd, T *dst)
moves data from source to destination array (no casting possible)
Definition: CoreFunctions.h:216
void decompose_QR(FixedMatrix< T, COLS, ROWS > &Q, FixedMatrix< T, COLS, COLS > &R) const
computes the QR decomposition of a matrix
Definition: FixedMatrix.h:882
bool operator!=(const col_iterator &i) const
comparison operator !=
Definition: FixedMatrix.h:598
FixedMatrix & operator-=(const FixedMatrix &m)
Element-wise matrix subtraction (inplace)
Definition: FixedMatrix.h:384
FixedMatrix(const FixedMatrix< otherT, COLS, ROWS > &other)
Definition: FixedMatrix.h:243
static void optimized_copy(SrcIterator srcBegin, SrcIterator srcEnd, DstIterator dstBegin)
Optimized copy function template (for N>30 using std::copy, otherwise a simple loop is used)
Definition: FixedMatrix.h:59
Definition: FixedMatrix.h:1000
Definition: FixedMatrix.h:999
Definition: FixedMatrix.h:1000
FixedMatrix(const T &v0, const T &v1, const T &v2=0, const T &v3=0, const T &v4=0, const T &v5=0, const T &v6=0, const T &v7=0, const T &v8=0, const T &v9=0, const T &v10=0, const T &v11=0, const T &v12=0, const T &v13=0, const T &v14=0, const T &v15=0)
Create matrix with given initializer elements (16 values max)
Definition: FixedMatrix.h:216
FixedMatrix & operator *=(T f)
moved outside the class Multiply all elements by a scalar (inplace)
Definition: FixedMatrix.h:319
DynMatrix< T > dyn()
creates a shallow copied DynMatrix instance wrapping this' data
Definition: FixedMatrix.h:177
ICLMath_IMP FixedMatrix< T, 4, 4 > create_hom_4x4(T rx, T ry, T rz, T dx=0, T dy=0, T dz=0, T v0=0, T v1=0, T v2=0, AXES axes=AXES_DEFAULT)
creates a 3D homogeneous matrix (defined for float and double)
Definition: FixedMatrix.h:999
FixedMatrix base struct defining datamode enum.
Definition: FixedMatrix.h:56
col_iterator col_end(unsigned int col)
row end iterator
Definition: FixedMatrix.h:633
Definition: FixedMatrix.h:999
Definition: FixedMatrix.h:1002
Definition: FixedMatrix.h:1002
col_iterator(T *col_begin)
Constructor.
Definition: FixedMatrix.h:474
FixedMatrix< T, 4, 4 > create_hom_4x4_trans(T dx, T dy, T dz)
creates 4D homogeneous matrix with translation part only (defined for float and double)
Definition: FixedMatrix.h:1026
ICLMath_IMP FixedMatrix< T, 3, 3 > create_rot_3D(T axisX, T axisY, T axisZ, T angle)
create 3D rotation matrix from rotation axis and angle (defined for float and double only)
FixedMatrix(const T &initValue)
Create Matrix and initialize elements with given value.
Definition: FixedMatrix.h:198