Thomas Tsou | 20eb6d6 | 2013-11-09 14:30:41 -0500 | [diff] [blame] | 1 | #include "signalVector.h" |
| 2 | |
| 3 | signalVector::signalVector(size_t size) |
| 4 | : Vector<complex>(size), |
| 5 | real(false), aligned(false), symmetry(NONE) |
| 6 | { |
| 7 | } |
| 8 | |
| 9 | signalVector::signalVector(size_t size, size_t start) |
| 10 | : Vector<complex>(size + start), |
| 11 | real(false), aligned(false), symmetry(NONE) |
| 12 | { |
| 13 | mStart = mData + start; |
| 14 | } |
| 15 | |
| 16 | signalVector::signalVector(complex *data, size_t start, size_t span) |
| 17 | : Vector<complex>(NULL, data + start, data + start + span), |
| 18 | real(false), aligned(false), symmetry(NONE) |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | signalVector::signalVector(const signalVector &vector) |
| 23 | : Vector<complex>(vector.size() + vector.getStart()), aligned(false) |
| 24 | { |
| 25 | mStart = mData + vector.getStart(); |
| 26 | vector.copyTo(*this); |
| 27 | symmetry = vector.getSymmetry(); |
| 28 | real = vector.isReal(); |
| 29 | }; |
| 30 | |
| 31 | signalVector::signalVector(const signalVector &vector, |
| 32 | size_t start, size_t tail) |
| 33 | : Vector<complex>(start + vector.size() + tail), aligned(false) |
| 34 | { |
| 35 | mStart = mData + start; |
| 36 | vector.copyTo(*this); |
| 37 | symmetry = vector.getSymmetry(); |
| 38 | real = vector.isReal(); |
| 39 | }; |
| 40 | |
| 41 | void signalVector::operator=(const signalVector& vector) |
| 42 | { |
| 43 | resize(vector.size() + vector.getStart()); |
| 44 | memcpy(mData, vector.mData, bytes()); |
| 45 | mStart = mData + vector.getStart(); |
| 46 | } |
| 47 | |
| 48 | size_t signalVector::getStart() const |
| 49 | { |
| 50 | return mStart - mData; |
| 51 | } |
| 52 | |
| 53 | Symmetry signalVector::getSymmetry() const |
| 54 | { |
| 55 | return symmetry; |
| 56 | } |
| 57 | |
| 58 | void signalVector::setSymmetry(Symmetry symmetry) |
| 59 | { |
| 60 | this->symmetry = symmetry; |
| 61 | } |
| 62 | |
| 63 | bool signalVector::isReal() const |
| 64 | { |
| 65 | return real; |
| 66 | } |
| 67 | |
| 68 | void signalVector::isReal(bool wOnly) |
| 69 | { |
| 70 | real = wOnly; |
| 71 | } |
| 72 | |
| 73 | bool signalVector::isAligned() const |
| 74 | { |
| 75 | return aligned; |
| 76 | } |
| 77 | |
| 78 | void signalVector::setAligned(bool aligned) |
| 79 | { |
| 80 | this->aligned = aligned; |
| 81 | } |