File indexing completed on 2026-06-02 08:48:23
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef VECTORCOMPLEXD_H_
0009 #define VECTORCOMPLEXD_H_
0010
0011 #include <complex>
0012 #include <vector>
0013
0014 namespace NumA {
0015
0016
0017
0018
0019
0020
0021
0022
0023 class VectorComplexD {
0024
0025 public:
0026
0027
0028
0029
0030 VectorComplexD();
0031
0032
0033
0034
0035
0036
0037 VectorComplexD(const unsigned int n);
0038
0039
0040
0041
0042
0043 VectorComplexD(const VectorComplexD& v);
0044
0045
0046
0047
0048 virtual ~VectorComplexD();
0049
0050
0051
0052
0053
0054 double Mag() const;
0055
0056
0057
0058
0059
0060 VectorComplexD Conjunct() const;
0061
0062
0063
0064
0065
0066
0067 std::complex<double> Dot(const VectorComplexD& v) const;
0068
0069
0070
0071
0072 void Clear();
0073
0074
0075
0076
0077 void operator=(const VectorComplexD& rhs);
0078
0079
0080
0081
0082 VectorComplexD operator+(const VectorComplexD& rhs);
0083
0084
0085
0086
0087 VectorComplexD operator-(const VectorComplexD& rhs);
0088
0089
0090
0091
0092 VectorComplexD operator*(const double& rhs);
0093
0094
0095
0096
0097 friend VectorComplexD operator*(const double& lhs, VectorComplexD& rhs);
0098
0099
0100
0101
0102 VectorComplexD operator*(const std::complex<double>& rhs);
0103
0104
0105
0106
0107 friend VectorComplexD operator*(const std::complex<double>& lhs,
0108 VectorComplexD& rhs);
0109
0110
0111
0112
0113 unsigned int GetNElements() const;
0114
0115
0116
0117
0118
0119
0120 void SetElement(const unsigned int i, const std::complex<double>& value);
0121
0122
0123
0124
0125
0126 std::complex<double> GetElement(unsigned int i) const;
0127
0128 private:
0129
0130
0131
0132
0133
0134 void CompareNElements(const VectorComplexD& v) const;
0135
0136
0137
0138
0139 unsigned int m_n;
0140
0141
0142
0143
0144 std::vector<std::complex<double> > m_elements;
0145 };
0146
0147 }
0148
0149 #endif