36 out <<
re(
c) <<
" r " <<
im(
c) <<
" i";
43 in >>
re(
c) >> dummy >>
im(
c) >> dummy;
69template <
typename Tmplt>
76template <
typename Tmplt>
81template <
typename Tmplt>
85 for(
size_t i=0; i<size; i++)
operator()(i+1) = value;
92 if(_vector !=
nullptr) gsl_vector_free((gsl_vector*)_vector);
93 _vector = gsl_vector_alloc(size);
99 if(_vector !=
nullptr) gsl_vector_complex_free((gsl_vector_complex*)_vector);
100 _vector = gsl_vector_complex_alloc(size);
103template <
class Tmplt>
106 build_vector(data_end - data_begin);
107 for(
size_t i=0; i<num_row(); i++)
operator()(i+1) = data_begin[i];
111template <
class Tmplt>
113{
if(_vector !=
nullptr)
return ((gsl_vector*)_vector)->size;
else return 0;}
119{
return *gsl_vector_ptr( (gsl_vector*)_vector, i-1);}
122{
return *gsl_vector_complex_ptr((gsl_vector_complex*)_vector, i-1);}
125{
return *gsl_vector_ptr( (gsl_vector*)_vector, i-1);}
128{
return *gsl_vector_complex_ptr((gsl_vector_complex*)_vector, i-1);}
131template <
class Tmplt>
135 for(
size_t i=1; i<=num_row(); i++)
136 mat(1, i) = this->operator()(i);
146 for(
size_t i=0; i<c1.
num_row(); i++)
147 if(c1(i+1) != c2(i+1))
return false;
156 if (&mv ==
this)
return *
this;
158 if(!mv.
_vector) { _vector =
nullptr;
return *
this; }
159 _vector = gsl_vector_alloc( mv.
num_row() );
160 gsl_vector_memcpy((gsl_vector*)_vector, (
const gsl_vector*)mv.
_vector);
167 if (&mv ==
this)
return *
this;
169 if(!mv.
_vector) { _vector =
nullptr;
return *
this; }
170 _vector = gsl_vector_complex_alloc( mv.
num_row() );
171 gsl_vector_complex_memcpy((gsl_vector_complex*)_vector, (
const gsl_vector_complex*)mv.
_vector);
178 for(
size_t i=0; i<v.
num_row(); i++) out <<
" " << v(i+1) <<
"\n";
187 for(
size_t i=1; i<=v.
num_row(); i++) in >> v(i);
191template <
class Tmplt>
195 for(
size_t i=n1; i<=n2; i++) temp(i-n1+1) = operator()(i);
216 for(
size_t i=1; i<=
c.num_row(); i++) d(i) =
re(
c(i) );
223 for(
size_t i=1; i<=
c.num_row(); i++) d(i) =
im(
c(i) );
FLieGenerator< T, N > real(const FLieGenerator< std::complex< T >, N > &)
Take real part of a complex generator.
m_complex m_complex_build(double r, double i)
bool operator==(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
MMatrix< m_complex > complex(MMatrix< double > real)
template std::istream & operator>>(std::istream &in, MMatrix< double > &mat)
MMatrix< double > re(MMatrix< m_complex > mc)
std::ostream & operator<<(std::ostream &out, const Mesh::Iterator &it)
MMatrix< double > im(MMatrix< m_complex > mc)
constexpr double c
The velocity of light in m/s.
MMatrix< Tmplt > T() const
MVector< Tmplt > & operator=(const MVector< Tmplt > &mv)
MVector< Tmplt > sub(size_t n1, size_t n2) const
void build_vector(size_t size)
Tmplt & operator()(size_t i)