do not use Lapack anymore

This commit is contained in:
Vadim Pisarevsky
2011-04-25 21:44:22 +00:00
parent 8a54967e0b
commit 9ac3a35175
4 changed files with 962 additions and 919 deletions

View File

@@ -427,25 +427,25 @@ inline size_t Mat::total() const
inline uchar* Mat::ptr(int y)
{
CV_DbgAssert( data && dims >= 1 && (unsigned)y < (unsigned)size.p[0] );
CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );
return data + step.p[0]*y;
}
inline const uchar* Mat::ptr(int y) const
{
CV_DbgAssert( data && dims >= 1 && (unsigned)y < (unsigned)size.p[0] );
CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );
return data + step.p[0]*y;
}
template<typename _Tp> inline _Tp* Mat::ptr(int y)
{
CV_DbgAssert( data && dims >= 1 && (unsigned)y < (unsigned)size.p[0] );
CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );
return (_Tp*)(data + step.p[0]*y);
}
template<typename _Tp> inline const _Tp* Mat::ptr(int y) const
{
CV_DbgAssert( dims >= 1 && data && (unsigned)y < (unsigned)size.p[0] );
CV_DbgAssert( y == 0 || (data && dims >= 1 && data && (unsigned)y < (unsigned)size.p[0]) );
return (const _Tp*)(data + step.p[0]*y);
}

View File

@@ -683,10 +683,10 @@ Matx<_Tp, m, n> Matx<_Tp, m, n>::mul(const Matx<_Tp, m, n>& a) const
}
CV_EXPORTS int LU(float* A, int m, float* b, int n);
CV_EXPORTS int LU(double* A, int m, double* b, int n);
CV_EXPORTS bool Cholesky(float* A, int m, float* b, int n);
CV_EXPORTS bool Cholesky(double* A, int m, double* b, int n);
CV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n);
CV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n);
CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n);
CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n);
template<typename _Tp, int m> struct CV_EXPORTS Matx_DetOp
@@ -694,7 +694,7 @@ template<typename _Tp, int m> struct CV_EXPORTS Matx_DetOp
double operator ()(const Matx<_Tp, m, m>& a) const
{
Matx<_Tp, m, m> temp = a;
double p = LU(temp.val, m, 0, 0);
double p = LU(temp.val, m, m, 0, 0, 0);
if( p == 0 )
return p;
for( int i = 0; i < m; i++ )
@@ -767,9 +767,9 @@ template<typename _Tp, int m> struct CV_EXPORTS Matx_FastInvOp
b(i, i) = (_Tp)1;
if( method == DECOMP_CHOLESKY )
return Cholesky(temp.val, m, b.val, m);
return Cholesky(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m);
return LU(temp.val, m, b.val, m) != 0;
return LU(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m) != 0;
}
};
@@ -839,9 +839,9 @@ template<typename _Tp, int m, int n> struct CV_EXPORTS Matx_FastSolveOp
Matx<_Tp, m, m> temp = a;
x = b;
if( method == DECOMP_CHOLESKY )
return Cholesky(temp.val, m, x.val, n);
return Cholesky(temp.val, m*sizeof(_Tp), m, x.val, n*sizeof(_Tp), n);
return LU(temp.val, m, x.val, n) != 0;
return LU(temp.val, m*sizeof(_Tp), m, x.val, n*sizeof(_Tp), n) != 0;
}
};