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

<!--#set var="isip_page_title" value="MatrixFloat" -->
<?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/matrix/MatrixFloat/MatrixFloat.h">MatrixFloat</a> : public  <a href="../MMatrix/index.html">MMatrix&lt;Float, float&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_matrix.a

#include &lt;MatrixFloat.h&gt;

MatrixFloat(long nrows = DEF_SIZE, long ncols = DEF_SIZE,
             long type = DEF_TYPE);
MatrixFloat(const MatrixFloat& matrix);
</pre>
</blockquote>

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

<blockquote>
<pre>
float data0[6] = {1.2, 2.5, 3.6, 4.8, 5.1, 6.7};
float data1[6] = {4.2, 6.1, 7.0, 2.5, 3.3, 9.5};

MatrixFloat val0;
MatrixFloat val1(3, 3, Integral::LOWER_TRIANGULAR);
val0.assign(data0, 2, 3)
val1.assign(data1, 3, 3);
</pre>
</blockquote>

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

The MatrixFloat class manages a matrix of Float objects. It is derived
from the MMatrix class and inherits the commonly used mathematical,
logical, linear algebra and i/o methods from it. A MatrixFloat object
can read itself from (or write itself to) a Sof file. It includes the
memory management methods which use the MemoryManager class to
allocate or delete memory from the heap.

<br><br>

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

<ul>
  <li> <a href="../MMatrix/index.html">MMatrix</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/matrix/MatrixFloat/mflt_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"MatrixFloat";</a></pre>     
</ul>

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

<ul>
  <li> error code indicating MatrixFloat class general error:

       <pre><a href="/perl/ifc_document.pl?err=00024800">static const long ERR = 24800;</a></pre>
</ul>

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

<ul>
  <li> define memory manager:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/mflt_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/matrix/MatrixFloat/MatrixFloat.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/mflt_02.cc">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods: the setDebug() method is inherited from the <a href=../MMatrix/index.html#public>MMatrix</a> template class
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=debug">boolean debug(const unichar* message) const;</a></pre>
       
  <li> destructor/constructors:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=destructor">~MatrixFloat();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=default+constructor">MatrixFloat(long nrows = DEF_SIZE, long ncols = DEF_SIZE, long type = DEF_TYPE);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=copy+constructor">MatrixFloat(const MatrixFloat& matrix);</a></pre>
       
  <li> assign methods:

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

  <li> operator= methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=operator%3D&instance=0">MatrixFloat& operator=(const MatrixFloat& matrix);</a></pre>
       
  <li> i/o methods: the sofSize, readData and writeData methods are inherited from the <a href="../MMatrix/index.html#public">MMatrix</a> template class

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.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/matrix/MatrixFloat/MatrixFloat.h&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>
       
  <li> equality methods:

       <pre>these methods are inherited from the <a href=../MMatrix/index.html#public>MMatrix</a> template class</pre>
       
  <li> memory management methods: the clear method is inherited from the <a href="../MMatrix/index.html#public">MMatrix </a> template class
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=new\[\]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=delete\[\]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.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> constructor: this method constructs a matrix with a unichar* object

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=constructor">MatrixFloat(long nrows, long ncols, const unichar* arg, long type = DEF_TYPE, const Char delim = DEF_DELIM);</a></pre>
</ul>

<ul>
  <li> operator= methods: this method assigns a float value to the matrix

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/matrix/MatrixFloat/MatrixFloat.h&method=operator%3D&instance=1">MatrixFloat& operator=(float value);</a></pre>
</ul>

<a name="private">
<b>private methods:</b>
<br><br>

<ul>
  <li> none
</ul>

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

<ul>
  <li> This example demonstrates basic linear algebra operations using
       the matrix class<br>
       by solving the equation: w = x<sup>-1</sup>y + z.

<pre>       
// declare the operands: note that these matrices are of different types.
// the class will handle type conversion automatically.
//
MatrixFloat x;
x.assign(3, 3, L"1.0, 2.0, 3.0, 6.0, 5.0, 4.0, 7.0, 8.0, 9.0", Integral::FULL);
 
MatrixFloat y;
y.assign(3, 3, L"1.0, 1.0, 1.0", Integral::DIAGONAL);
  
MatrixFloat z;
z.setDimensions(3, 3);
z.setValue(1, 2, 27.0);
       
// declare an output matrix: not that we don't need to declare the size
// of this matrix.
//
MatrixFloat w;
  
// compute a matrix inverse in place: this destroys the input.
//
x.inverse();
  
// compute the product of the inverse of x and y, and add z
//
x.mult(y);       
w.add(x, z);

// print the output
//
w.debug(L"the answer is");
</pre>

       The output that results from this example is:<br><br>
       
<pre>
    [ 0.190476 0.52381 -0.333333  ]
w = [ -0.952381 -0.619048 27.6667 ]
    [ 0.904762 0.238095 -0.333333 ]
</pre>
</ul>

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

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

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