<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="ComplexLong" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>name: <a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h">ComplexLong</a> : public <a href="../MComplexScalar/index.html">MComplexScalar&lt;complexlong, int32&gt;</a></b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>
<br><br>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_math_scalar.a

#include &lt;ComplexLong.h&gt;

ComplexLong(complexlong arg = DEF_VALUE);
ComplexLong(const ComplexLong& arg);
ComplexLong& operator= (const ComplexLong& arg);
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
ComplexLong val0 = 10;
ComplexLong val1;
val1 = val0;
ComplexLong val2(2, -5);
ComplexLong val3(L"-1, -3");
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

The ComplexLong class manages a complex number for which each component is
a 32-bit integer number. This class largely inherits

<a href="../MComplexScalar/index.html">MComplexScalar</a>

template functionality.

<br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../MScalar/index.html">MScalar</a>
  <li> <a href="../MComplexScalar/index.html">MComplexScalar</a>
  <li> <a href="../Long/index.html">Long</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/clong_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"ComplexLong";</a></pre>
</ul>

<a name="error">
<b>error codes:</b>
<br><br>

<ul>
  <li> error code indicating ComplexLong class general error:
       
       <pre><a href="/perl/ifc_document.pl?err=00021300">static const long ERR = 21300;</a></pre>
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>
  <li> static memory manager:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/clong_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>
</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/clong_02.cc&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods:

       <pre>setDebug method is inherited from base class</pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/clong_01.cc&method=debug">boolean debug(const unichar* message) const;</a></pre>

  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=destructor">~ComplexLong();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=default constructor">ComplexLong(complexlong arg = DEF_VALUE);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=copy constructor">ComplexLong(const ComplexLong& arg);</a></pre>     

  <li> assign methods:

       <pre>assign methods are inherited from the <a href="../MComplexScalar/index.html#public">MComplexScalar</a> template class</pre>

  <li> operator= methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=operator%3D&instance=0">ComplexLong& operator= (const ComplexLong& arg);</a></pre>
       
  <li> <pre>i/o methods: sofSize, readData and writeData methods are inherited from
the <a href="../MComplexScalar/index.html#public">MComplexScalar</a> template class</pre> 
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=read">boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>
       
  <li> equality methods:

       <pre>equality methods are inherited from the <a href="../MComplexScalar/index.html#public">MComplexScalar</a> template class</pre>
       
  <li> <pre>memory management methods: clear method is inherited from the <a href="../MComplexScalar/index.html#public">MComplexScalar</a>
template class</pre>
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=new[]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=delete[]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=setGrowSize">static boolean setGrowSize(long grow_size);</a></pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> constructors:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=constructor&instance=0">ComplexLong(long real, long imag = 0);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=constructor&instance=1">ComplexLong(unichar* arg);</a></pre>
</ul>

<ul>
  <li> operator overload methods:
       
      <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=operator+complexdouble()">operator complexdouble() const;</a></pre>
      <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/ComplexLong/ComplexLong.h&method=operator+complexfloat()">operator complexfloat() const;</a></pre>
</ul>
  
<a name="private">
<b>private methods:</b>
<br><br>

<ul>
  <li> bitwise methods: declare these as private member functions because they
       are not defined for complex operations

       <pre>using MScalar&lt;complexlong, int32&gt;::bor;</pre>
       <pre>using MScalar&lt;complexlong, int32&gt;::band;</pre>
       <pre>using MScalar&lt;complexlong, int32&gt;::bxor;</pre>
       <pre>using MScalar&lt;complexlong, int32&gt;::brs;</pre>
       <pre>using MScalar&lt;complexlong, int32&gt;::bls;</pre>
       <pre>using MScalar&lt;complexlong, int32&gt;::bcmpl;</pre>

  <li> modulus methods: declare these as private member functions because they
       are not defined for complex operations

       <pre>using MScalar&lt;complexdouble, int32&gt;::operator%=;</pre>
       <pre>using MScalar&lt;complexdouble, int32&gt;::operator%;</pre>
       <pre>using MScalar&lt;complexdouble, int32&gt;::mod;</pre>
       <pre>using MScalar&lt;complexdouble, int32&gt;::centerClip;</pre>
       <pre>using MScalar&lt;complexdouble, int32&gt;::fraction;</pre>
       <pre>using MScalar&lt;complexdouble, int32&gt;::limit;</pre>
       <pre>using MScalar&lt;complexdouble, int32&gt;::limitmag;</pre>
</ul>

<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> This example shows how to do basic math with complex numbers:
       
<pre>
ComplexFloat x(L"1+1j"), y(L"2+3j"), z(L"3+4j"), ans;
ans = (x * y + z) / (x + y);</pre>

       Basic math is fairly straightforward though casting is sometimes
       required for mixed types.

       <br><br>

  <li> This example shows how to write a ComplexLong object into an Sof file:
       
<pre>
ComplexLong val0(5, -1);
String tmp_filename(L"foo");
Sof tmp_file;
tmp_file.open(tmp_filename, File::WRITE_ONLY, File::TEXT);
       
val0.write(tmp_file, (long)0);
tmp_file.close();</pre>
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> See the <a href="../MComplexScalar/index.html#notes">notes section of MComplexScalar</a>.

       <br><br>
       
  <li> The ComplexLong class defines the bor, band, bxor, brs, bls, bcmpl,
       mod, and operator%=integer methods as private in order to block the
       template functions in MComplexScalar&lt;complexlong,int32&gt;.
       This means if a user attempts to use ComplexLong::mod() a
       compilation error, not a runtime error, will occur.
       
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
