Skip to content
Snippets Groups Projects
Commit 6f475e50 authored by Jose Borreguero's avatar Jose Borreguero
Browse files

Refs #5383 Added check to compare real and imaginary sizes

modified: FFT.cpp
parent 60e8faf7
No related branches found
No related tags found
No related merge requests found
...@@ -181,8 +181,13 @@ void FFT::exec() ...@@ -181,8 +181,13 @@ void FFT::exec()
const int ySize = static_cast<int>(inWS->blocksize()); const int ySize = static_cast<int>(inWS->blocksize());
const int xSize = static_cast<int>(X.size()); const int xSize = static_cast<int>(X.size());
if (iReal >= ySize) throw std::invalid_argument("Property Real is out of range"); if(iReal >= ySize) throw std::invalid_argument("Property Real is out of range");
if (isComplex && iImag >= ySize) throw std::invalid_argument("Property Imaginary is out of range"); if( isComplex )
{
const int yImagSize = static_cast<int>(inImagWS->blocksize());
if( ySize != yImagSize ) throw std::length_error("Real and Imaginary sizes do not match");
if( iImag >= ySize ) throw std::invalid_argument("Property Imaginary is out of range");
}
//Check that the x values are evenly spaced //Check that the x values are evenly spaced
const double dx = (X.back() - X.front()) / (static_cast<int>(X.size()) - 1); const double dx = (X.back() - X.front()) / (static_cast<int>(X.size()) - 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment