You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
psblas3/docs/html/userhtmlsu6.html

1090 lines
42 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head><title>Sparse Matrix class</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
<!-- html,3 -->
<meta name="src" content="userhtml.tex">
<link rel="stylesheet" type="text/css" href="userhtml.css">
</head><body
>
<!--l. 534--><div class="crosslinks"><p class="noindent">[<a
href="userhtmlse4.html" >next</a>] [<a
href="userhtmlsu5.html" >prev</a>] [<a
href="userhtmlsu5.html#tailuserhtmlsu5.html" >prev-tail</a>] [<a
href="userhtmlsu4.html#tailuserhtmlsu6.html">tail</a>] [<a
href="userhtmlsu7.html#userhtmlsu9.html" >up</a>] </p></div>
<h4 class="subsectionHead"><span class="titlemark">3.2 </span> <a
id="x14-260003.2"></a>Sparse Matrix class</h4>
<!--l. 536--><p class="noindent" >The <a
id="spdata"></a><span
class="cmtt-10">psb</span><span
class="cmtt-10">_Tspmat</span><span
class="cmtt-10">_type </span>class contains all information about the local portion of the
sparse matrix and its storage mode. Its design is based on the STATE design
pattern&#x00A0;<span class="cite">[<a
href="userhtmlli2.html#XDesignPatterns">13</a>]</span> as detailed in&#x00A0;<span class="cite">[<a
href="userhtmlli2.html#XSparse03">11</a>]</span>; the type declaration is shown in figure&#x00A0;<a
href="#x14-26001r2">2<!--tex4ht:ref: fig:spmattype --></a> where <span class="lstinline"></span><span
class="cmtt-10">T</span> is a
placeholder for the data type and precision variants
<dl class="description"><dt class="description">
<span
class="cmbx-10">S</span> </dt><dd
class="description">Single precision real;
</dd><dt class="description">
<span
class="cmbx-10">D</span> </dt><dd
class="description">Double precision real;
</dd><dt class="description">
<span
class="cmbx-10">C</span> </dt><dd
class="description">Single precision complex;
</dd><dt class="description">
<span
class="cmbx-10">Z</span> </dt><dd
class="description">Double precision complex;
</dd><dt class="description">
<span
class="cmbx-10">LS,LD,LC,LZ</span> </dt><dd
class="description">Same numeric type as above, but with <span class="lstinline"></span><span
class="cmtt-10">psb_lpk_</span> integer
indices.</dd></dl>
<!--l. 551--><p class="noindent" >The actual data is contained in the polymorphic component <span class="lstinline"></span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">a</span> of type
<a
id="spbasedata"></a><span
class="cmtt-10">psb</span><span
class="cmtt-10">_T</span><span
class="cmtt-10">_base</span><span
class="cmtt-10">_sparse</span><span
class="cmtt-10">_mat</span>; its specific layout can be chosen dynamically among the
predefined types, or an entirely new storage layout can be implemented and passed to
the library at runtime via the <span class="lstinline"></span><span
class="cmtt-10">psb_spasb</span> routine.
<!--l. 556--><p class="indent" > <a
id="x14-26001r2"></a><hr class="float"><div class="float"
>
<div class="center"
>
<!--l. 565--><p class="noindent" >
<div class="minipage"><pre class="verbatim" id="verbatim-15">
&#x00A0;&#x00A0;type&#x00A0;::&#x00A0;psb_Tspmat_type
&#x00A0;&#x00A0;&#x00A0;&#x00A0;class(psb_T_base_sparse_mat),&#x00A0;allocatable&#x00A0;&#x00A0;::&#x00A0;a
&#x00A0;&#x00A0;end&#x00A0;type&#x00A0;&#x00A0;psb_Tspmat_type
</pre>
<!--l. 571--><p class="nopar" ></div></div>
<br /> <div class="caption"
><span class="id">Listing 2: </span><span
class="content"> The PSBLAS defined data type that contains a sparse matrix.</span></div><!--tex4ht:label?: x14-26001r2 -->
</div><hr class="endfloat" />
<!--l. 584--><p class="indent" > The following very common formats are precompiled in PSBLAS and thus are
always available:
<dl class="description"><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_T</span><span
class="cmbx-10">_coo</span><span
class="cmbx-10">_sparse</span><span
class="cmbx-10">_mat</span> </dt><dd
class="description">Coordinate storage;
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_T</span><span
class="cmbx-10">_csr</span><span
class="cmbx-10">_sparse</span><span
class="cmbx-10">_mat</span> </dt><dd
class="description">Compressed storage by rows;
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_T</span><span
class="cmbx-10">_csc</span><span
class="cmbx-10">_sparse</span><span
class="cmbx-10">_mat</span> </dt><dd
class="description">Compressed storage by columns;</dd></dl>
<!--l. 591--><p class="noindent" >The inner sparse matrix has an associated state, which can take the following
values:
<dl class="description"><dt class="description">
<span
class="cmbx-10">Build:</span> </dt><dd
class="description">State entered after the first allocation, and before the first assembly; in
this state it is possible to add nonzero entries.
</dd><dt class="description">
<span
class="cmbx-10">Assembled:</span> </dt><dd
class="description">State entered after the assembly; computations using the sparse
matrix, such as matrix-vector products, are only possible in this state;
</dd><dt class="description">
<span
class="cmbx-10">Update:</span> </dt><dd
class="description">State entered after a reinitalization; this is used to handle applications
in which the same sparsity pattern is used multiple times with different
coefficients. In this state it is only possible to enter coefficients for already
existing nonzero entries.</dd></dl>
<!--l. 604--><p class="noindent" >The only storage variant supporting the build state is COO; all other variants are
obtained by conversion to/from it.
<h5 class="subsubsectionHead"><span class="titlemark">3.2.1 </span> <a
id="x14-270003.2.1"></a>Sparse Matrix Methods</h5>
<!--l. 609--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.2 </span> <a
id="x14-280003.2.2"></a>get_nrows &#8212; Get number of rows in a sparse matrix</h5>
<pre class="verbatim" id="verbatim-16">
nr&#x00A0;=&#x00A0;a%get_nrows()
</pre>
<!--l. 614--><p class="nopar" >
<!--l. 616--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 626--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">The number of rows of sparse matrix <span class="lstinline"></span><span
class="cmtt-10">a</span>.</dd></dl>
<!--l. 633--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.3 </span> <a
id="x14-290003.2.3"></a>get_ncols &#8212; Get number of columns in a sparse matrix</h5>
<pre class="verbatim" id="verbatim-17">
nc&#x00A0;=&#x00A0;a%get_ncols()
</pre>
<!--l. 638--><p class="nopar" >
<!--l. 640--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 650--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">The number of columns of sparse matrix <span class="lstinline"></span><span
class="cmtt-10">a</span>.</dd></dl>
<!--l. 657--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.4 </span> <a
id="x14-300003.2.4"></a>get_nnzeros &#8212; Get number of nonzero elements in a sparse matrix</h5>
<pre class="verbatim" id="verbatim-18">
nz&#x00A0;=&#x00A0;a%get_nnzeros()
</pre>
<!--l. 662--><p class="nopar" >
<!--l. 664--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 674--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">The number of nonzero elements stored in sparse matrix <span class="lstinline"></span><span
class="cmtt-10">a</span>.</dd></dl>
<!--l. 679--><p class="noindent" ><span
class="cmbx-10">Notes</span>
<ol class="enumerate1" >
<li
class="enumerate" id="x14-30002x1">The function value is specific to the storage format of matrix <span class="lstinline"></span><span
class="cmtt-10">a</span>; some
storage formats employ padding, thus the returned value for the same
matrix may be different for different storage choices.</li></ol>
<!--l. 687--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.5 </span> <a
id="x14-310003.2.5"></a>get_size &#8212; Get maximum number of nonzero elements in a sparse
matrix</h5>
<pre class="verbatim" id="verbatim-19">
maxnz&#x00A0;=&#x00A0;a%get_size()
</pre>
<!--l. 692--><p class="nopar" >
<!--l. 694--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 704--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">The maximum number of nonzero elements that can be stored
in sparse matrix <span class="lstinline"></span><span
class="cmtt-10">a</span> using its current memory allocation.</dd></dl>
<!--l. 711--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.6 </span> <a
id="x14-320003.2.6"></a>sizeof &#8212; Get memory occupation in bytes of a sparse matrix</h5>
<pre class="verbatim" id="verbatim-20">
memory_size&#x00A0;=&#x00A0;a%sizeof()
</pre>
<!--l. 716--><p class="nopar" >
<!--l. 718--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 728--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">The memory occupation in bytes.</dd></dl>
<!--l. 734--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.7 </span> <a
id="x14-330003.2.7"></a>get_fmt &#8212; Short description of the dynamic type</h5>
<!--l. 738--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">write</span><span
class="cmtt-10">(*,*)</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">get_fmt</span><span
class="cmtt-10">()</span>
<!--l. 741--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 751--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">A short string describing the dynamic type of the matrix.
Predefined values include <span class="lstinline"></span><span
class="cmtt-10">NULL</span>, <span class="lstinline"></span><span
class="cmtt-10">COO</span>, <span class="lstinline"></span><span
class="cmtt-10">CSR</span> and <span class="lstinline"></span><span
class="cmtt-10">CSC</span>.</dd></dl>
<!--l. 758--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.8 </span> <a
id="x14-340003.2.8"></a>is_bld, is_upd, is_asb &#8212; Status check</h5>
<!--l. 762--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">if</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">(</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">is_bld</span><span
class="cmtt-10">())</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">then</span><br
class="newline" /><span class="lstinline"></span><span
class="cmtt-10">if</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">(</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">is_upd</span><span
class="cmtt-10">())</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">then</span><br
class="newline" /><span class="lstinline"></span><span
class="cmtt-10">if</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">(</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">is_asb</span><span
class="cmtt-10">())</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">then</span>
<!--l. 766--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 776--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">A <span class="lstinline"></span><span
class="cmtt-10">logical</span> value indicating whether the matrix is in the Build,
Update or Assembled state, respectively.</dd></dl>
<!--l. 783--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.9 </span> <a
id="x14-350003.2.9"></a>is_lower, is_upper, is_triangle, is_unit &#8212; Format check</h5>
<pre class="verbatim" id="verbatim-21">
if&#x00A0;(a%is_triangle())&#x00A0;then
if&#x00A0;(a%is_upper())&#x00A0;then
if&#x00A0;(a%is_lower())&#x00A0;then
if&#x00A0;(a%is_unit())&#x00A0;then
</pre>
<!--l. 799--><p class="nopar" >
<!--l. 802--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix<br
class="newline" />Scope: <span
class="cmbx-10">local</span><br
class="newline" /></dd></dl>
<!--l. 812--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">Function value</span> </dt><dd
class="description">A <span class="lstinline"></span><span
class="cmtt-10">logical</span> value indicating whether the matrix is triangular;
if <span class="lstinline"></span><span
class="cmtt-10">is_triangle</span><span
class="cmtt-10">()</span> returns <span class="lstinline"></span><span
class="cmtt-10">.</span><span
class="cmtt-10">true</span><span
class="cmtt-10">.</span> check also if it is lower, upper and with
a unit (i.e. assumed) diagonal.</dd></dl>
<!--l. 821--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.10 </span> <a
id="x14-360003.2.10"></a>cscnv &#8212; Convert to a different storage format</h5>
<pre class="verbatim" id="verbatim-22">
call&#x00A0;&#x00A0;a%cscnv(b,info&#x00A0;[,&#x00A0;type,&#x00A0;mold,&#x00A0;dupl])
call&#x00A0;&#x00A0;a%cscnv(info&#x00A0;[,&#x00A0;type,&#x00A0;mold,&#x00A0;dupl])
</pre>
<!--l. 833--><p class="nopar" >
<!--l. 836--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" />
</dd><dt class="description">
<span
class="cmbx-10">type</span> </dt><dd
class="description">a string requesting a new format.<br
class="newline" />Type: optional.
</dd><dt class="description">
<span
class="cmbx-10">mold</span> </dt><dd
class="description">a variable of <span class="lstinline"></span><span
class="cmtt-10">class</span><span
class="cmtt-10">(</span><span
class="cmtt-10">psb_T_base_sparse_mat</span><span
class="cmtt-10">)</span> requesting a new format.<br
class="newline" />Type: optional.
</dd><dt class="description">
<span
class="cmbx-10">dupl</span> </dt><dd
class="description">an integer value specifing how to handle duplicates (see Named Constants
below)</dd></dl>
<!--l. 850--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">b,a</span> </dt><dd
class="description">A copy of <span class="lstinline"></span><span
class="cmtt-10">a</span> with a new storage format.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 856--><p class="noindent" >The <span class="lstinline"></span><span
class="cmtt-10">mold</span> arguments may be employed to interface with special devices, such as GPUs
and other accelerators.
<!--l. 861--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.11 </span> <a
id="x14-370003.2.11"></a>csclip &#8212; Reduce to a submatrix</h5>
<pre class="verbatim" id="verbatim-23">
&#x00A0;&#x00A0;&#x00A0;&#x00A0;call&#x00A0;a%csclip(b,info[,&amp;
&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&amp;&#x00A0;imin,imax,jmin,jmax,rscale,cscale])
</pre>
<!--l. 873--><p class="nopar" >
<!--l. 876--><p class="indent" > Returns the submatrix <span class="lstinline"></span><span
class="cmtt-10">A</span><span
class="cmtt-10">(</span><span
class="cmtt-10">imin</span><span
class="cmtt-10">:</span><span
class="cmtt-10">imax</span><span
class="cmtt-10">,</span><span
class="cmtt-10">jmin</span><span
class="cmtt-10">:</span><span
class="cmtt-10">jmax</span><span
class="cmtt-10">)</span>, optionally rescaling row/col
indices to the range <span class="lstinline"></span><span
class="cmtt-10">1:</span><span
class="cmtt-10">imax</span><span
class="cmtt-10">-</span><span
class="cmtt-10">imin</span><span
class="cmtt-10">+1,1:</span><span
class="cmtt-10">jmax</span><span
class="cmtt-10">-</span><span
class="cmtt-10">jmin</span><span
class="cmtt-10">+1</span>.
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" />
</dd><dt class="description">
<span
class="cmbx-10">imin,imax,jmin,jmax</span> </dt><dd
class="description">Minimum and maximum row and column indices.<br
class="newline" />Type: optional.
</dd><dt class="description">
<span
class="cmbx-10">rscale,cscale</span> </dt><dd
class="description">Whether to rescale row/column indices. Type: optional.</dd></dl>
<!--l. 890--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">b</span> </dt><dd
class="description">A copy of a submatrix of <span class="lstinline"></span><span
class="cmtt-10">a</span>.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 897--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.12 </span> <a
id="x14-380003.2.12"></a>clean_zeros &#8212; Eliminate zero coefficients</h5>
<!--l. 899--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">call</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">clean_zeros</span><span
class="cmtt-10">(</span><span
class="cmtt-10">info</span><span
class="cmtt-10">)</span>
<!--l. 901--><p class="indent" > Eliminates zero coefficients in the input matrix. Note that depending on the
internal storage format, there may still be some amount of zero padding in the
output.
<!--l. 905--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" /></dd></dl>
<!--l. 912--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">The matrix <span class="lstinline"></span><span
class="cmtt-10">a</span> without zero coefficients.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 919--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.13 </span> <a
id="x14-390003.2.13"></a>get_diag &#8212; Get main diagonal</h5>
<!--l. 921--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">call</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">get_diag</span><span
class="cmtt-10">(</span><span
class="cmtt-10">d</span><span
class="cmtt-10">,</span><span
class="cmtt-10">info</span><span
class="cmtt-10">)</span>
<!--l. 923--><p class="indent" > Returns a copy of the main diagonal.
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" /></dd></dl>
<!--l. 931--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">d</span> </dt><dd
class="description">A copy of the main diagonal.<br
class="newline" />A one-dimensional array of the appropriate type.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 939--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.14 </span> <a
id="x14-400003.2.14"></a>clip_diag &#8212; Cut out main diagonal</h5>
<!--l. 941--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">call</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">clip_diag</span><span
class="cmtt-10">(</span><span
class="cmtt-10">b</span><span
class="cmtt-10">,</span><span
class="cmtt-10">info</span><span
class="cmtt-10">)</span>
<!--l. 943--><p class="indent" > Returns a copy of <span class="lstinline"></span><span
class="cmtt-10">a</span> without the main diagonal.
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" /></dd></dl>
<!--l. 951--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">b</span> </dt><dd
class="description">A copy of <span class="lstinline"></span><span
class="cmtt-10">a</span> without the main diagonal.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 959--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.15 </span> <a
id="x14-410003.2.15"></a>tril &#8212; Return the lower triangle</h5>
<pre class="verbatim" id="verbatim-24">
&#x00A0;&#x00A0;&#x00A0;&#x00A0;call&#x00A0;a%tril(l,info[,&amp;
&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&amp;&#x00A0;diag,imin,imax,jmin,jmax,rscale,cscale,u])
</pre>
<!--l. 971--><p class="nopar" >
<!--l. 974--><p class="indent" > Returns the lower triangular part of submatrix <span class="lstinline"></span><span
class="cmtt-10">A</span><span
class="cmtt-10">(</span><span
class="cmtt-10">imin</span><span
class="cmtt-10">:</span><span
class="cmtt-10">imax</span><span
class="cmtt-10">,</span><span
class="cmtt-10">jmin</span><span
class="cmtt-10">:</span><span
class="cmtt-10">jmax</span><span
class="cmtt-10">)</span>,
optionally rescaling row/col indices to the range <span class="lstinline"></span><span
class="cmtt-10">1:</span><span
class="cmtt-10">imax</span><span
class="cmtt-10">-</span><span
class="cmtt-10">imin</span><span
class="cmtt-10">+1,1:</span><span
class="cmtt-10">jmax</span><span
class="cmtt-10">-</span><span
class="cmtt-10">jmin</span><span
class="cmtt-10">+1</span> and
returing the complementary upper triangle.
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" />
</dd><dt class="description">
<span
class="cmbx-10">diag</span> </dt><dd
class="description">Include diagonals up to this one; <span class="lstinline"></span><span
class="cmtt-10">diag</span><span
class="cmtt-10">=1</span> means the first superdiagonal,
<span class="lstinline"></span><span
class="cmtt-10">diag</span><span
class="cmtt-10">=-1</span> means the first subdiagonal. Default 0.
</dd><dt class="description">
<span
class="cmbx-10">imin,imax,jmin,jmax</span> </dt><dd
class="description">Minimum and maximum row and column indices.<br
class="newline" />Type: optional.
</dd><dt class="description">
<span
class="cmbx-10">rscale,cscale</span> </dt><dd
class="description">Whether to rescale row/column indices. Type: optional.</dd></dl>
<!--l. 992--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">l</span> </dt><dd
class="description">A copy of the lower triangle of <span class="lstinline"></span><span
class="cmtt-10">a</span>.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">u</span> </dt><dd
class="description">(optional) A copy of the upper triangle of <span class="lstinline"></span><span
class="cmtt-10">a</span>.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 1001--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.16 </span> <a
id="x14-420003.2.16"></a>triu &#8212; Return the upper triangle</h5>
<pre class="verbatim" id="verbatim-25">
&#x00A0;&#x00A0;&#x00A0;&#x00A0;call&#x00A0;a%triu(u,info[,&amp;
&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&amp;&#x00A0;diag,imin,imax,jmin,jmax,rscale,cscale,l])
</pre>
<!--l. 1012--><p class="nopar" >
<!--l. 1015--><p class="indent" > Returns the upper triangular part of submatrix <span class="lstinline"></span><span
class="cmtt-10">A</span><span
class="cmtt-10">(</span><span
class="cmtt-10">imin</span><span
class="cmtt-10">:</span><span
class="cmtt-10">imax</span><span
class="cmtt-10">,</span><span
class="cmtt-10">jmin</span><span
class="cmtt-10">:</span><span
class="cmtt-10">jmax</span><span
class="cmtt-10">)</span>,
optionally rescaling row/col indices to the range <span class="lstinline"></span><span
class="cmtt-10">1:</span><span
class="cmtt-10">imax</span><span
class="cmtt-10">-</span><span
class="cmtt-10">imin</span><span
class="cmtt-10">+1,1:</span><span
class="cmtt-10">jmax</span><span
class="cmtt-10">-</span><span
class="cmtt-10">jmin</span><span
class="cmtt-10">+1</span>,
and returing the complementary lower triangle.
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" />
</dd><dt class="description">
<span
class="cmbx-10">diag</span> </dt><dd
class="description">Include diagonals up to this one; <span class="lstinline"></span><span
class="cmtt-10">diag</span><span
class="cmtt-10">=1</span> means the first superdiagonal,
<span class="lstinline"></span><span
class="cmtt-10">diag</span><span
class="cmtt-10">=-1</span> means the first subdiagonal. Default 0.
</dd><dt class="description">
<span
class="cmbx-10">imin,imax,jmin,jmax</span> </dt><dd
class="description">Minimum and maximum row and column indices.<br
class="newline" />Type: optional.
</dd><dt class="description">
<span
class="cmbx-10">rscale,cscale</span> </dt><dd
class="description">Whether to rescale row/column indices. Type: optional.</dd></dl>
<!--l. 1033--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">u</span> </dt><dd
class="description">A copy of the upper triangle of <span class="lstinline"></span><span
class="cmtt-10">a</span>.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">l</span> </dt><dd
class="description">(optional) A copy of the lower triangle of <span class="lstinline"></span><span
class="cmtt-10">a</span>.<br
class="newline" />A variable of type <span class="lstinline"></span><span
class="cmtt-10">psb_Tspmat_type</span>.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 1045--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.17 </span> <a
id="x14-430003.2.17"></a>psb_set_mat_default &#8212; Set default storage format</h5>
<!--l. 1049--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">call</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">psb_set_mat_default</span><span
class="cmtt-10">(</span><span
class="cmtt-10">a</span><span
class="cmtt-10">)</span>
<!--l. 1051--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">a variable of <span class="lstinline"></span><span
class="cmtt-10">class</span><span
class="cmtt-10">(</span><span
class="cmtt-10">psb_T_base_sparse_mat</span><span
class="cmtt-10">)</span> requesting a new default
storage format.<br
class="newline" />Type: required.</dd></dl>
<!--l. 1063--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.18 </span> <a
id="x14-440003.2.18"></a>clone &#8212; Clone current object</h5>
<!--l. 1066--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-10">call</span><span
class="cmtt-10">&#x00A0;</span><span
class="cmtt-10">a</span><span
class="cmtt-10">%</span><span
class="cmtt-10">clone</span><span
class="cmtt-10">(</span><span
class="cmtt-10">b</span><span
class="cmtt-10">,</span><span
class="cmtt-10">info</span><span
class="cmtt-10">)</span>
<!--l. 1068--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">Type:</span> </dt><dd
class="description">Asynchronous.
</dd><dt class="description">
<span
class="cmbx-10">On Entry</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">a</span> </dt><dd
class="description">the sparse matrix.<br
class="newline" />Scope: <span
class="cmbx-10">local</span>.<br
class="newline" /></dd></dl>
<!--l. 1078--><p class="indent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">On Return</span> </dt><dd
class="description">
</dd><dt class="description">
<span
class="cmbx-10">b</span> </dt><dd
class="description">A copy of the input object.
</dd><dt class="description">
<span
class="cmbx-10">info</span> </dt><dd
class="description">Return code.</dd></dl>
<!--l. 1085--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark">3.2.19 </span> <a
id="x14-450003.2.19"></a>Named Constants</h5>
<!--l. 1087--><p class="noindent" >
<dl class="description"><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_dupl</span><span
class="cmbx-10">_ovwrt</span><span
class="cmbx-10">_</span> </dt><dd
class="description">Duplicate coefficients should be overwritten (i.e. ignore
duplications)
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_dupl</span><span
class="cmbx-10">_add</span><span
class="cmbx-10">_</span> </dt><dd
class="description">Duplicate coefficients should be added;
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_dupl</span><span
class="cmbx-10">_err</span><span
class="cmbx-10">_</span> </dt><dd
class="description">Duplicate coefficients should trigger an error conditino
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_upd</span><span
class="cmbx-10">_dflt</span><span
class="cmbx-10">_</span> </dt><dd
class="description">Default update strategy for matrix coefficients;
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_upd</span><span
class="cmbx-10">_srch</span><span
class="cmbx-10">_</span> </dt><dd
class="description">Update strategy based on search into the data structure;
</dd><dt class="description">
<span
class="cmbx-10">psb</span><span
class="cmbx-10">_upd</span><span
class="cmbx-10">_perm</span><span
class="cmbx-10">_</span> </dt><dd
class="description">Update strategy based on additional permutation data (see
tools routine description).</dd></dl>
<!--l. 1103--><div class="crosslinks"><p class="noindent">[<a
href="userhtmlse4.html" >next</a>] [<a
href="userhtmlsu5.html" >prev</a>] [<a
href="userhtmlsu5.html#tailuserhtmlsu5.html" >prev-tail</a>] [<a
href="userhtmlsu6.html" >front</a>] [<a
href="userhtmlsu7.html#userhtmlsu9.html" >up</a>] </p></div>
<!--l. 1103--><p class="indent" > <a
id="tailuserhtmlsu6.html"></a>
</body></html>