-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscalar.cpp
More file actions
53 lines (47 loc) · 854 Bytes
/
Copy pathscalar.cpp
File metadata and controls
53 lines (47 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "scalar.hpp"
scalar::scalar(std::complex<double> k,signal *x)
{
setK(k);
setX(x);
}
scalar::scalar(scalar &toCopy) noexcept : k{toCopy.getK()}, x{toCopy.getX()}
{
}
scalar& scalar::operator=(scalar &toCopy) noexcept
{
setK(toCopy.getK());
setX(toCopy.getX());
return *this;
}
scalar::scalar(scalar &&toMove) noexcept :k{std::move(toMove.getK())}, x{std::move(toMove.getX())}
{
}
scalar& scalar::operator=(scalar &&toMove) noexcept
{
setK(std::move(toMove.getK()));
setX(std::move(toMove.getX()));
return *this;
}
scalar::~scalar()
{
}
std::complex<double> scalar::get(long long int n)
{
return getK()*x->get(n);
}
const std::complex<double>& scalar::getK() const
{
return k;
}
void scalar::setK(const std::complex<double> &k)
{
this->k = k;
}
signal* scalar::getX()
{
return x;
}
void scalar::setX(signal *x)
{
this->x = x;
}