This commit is contained in:
2020-10-19 15:18:16 +03:00
parent 2794d866fd
commit e0d46463ae
8 changed files with 60 additions and 121 deletions

View File

@@ -177,17 +177,13 @@ void PIFFT_double::ftbasegeneratecomplexfftplan(uint n, ftplan * plan) {
curplan.plan.resize(planarraysize);
int ftbase_ftbasecffttask = 0;
ftbase_ftbasegenerateplanrec(n, ftbase_ftbasecffttask, plan, &plansize, &precomputedsize, &planarraysize, &tmpmemsize, &stackmemsize, stackptr);
if (stackptr != 0) {
return;//ae_assert(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan: stack ptr!");
}
assert(stackptr==0);
curplan.stackbuf.resize(piMax<int>(stackmemsize, 1)); //ae_vector_set_length(&curplan.stackbuf, ae_maxint(stackmemsize, 1));
curplan.tmpbuf.resize(piMax<int>(tmpmemsize, 1)); //ae_vector_set_length(&(curplan.tmpbuf), ae_maxint(tmpmemsize, 1));
curplan.precomputed.resize(piMax<int>(precomputedsize, 1)); //ae_vector_set_length(&curplan.precomputed, ae_maxint(precomputedsize, 1));
stackptr = 0;
ftbase_ftbaseprecomputeplanrec(plan, 0, stackptr);
if (stackptr != 0) {
return;//ae_assert(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan: stack ptr!");
}
assert(stackptr==0);
}
@@ -1117,17 +1113,13 @@ void PIFFT_float::ftbasegeneratecomplexfftplan(uint n, ftplan * plan) {
curplan.plan.resize(planarraysize);
int ftbase_ftbasecffttask = 0;
ftbase_ftbasegenerateplanrec(n, ftbase_ftbasecffttask, plan, &plansize, &precomputedsize, &planarraysize, &tmpmemsize, &stackmemsize, stackptr);
if (stackptr != 0) {
return;//ae_assert(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan: stack ptr!");
}
assertm(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan");
curplan.stackbuf.resize(piMax<int>(stackmemsize, 1)); //ae_vector_set_length(&curplan.stackbuf, ae_maxint(stackmemsize, 1));
curplan.tmpbuf.resize(piMax<int>(tmpmemsize, 1)); //ae_vector_set_length(&(curplan.tmpbuf), ae_maxint(tmpmemsize, 1));
curplan.precomputed.resize(piMax<int>(precomputedsize, 1)); //ae_vector_set_length(&curplan.precomputed, ae_maxint(precomputedsize, 1));
stackptr = 0;
ftbase_ftbaseprecomputeplanrec(plan, 0, stackptr);
if (stackptr != 0) {
return;//ae_assert(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan: stack ptr!");
}
assertm(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan");
}

View File

@@ -890,6 +890,11 @@ public:
return tm;
}
static _CMatrix zero(const uint cols, const uint rows) {
_V2D::resize(rows, cols);
fill(Type(0));
}
/**
* @brief Creates a row matrix of every element that is equal to every element of the vector
*
@@ -1002,49 +1007,27 @@ public:
*/
bool isValid() const { return !PIVector2D<Type>::isEmpty(); }
/**
* @brief Matrix assignment to matrix "v"
*
* @param v matrix for the assigment
* @return matrix equal with v
*/
_CMatrix &operator=(const PIVector<PIVector<Type> > &v) {
*this = _CMatrix(v);
return *this;
}
/**
* @brief Compare with matrix "sm"
*
* @param sm matrix for the compare
* @return if matrices are equal true, else false
*/
bool operator==(const _CMatrix &sm) const {
PIMM_FOR_A(i) if (_V2D::mat[i] != sm.mat[i]) return false;
return true;
}
/**
* @brief Compare with matrix "sm"
*
* @param sm matrix for the compare
* @return if matrices are not equal true, else false
*/
bool operator!=(const _CMatrix &sm) const { return !(*this == sm); }
/**
* @brief Addition assignment with matrix "sm"
*
* @param sm matrix for the addition assigment
*/
void operator+=(const _CMatrix &sm) { PIMM_FOR_A(i) _V2D::mat[i] += sm.mat[i]; }
void operator+=(const _CMatrix &sm) {
assert(_V2D::rows() == sm.rows());
assert(_V2D::cols() == sm.cols());
PIMM_FOR_A(i) _V2D::mat[i] += sm.mat[i];
}
/**
* @brief Subtraction assignment with matrix "sm"
*
* @param sm matrix for the subtraction assigment
*/
void operator-=(const _CMatrix &sm) { PIMM_FOR_A(i) _V2D::mat[i] -= sm.mat[i]; }
void operator-=(const _CMatrix &sm) {
assert(_V2D::rows() == sm.rows());
assert(_V2D::cols() == sm.cols());
PIMM_FOR_A(i) _V2D::mat[i] -= sm.mat[i];
}
/**
* @brief Multiplication assignment with value "v"
@@ -1079,6 +1062,8 @@ public:
*/
_CMatrix operator+(const _CMatrix &sm) const {
_CMatrix tm(*this);
assert(tm.rows() == sm.rows());
assert(tm.cols() == sm.cols());
PIMM_FOR_A(i) tm.mat[i] += sm.mat[i];
return tm;
}
@@ -1091,6 +1076,8 @@ public:
*/
_CMatrix operator-(const _CMatrix &sm) const {
_CMatrix tm(*this);
assert(tm.rows() == sm.rows());
assert(tm.cols() == sm.cols());
PIMM_FOR_A(i) tm.mat[i] -= sm.mat[i];
return tm;
}