◆ ComplexArray() [1/6]
mspass::algorithms::deconvolution::ComplexArray::ComplexArray |
( |
| ) |
|
◆ ComplexArray() [2/6]
mspass::algorithms::deconvolution::ComplexArray::ComplexArray |
( |
std::vector< Complex64 > & |
d | ) |
|
Construct from stl vector container of complex.
◆ ComplexArray() [3/6]
mspass::algorithms::deconvolution::ComplexArray::ComplexArray |
( |
std::vector< Complex32 > & |
d | ) |
|
Similar for 32 bit version
◆ ComplexArray() [4/6]
mspass::algorithms::deconvolution::ComplexArray::ComplexArray |
( |
int |
nsamp, |
|
|
FortranComplex32 * |
d |
|
) |
| |
Construct from a FORTRAN data array.
Fortran stores complex numbers in a mulitplexed array structure (real(1), imag(1), real(2), imag(2), etc.). The constructors below provide a mechanism for building this object from various permutations of this.
- Parameters
-
nsamp | is the number of elements in the C vector |
d | is the pointer to the first compoment of the fortran vector. |
37 data=
new FortranComplex64[nsamp];
38 for(
int i=0; i<nsamp; i++)
40 data[i].real=d[i].real;
41 data[i].imag=d[i].imag;
◆ ComplexArray() [5/6]
template<class T >
mspass::algorithms::deconvolution::ComplexArray::ComplexArray |
( |
int |
nsamp, |
|
|
std::vector< T > |
d |
|
) |
| |
Construct from different length of vector, adds zoeros to it And construct a constant arrays
179 data=
new FortranComplex64[nsamp];
180 for(
int i=0; i<d.size(); i++)
185 for(
int i=d.size(); i<nsamp; i++)
193 data=
new FortranComplex64[nsamp];
194 for(
int i=0; i<nsamp; i++)
◆ ComplexArray() [6/6]
mspass::algorithms::deconvolution::ComplexArray::ComplexArray |
( |
std::vector< double > |
mag, |
|
|
std::vector< double > |
phase |
|
) |
| |
Construct from magnitude and phase arrays.
◆ conj()
void mspass::algorithms::deconvolution::ComplexArray::conj |
( |
| ) |
|
product of complex and real vectors
product of complex and a number
Change vector to complex conjugates.
275 for(
int i=0; i<nsamp; i++)
276 data[i].imag=-data[i].imag;
◆ FortranData()
template<class T >
T * mspass::algorithms::deconvolution::ComplexArray::FortranData |
Return a pointer to a fortran array containing the data vector.
The array linked to the returned pointer should be created with the new operator and the caller should be sure to use delete [] to free this memory when finished.
168 T* result=
new T[nsamp];
169 for(
int i=0; i<nsamp; i++)
◆ operator[]()
Complex64 mspass::algorithms::deconvolution::ComplexArray::operator[] |
( |
int |
sample | ) |
|
Index operator. Cannot make it work by getting the address from reference. Have to call the ptr() function to get the address.
- Parameters
-
sample | is the sample number to return. |
- Returns
- contents of vector at position sample.
144 return *
reinterpret_cast<Complex64*
>(&data[sample].real);
The documentation for this class was generated from the following files:
- /home/runner/work/mspass/mspass/cxx/include/mspass/algorithms/deconvolution/ComplexArray.h
- /home/runner/work/mspass/mspass/cxx/src/lib/algorithms/deconvolution/ComplexArray.cc