PCL
Complex.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.8.4
6 // ----------------------------------------------------------------------------
7 // pcl/Complex.h - Released 2024-12-23T11:32:56Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_Complex_h
53 #define __PCL_Complex_h
54 
56 
57 #include <pcl/Defs.h>
58 #include <pcl/Diagnostics.h>
59 
60 #include <pcl/Constants.h>
61 #include <pcl/Math.h>
62 #include <pcl/Relational.h>
63 
64 namespace pcl
65 {
66 
67 // ----------------------------------------------------------------------------
68 
69 #define real C[0]
70 #define imag C[1]
71 
82 template <typename T>
83 class PCL_CLASS Complex
84 {
85 public:
86 
90  using component = T;
91 
96  Complex() = default;
97 
101  Complex( T r, T i = 0 ) noexcept
102  {
103  real = r;
104  imag = i;
105  }
106 
110  template <typename T1>
111  Complex( const Complex<T1>& c ) noexcept
112  {
113  real = T( c.Real() );
114  imag = T( c.Imag() );
115  }
116 
120  constexpr T Real() const noexcept
121  {
122  return real;
123  }
124 
128  T& Real() noexcept
129  {
130  return real;
131  }
132 
136  constexpr T Imag() const noexcept
137  {
138  return imag;
139  }
140 
144  T& Imag() noexcept
145  {
146  return imag;
147  }
148 
152  constexpr bool IsReal() const noexcept
153  {
154  return imag == 0;
155  }
156 
160  template <typename T1>
161  Complex<T>& operator =( const Complex<T1>& c ) noexcept
162  {
163  real = T( c.Real() ), imag = T( c.Imag() );
164  return *this;
165  }
166 
171  template <typename T1>
172  Complex<T>& operator +=( const Complex<T1>& c ) noexcept
173  {
174  real += c.Real(), imag += c.Imag();
175  return *this;
176  }
177 
182  template <typename T1>
183  Complex<T>& operator -=( const Complex<T1>& c ) noexcept
184  {
185  real -= c.Real(), imag -= c.Imag();
186  return *this;
187  }
188 
193  template <typename T1>
194  Complex<T>& operator *=( const Complex<T1>& c ) noexcept
195  {
196  T t = T( real*c.Real() - imag*c.Imag() );
197  imag = T( imag*c.Real() + real*c.Imag() );
198  real = t;
199  return *this;
200  }
201 
206  template <typename T1>
207  Complex<T>& operator /=( const Complex<T1>& c ) noexcept
208  {
209  T r, d, t;
210  if ( pcl::Abs( c.Real() ) >= pcl::Abs( c.Imag() ) )
211  {
212  PCL_PRECONDITION( c.Real() != 0 )
213  r = T( c.Imag()/c.Real() );
214  d = T( c.Real() + r*c.Imag() );
215  t = T( (real + r*imag)/d );
216  imag = (imag - r*real)/d;
217  }
218  else
219  {
220  PCL_PRECONDITION( c.Imag() != 0 )
221  r = T( c.Real()/c.Imag() );
222  d = T( c.Imag() + r*c.Real() );
223  t = T( (real*r + imag)/d );
224  imag = (imag*r - real)/d;
225  }
226  real = t;
227  return *this;
228  }
229 
235  template <typename T1>
236  Complex<T>& operator =( T1 x ) noexcept
237  {
238  real = x, imag = 0;
239  return *this;
240  }
241 
246  template <typename T1>
247  Complex<T>& operator +=( T1 x ) noexcept
248  {
249  real += x;
250  return *this;
251  }
252 
258  template <typename T1>
259  Complex<T>& operator -=( T1 x ) noexcept
260  {
261  real -= x;
262  return *this;
263  }
264 
270  template <typename T1>
271  Complex<T>& operator *=( T1 x ) noexcept
272  {
273  real *= x, imag *= x;
274  return *this;
275  }
276 
282  template <typename T1>
283  Complex<T>& operator /=( T1 x ) noexcept
284  {
285  PCL_PRECONDITION( x != 0 )
286  real /= x, imag /= x;
287  return *this;
288  }
289 
293  Complex<T> operator +() const noexcept
294  {
295  return *this;
296  }
297 
304  Complex<T> operator -() const noexcept
305  {
306  return Complex<T>( -real, -imag );
307  }
308 
313  Complex<T> Conj() const noexcept
314  {
315  return Complex<T>( real, -imag );
316  }
317 
321  Complex<T> operator ~() const noexcept
322  {
323  return Conj();
324  }
325 
330  void SetConj() noexcept
331  {
332  imag = -imag;
333  }
334 
341  T Mag() const noexcept
342  {
343  T r = pcl::Abs( real );
344  T i = pcl::Abs( imag );
345  T m;
346  if ( r == 0 )
347  m = i;
348  else if ( i == 0 )
349  m = r;
350  else
351  {
352  bool q = r < i;
353  m = q ? r/i : i/r;
354  m = (q ? i : r) * pcl::Sqrt( 1 + m*m );
355  }
356  return m;
357  }
358 
365  explicit operator double() const noexcept
366  {
367  return double( Mag() );
368  }
369 
379  explicit operator int() const noexcept
380  {
381  return TruncInt( Mag() );
382  }
383 
388  constexpr T Norm() const noexcept
389  {
390  return real*real + imag*imag;
391  }
392 
398  constexpr T Arg() const noexcept
399  {
400  // Degenerate cases (real=0) are correctly handled by real ArcTan(). For
401  // the undefined case real=imag=0, we silently return zero. Should we
402  // throw an exception instead?
403  return (real != 0 || imag != 0) ? pcl::ArcTan( imag, real ) : 0;
404  }
405 
406 private:
407 
408  /*
409  * C99 binary-compatible complex components.
410  */
411  T C[ 2 ]; // C[0] = real, C[1] = imaginary
412 };
413 
414 #undef real
415 #undef imag
416 
417 /*
418  * ### N.B.: Template class Complex<T> cannot have virtual member functions.
419  * This is because sizeof( Complex<T> ) _must_ be equal to 2*sizeof( T ).
420  */
421 template <typename T>
422 struct PCL_AssertComplexSize
423 {
424  static_assert( sizeof( Complex<T> ) == 2*sizeof( T ), "Invalid sizeof( Complex<> )" );
425 };
426 
427 // ----------------------------------------------------------------------------
428 
442 template <typename T> inline
443 T Abs( const Complex<T>& c ) noexcept
444 {
445  return c.Mag();
446 }
447 
454 template <typename T> inline
455 Complex<T> Polar( T r, T stheta, T ctheta ) noexcept
456 {
457  return Complex<T>( r*ctheta, r*stheta );
458 }
459 
465 template <typename T> inline
466 Complex<T> Polar( T r, T theta ) noexcept
467 {
468  return Polar( r, pcl::Sin( theta ), pcl::Cos( theta ) );
469 }
470 
471 // ----------------------------------------------------------------------------
472 
477 template <typename T1, class T2> inline
478 Complex<T1> operator +( const Complex<T1>& c1, const Complex<T2>& c2 ) noexcept
479 {
480  return Complex<T1>( T1( c1.Real() + c2.Real() ),
481  T1( c1.Imag() + c2.Imag() ) );
482 }
483 
492 template <typename T1, class T2> inline
493 Complex<T1> operator +( const Complex<T1>& c, T2 x ) noexcept
494 {
495  return Complex<T1>( T1( c.Real()+x ), c.Imag() );
496 }
497 
506 template <typename T1, class T2> inline
507 Complex<T2> operator +( T1 x, const Complex<T2>& c ) noexcept
508 {
509  return c + x;
510 }
511 
517 template <typename T1, class T2> inline
518 Complex<T1> operator -( const Complex<T1>& c1, const Complex<T2>& c2 ) noexcept
519 {
520  return Complex<T1>( T1( c1.Real() - c2.Real() ),
521  T1( c1.Imag() - c2.Imag() ) );
522 }
523 
534 template <typename T1, class T2> inline
535 Complex<T1> operator -( const Complex<T1>& c, T2 x ) noexcept
536 {
537  return Complex<T1>( T1( c.Real()-x ), c.Imag() );
538 }
539 
550 template <typename T1, class T2> inline
551 Complex<T2> operator -( T1 x, const Complex<T2>& c ) noexcept
552 {
553  return Complex<T2>( T2( x-c.Real() ), -c.Imag() );
554 }
555 
561 template <typename T1, class T2> inline
562 Complex<T1> operator *( const Complex<T1>& c1, const Complex<T2>& c2 ) noexcept
563 {
564  return Complex<T1>( T1( c1.Real()*c2.Real() - c1.Imag()*c2.Imag() ),
565  T1( c1.Imag()*c2.Real() + c1.Real()*c2.Imag() ) );
566 }
567 
578 template <typename T1, class T2> inline
579 Complex<T1> operator *( const Complex<T1>& c, T2 x ) noexcept
580 {
581  return Complex<T1>( T1( c.Real()*x ), c.Imag()*x );
582 }
583 
594 template <typename T1, class T2> inline
595 Complex<T2> operator *( T1 x, const Complex<T2>& c ) noexcept
596 {
597  return c * x;
598 }
599 
605 template <typename T1, class T2> inline
606 Complex<T1> operator /( const Complex<T1>& c1, const Complex<T2>& c2 ) noexcept
607 {
608  Complex<T1> c;
609  T2 r, d;
610  if ( pcl::Abs( c2.Real() ) >= pcl::Abs( c2.Imag() ) )
611  {
612  PCL_PRECONDITION( c2.Real() != 0 )
613  r = c2.Imag() / c2.Real();
614  d = c2.Real() + r*c2.Imag();
615  c.Real() = T1( (c1.Real() + r*c1.Imag())/d );
616  c.Imag() = T1( (c1.Imag() - r*c1.Real())/d );
617  }
618  else
619  {
620  PCL_PRECONDITION( c2.Imag() != 0 )
621  r = c2.Real() / c2.Imag();
622  d = c2.Imag() + r*c2.Real();
623  c.Real() = T1( (c1.Real()*r + c1.Imag())/d );
624  c.Imag() = T1( (c1.Imag()*r - c1.Real())/d );
625  }
626  return c;
627 }
628 
639 template <typename T1, class T2> inline
640 Complex<T1> operator /( const Complex<T1>& c, T2 x ) noexcept
641 {
642  PCL_PRECONDITION( x != 0 )
643  return Complex<T1>( T1( c.Real()/x ), T1( c.Imag()/x ) );
644 }
645 
656 template <typename T1, class T2> inline
657 Complex<T2> operator /( T1 x, const Complex<T2>& c ) noexcept
658 {
659  // return Complex( x, 0 )/c;
660  Complex<T2> c3;
661  T2 r, d;
662  if ( pcl::Abs( c.Real() ) >= pcl::Abs( c.Imag() ) )
663  {
664  PCL_PRECONDITION( c.Real() != 0 )
665  r = c.Imag()/c.Real();
666  d = c.Real() + r*c.Imag();
667  c3.Real() = T2( x/d );
668  c3.Imag() = T2( -((r*x)/d) );
669  }
670  else
671  {
672  PCL_PRECONDITION( c.Imag() != 0 )
673  r = c.Real()/c.Imag();
674  d = c.Imag() + r*c.Real();
675  c3.Real() = T2( (r*x)/d );
676  c3.Imag() = T2( -(x/d) );
677  }
678  return c3;
679 }
680 
681 // ----------------------------------------------------------------------------
682 
687 template <typename T> inline
688 Complex<T> Sqrt( const Complex<T>& c ) noexcept
689 {
690  if ( c.Real() == 0 && c.Imag() == 0 )
691  return Complex<T>( 0 );
692 
693  Complex<T> c1;
694  T m, r = pcl::Abs( c.Real() ), i = pcl::Abs( c.Imag() );
695 
696  if ( r >= i )
697  {
698  PCL_PRECONDITION( r != 0 )
699  T t = i/r;
700  m = pcl::Sqrt( r ) * pcl::Sqrt( (1 + pcl::Sqrt( 1 + t*t ))/2 );
701  }
702  else
703  {
704  PCL_PRECONDITION( i != 0 )
705  T t = r/i;
706  m = pcl::Sqrt( i ) * pcl::Sqrt( (t + pcl::Sqrt( 1 + t*t ))/2 );
707  }
708 
709  if ( c.Real() >= 0 )
710  {
711  c1.Real() = m;
712  c1.Imag() = c.Imag()/(m+m);
713  }
714  else
715  {
716  c1.Imag() = (c.Imag() >= 0) ? m : -m;
717  c1.Real() = c.Imag()/(c1.Imag()+c1.Imag());
718  }
719 
720  return c1;
721 }
722 
727 template <typename T> inline
728 Complex<T> Exp( const Complex<T>& c ) noexcept
729 {
730  T x = pcl::Exp( c.Real() );
731  return Complex<T>( x*pcl::Cos( c.Imag() ), x*pcl::Sin( c.Imag() ) );
732 }
733 
738 template <typename T> inline
739 Complex<T> Ln( const Complex<T>& c ) noexcept
740 {
741  return Complex<T>( pcl::Ln( c.Mag() ), c.Arg() );
742 }
743 
748 template <typename T> inline
749 Complex<T> Log( const Complex<T>& c ) noexcept
750 {
751  return pcl::Const<T>::log10e() * pcl::Ln( c );
752 }
753 
754 // ----------------------------------------------------------------------------
755 
760 template <typename T1, class T2> inline
761 Complex<T1> Pow( const Complex<T1>& c, T2 x ) noexcept
762 {
763  if ( c.Imag() == 0 )
764  return Complex<T1>( pcl::Pow( c.Real(), T1( x ) ) );
765  else
766  return pcl::Exp( T1( x )*pcl::Ln( c ) );
767 }
768 
773 template <typename T1, class T2> inline
774 Complex<T2> Pow( T1 x, const Complex<T2>& c ) noexcept
775 {
776  if ( c.Imag() == 0 )
777  return Complex<T2>( pcl::Pow( T2( x ), c.Real() ) );
778  else
779  return pcl::Exp( c*pcl::Ln( T2( x ) ) );
780 }
781 
787 template <typename T> inline
788 Complex<T> Pow( const Complex<T>& c1, const Complex<T>& c2 ) noexcept
789 {
790  if ( c2.Imag() == 0 )
791  return pcl::Pow( c1, c2.Real() );
792  else if ( c1.Imag() == 0 )
793  return Complex<T>( pcl::Pow( c1.Real(), c2 ) );
794  else
795  return pcl::Exp( c2*pcl::Ln( c1 ) );
796 }
797 
798 // ----------------------------------------------------------------------------
799 
808 template <typename T> inline
809 Complex<T> Sin( const Complex<T>& c ) noexcept
810 {
811  return Complex<T>( pcl::Sin( c.Real() )*pcl::Cosh( c.Imag() ),
812  pcl::Cos( c.Real() )*pcl::Sinh( c.Imag() ) );
813 }
814 
819 template <typename T> inline
820 Complex<T> Cos( const Complex<T>& c ) noexcept
821 {
822  return Complex<T>( pcl::Cos( c.Real() )*pcl::Cosh( c.Imag() ),
823  -pcl::Sin( c.Real() )*pcl::Sinh( c.Imag() ) );
824 }
825 
830 template <typename T> inline
831 Complex<T> Tan( const Complex<T>& c ) noexcept
832 {
833  return pcl::Sin( c )/pcl::Cos( c );
834 }
835 
840 template <typename T> inline
841 Complex<T> Sinh( const Complex<T>& c ) noexcept
842 {
843  return Complex<T>( pcl::Sinh( c.Real() )*pcl::Cos( c.Imag() ),
844  pcl::Cosh( c.Real() )*pcl::Sin( c.Imag() ) );
845 }
846 
851 template <typename T> inline
852 Complex<T> Cosh( const Complex<T>& c ) noexcept
853 {
854  return Complex<T>( pcl::Cosh( c.Real() )*pcl::Cos( c.Imag() ),
855  pcl::Sinh( c.Real() )*pcl::Sin( c.Imag() ) );
856 }
857 
862 template <typename T> inline
863 Complex<T> Tanh( const Complex<T>& c ) noexcept
864 {
865  return pcl::Sinh( c )/pcl::Cosh( c );
866 }
867 
868 // ----------------------------------------------------------------------------
869 
884 template <typename T1, class T2> inline
885 bool operator ==( const Complex<T1>& c1, const Complex<T2>& c2 ) noexcept
886 {
887  return c1.Real() == c2.Real() && c1.Imag() == c2.Imag();
888 }
889 
894 template <typename T1, class T2> inline
895 bool operator ==( const Complex<T1>& c, T2 x ) noexcept
896 {
897  return c.Real() == x && c.Imag() == T1( 0 );
898 }
899 
904 template <typename T1, class T2> inline
905 bool operator ==( T1 x, const Complex<T2>& c ) noexcept
906 {
907  return c == x;
908 }
909 
914 template <typename T1, class T2> inline
915 bool operator <( const Complex<T1>& c1, const Complex<T2>& c2 ) noexcept
916 {
917  return c1.Mag() < c2.Mag();
918 }
919 
924 template <typename T1, class T2> inline
925 bool operator <( const Complex<T1>& c, T2 x ) noexcept
926 {
927  return c.Mag() < pcl::Abs( x );
928 }
929 
934 template <typename T1, class T2> inline
935 bool operator <( T1 x, const Complex<T2>& c ) noexcept
936 {
937  return pcl::Abs( x ) < c.Mag();
938 }
939 
940 // ----------------------------------------------------------------------------
941 
951 template <typename T> inline
952 Complex<T> Round( const Complex<T>& c ) noexcept
953 {
954  return Complex<T>( pcl::Round( c.Real() ), pcl::Round( c.Imag() ) );
955 }
956 
963 template <typename T> inline
964 Complex<T> Round( const Complex<T>& c, int n ) noexcept
965 {
966  PCL_PRECONDITION( n >= 0 )
967  return Complex<T>( pcl::Round( c.Real(), n ), pcl::Round( c.Imag(), n ) );
968 }
969 
970 // ----------------------------------------------------------------------------
971 
996 template <typename T> inline
997 void PhaseCorrelationMatrix( Complex<T>* __restrict__ i, const Complex<T>* __restrict__ j,
998  const Complex<T>* __restrict__ a, const Complex<T>* __restrict__ b ) noexcept
999 {
1000  const T tiny = T( 1.0e-20 );
1001  for ( ; i < j; ++i, ++a, ++b )
1002  {
1003  Complex<T> n = *a * ~*b;
1004  *i = n/Max( tiny, Abs( n ) );
1005  }
1006 }
1007 
1028 template <typename T> inline
1029 void CrossPowerSpectrumMatrix( Complex<T>* __restrict__ i, const Complex<T>* __restrict__ j,
1030  const Complex<T>* __restrict__ a, const Complex<T>* __restrict__ b ) noexcept
1031 {
1032  const T tiny = T( 1.0e-20 );
1033  for ( ; i < j; ++i, ++a, ++b )
1034  *i = (*b * ~*a)/Max( tiny, Abs( *a ) * Abs( *b ) );
1035 }
1036 
1037 //
1038 // Stream extraction/insertion.
1039 //
1040 /* ### PCL 2.x: Add these along with pcl::DataStream, etc...
1041 template <class S, typename T> inline
1042 S& operator >>( S& s, Complex<T>& c )
1043 {
1044  return s >> c.Real() >> c.Imag();
1045 }
1046 
1047 template <class S, typename T> inline
1048 S& operator <<( S& s, const Complex<T>& c )
1049 {
1050  return s << c.Real() << c.Imag();
1051 }
1052  */
1053 
1054 // ----------------------------------------------------------------------------
1055 
1056 #ifndef __PCL_NO_COMPLEX_INSTANTIATE
1057 
1070 using Complex32 = Complex<float>;
1071 
1081 using fcomplex = Complex32;
1082 
1091 using Complex64 = Complex<double>;
1092 
1102 using dcomplex = Complex64;
1103 
1113 using complex = dcomplex;
1114 
1115 #endif // __PCL_NO_COMPLEX_INSTANTIATE
1116 
1117 // ----------------------------------------------------------------------------
1118 
1119 } // pcl
1120 
1121 #endif // __PCL_Complex_h
1122 
1123 // ----------------------------------------------------------------------------
1124 // EOF pcl/Complex.h - Released 2024-12-23T11:32:56Z
A complex number whose components are 32-bit floating point real numbers.
A complex number whose components are 64-bit floating point real numbers.
Generic complex number.
Definition: Complex.h:84
constexpr T Imag() const noexcept
Definition: Complex.h:136
void SetConj() noexcept
Definition: Complex.h:330
constexpr bool IsReal() const noexcept
Definition: Complex.h:152
Complex(T r, T i=0) noexcept
Definition: Complex.h:101
constexpr T Real() const noexcept
Definition: Complex.h:120
Complex()=default
Complex(const Complex< T1 > &c) noexcept
Definition: Complex.h:111
Complex< T > Conj() const noexcept
Definition: Complex.h:313
static constexpr T log10e()
Definition: Constants.h:159
A complex number whose components are 64-bit floating point real numbers.
A complex number whose components are 64-bit floating point real numbers.
A complex number whose components are 32-bit floating point real numbers.
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Definition: Array.h:2285
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Definition: Array.h:2296
Complex< T1 > operator-(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Definition: Complex.h:518
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Definition: Complex.h:562
Complex< T1 > operator+(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Definition: Complex.h:478
Complex< T1 > operator/(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Definition: Complex.h:606
Complex< T1 > Pow(const Complex< T1 > &c, T2 x) noexcept
Definition: Complex.h:761
Complex< T > Sqrt(const Complex< T > &c) noexcept
Definition: Complex.h:688
Complex< T > Exp(const Complex< T > &c) noexcept
Definition: Complex.h:728
Complex< T > Log(const Complex< T > &c) noexcept
Definition: Complex.h:749
Complex< T > Ln(const Complex< T > &c) noexcept
Definition: Complex.h:739
Complex< T > Polar(T r, T stheta, T ctheta) noexcept
Definition: Complex.h:455
T Abs(const Complex< T > &c) noexcept
Definition: Complex.h:443
Complex< T > Round(const Complex< T > &c) noexcept
Definition: Complex.h:952
Complex< T > Sinh(const Complex< T > &c) noexcept
Definition: Complex.h:841
Complex< T > Tanh(const Complex< T > &c) noexcept
Definition: Complex.h:863
Complex< T > Sin(const Complex< T > &c) noexcept
Definition: Complex.h:809
Complex< T > Cosh(const Complex< T > &c) noexcept
Definition: Complex.h:852
Complex< T > Cos(const Complex< T > &c) noexcept
Definition: Complex.h:820
Complex< T > Tan(const Complex< T > &c) noexcept
Definition: Complex.h:831
constexpr T ArcTan(T x) noexcept
Definition: Math.h:597
T Norm(const T *i, const T *j, const P &p) noexcept
Definition: Math.h:2166
int TruncInt(T x) noexcept
Definition: Math.h:1203
void PhaseCorrelationMatrix(Complex< T > *__restrict__ i, const Complex< T > *__restrict__ j, const Complex< T > *__restrict__ a, const Complex< T > *__restrict__ b) noexcept
Definition: Complex.h:997
void CrossPowerSpectrumMatrix(Complex< T > *__restrict__ i, const Complex< T > *__restrict__ j, const Complex< T > *__restrict__ a, const Complex< T > *__restrict__ b) noexcept
Definition: Complex.h:1029
constexpr const T & Max(const T &a, const T &b) noexcept
Definition: Utility.h:119
PCL root namespace.
Definition: AbstractImage.h:77