20 #ifndef SELDON_FILE_COMMON_INLINE_CXX
26 inline T conjugate(
const T& x)
32 inline complex<T> conjugate(
const complex<T>& x)
38 inline T realpart(
const T& x)
44 inline T realpart(
const complex<T>& x)
54 inline void PrintArray(T* v,
int lgth)
56 for (
int k = 0; k < lgth - 1; k++)
57 std::cout << v[k] <<
" | ";
58 std::cout << v[lgth - 1] << std::endl;
80 inline Str::operator std::string()
const
108 output << s_input << input;
137 inline std::string
to_str(
const T& input)
139 std::ostringstream output;
140 output.precision(cout.precision());
152 inline void to_num(std::string s, T& num)
154 std::istringstream str(s);
165 inline T to_num(std::string s)
168 std::istringstream str(s);
179 inline void SetComplexZero(T& number)
190 inline void SetComplexZero(std::complex<T>& number)
192 number = std::complex<T>(T(0), T(0));
201 inline void SetComplexOne(T& number)
212 inline void SetComplexOne(std::complex<T>& number)
214 number = complex<T>(T(1), T(0));
236 number = std::complex<T>(n, 0);
247 number = std::complex<T>(n, 0);
254 number = std::complex<int>(x, 0);
265 number = std::complex<T>(x, 0);
276 number = std::realpart(x);
284 template <
class T0,
class T1>
319 #if defined(SELDON_WITH_BLAS) && !defined(SELDON_WITH_LAPACK)
321 return abs(real(val)) + abs(imag(val));
334 return real(z)*real(z) + imag(z)*imag(z);
347 #define SELDON_FILE_COMMON_INLINE_CXX