|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html >
|
|
|
|
<head><title>Dense Vector Data Structure</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. 1103--><div class="crosslinks"><p class="noindent">[<a
|
|
|
|
href="userhtmlsu10.html" >next</a>] [<a
|
|
|
|
href="userhtmlsu6.html" >prev</a>] [<a
|
|
|
|
href="userhtmlsu6.html#tailuserhtmlsu6.html" >prev-tail</a>] [<a
|
|
|
|
href="userhtmlse3.html#tailuserhtmlsu7.html">tail</a>] [<a
|
|
|
|
href="userhtmlsu7.html#userhtmlse4.html" >up</a>] </p></div>
|
|
|
|
<h4 class="subsectionHead"><span class="titlemark">3.3 </span> <a
|
|
|
|
id="x15-460003.3"></a>Dense Vector Data Structure</h4>
|
|
|
|
<!--l. 1105--><p class="noindent" >The <a
|
|
|
|
id="vdata"></a><span
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
class="cmtt-10">_T</span><span
|
|
|
|
class="cmtt-10">_vect</span><span
|
|
|
|
class="cmtt-10">_type </span>data structure encapsulates the dense vectors in a way similar
|
|
|
|
to sparse matrices, i.e. including a base type <a
|
|
|
|
id="vbasedata"></a><span
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
class="cmtt-10">_T</span><span
|
|
|
|
class="cmtt-10">_base</span><span
|
|
|
|
class="cmtt-10">_vect</span><span
|
|
|
|
class="cmtt-10">_type</span>. The user will
|
|
|
|
not, in general, access the vector components directly, but rather via the routines of
|
|
|
|
sec. <a
|
|
|
|
href="userhtmlse6.html#x40-770006">6<!--tex4ht:ref: sec:toolsrout --></a>. Among other simple things, we define here an extraction method that
|
|
|
|
can be used to get a full copy of the part of the vector stored on the local
|
|
|
|
process.
|
|
|
|
<!--l. 1115--><p class="indent" > The type declaration is shown in figure <a
|
|
|
|
href="#x15-46001r3">3<!--tex4ht:ref: fig:vectype --></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">I</span> </dt><dd
|
|
|
|
class="description">Integer;
|
|
|
|
</dd><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></dl>
|
|
|
|
<!--l. 1125--><p class="noindent" >The actual data is contained in the polymorphic component <span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">v</span><span
|
|
|
|
class="cmtt-10">%</span><span
|
|
|
|
class="cmtt-10">v</span>; the separation between
|
|
|
|
the application and the actual data is essential for cases where it is necessary to link
|
|
|
|
to data storage made available elsewhere outside the direct control of the
|
|
|
|
compiler/application, e.g. data stored in a graphics accelerator’s private
|
|
|
|
memory.
|
|
|
|
<!--l. 1131--><p class="indent" > <a
|
|
|
|
id="x15-46001r3"></a><hr class="float"><div class="float"
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="center"
|
|
|
|
>
|
|
|
|
<!--l. 1145--><p class="noindent" >
|
|
|
|
<div class="minipage"><pre class="verbatim" id="verbatim-26">
|
|
|
|
  type psb_T_base_vect_type
|
|
|
|
    TYPE(KIND_), allocatable :: v(:)
|
|
|
|
  end type psb_T_base_vect_type
|
|
|
|
  type psb_T_vect_type
|
|
|
|
    class(psb_T_base_vect_type), allocatable :: v
|
|
|
|
  end type  psb_T_vect_type
|
|
|
|
</pre>
|
|
|
|
<!--l. 1156--><p class="nopar" ></div></div>
|
|
|
|
<br /> <div class="caption"
|
|
|
|
><span class="id">Listing 3: </span><span
|
|
|
|
class="content"> The PSBLAS defined data type that contains a dense vector.</span></div><!--tex4ht:label?: x15-46001r3 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><hr class="endfloat" />
|
|
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.1 </span> <a
|
|
|
|
id="x15-470003.3.1"></a>Vector Methods</h5>
|
|
|
|
<!--l. 1171--><p class="noindent" >
|
|
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.2 </span> <a
|
|
|
|
id="x15-480003.3.2"></a>get_nrows — Get number of rows in a dense vector</h5>
|
|
|
|
<!--l. 1174--><p class="noindent" ><span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">nr</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">=</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">v</span><span
|
|
|
|
class="cmtt-10">%</span><span
|
|
|
|
class="cmtt-10">get_nrows</span><span
|
|
|
|
class="cmtt-10">()</span>
|
|
|
|
<!--l. 1176--><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">v</span> </dt><dd
|
|
|
|
class="description">the dense vector<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span><br
|
|
|
|
class="newline" /></dd></dl>
|
|
|
|
<!--l. 1186--><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 dense vector <span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">v</span>.</dd></dl>
|
|
|
|
<!--l. 1193--><p class="noindent" >
|
|
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.3 </span> <a
|
|
|
|
id="x15-490003.3.3"></a>sizeof — Get memory occupation in bytes of a dense vector</h5>
|
|
|
|
<!--l. 1196--><p class="noindent" ><span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">memory_size</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">=</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">v</span><span
|
|
|
|
class="cmtt-10">%</span><span
|
|
|
|
class="cmtt-10">sizeof</span><span
|
|
|
|
class="cmtt-10">()</span>
|
|
|
|
<!--l. 1198--><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">v</span> </dt><dd
|
|
|
|
class="description">the dense vector<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span><br
|
|
|
|
class="newline" /></dd></dl>
|
|
|
|
<!--l. 1208--><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. 1214--><p class="noindent" >
|
|
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.4 </span> <a
|
|
|
|
id="x15-500003.3.4"></a>set — Set contents of the vector</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-27">
|
|
|
|
 call  v%set(alpha[,first,last])
|
|
|
|
 call  v%set(vect[,first,last])
|
|
|
|
 call  v%zero()
|
|
|
|
</pre>
|
|
|
|
<!--l. 1228--><p class="nopar" >
|
|
|
|
<!--l. 1231--><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">v</span> </dt><dd
|
|
|
|
class="description">the dense vector<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span><br
|
|
|
|
class="newline" />
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">alpha</span> </dt><dd
|
|
|
|
class="description">A scalar value. <br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
class="newline" />Type: <span
|
|
|
|
class="cmbx-10">required </span><br
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
class="newline" />Specified as: a number of the data type indicated in Table <a
|
|
|
|
href="userhtmlsu10.html#x19-56001r1">1<!--tex4ht:ref: tab:f90axpby --></a>.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">first,last</span> </dt><dd
|
|
|
|
class="description">Boundaries for setting in the vector.<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
class="newline" />Type: <span
|
|
|
|
class="cmbx-10">optional </span><br
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
class="newline" />Specified as: integers.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">vect</span> </dt><dd
|
|
|
|
class="description">An array <br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
class="newline" />Type: <span
|
|
|
|
class="cmbx-10">required </span><br
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
class="newline" />Specified as: a number of the data type indicated in Table <a
|
|
|
|
href="userhtmlsu10.html#x19-56001r1">1<!--tex4ht:ref: tab:f90axpby --></a>.</dd></dl>
|
|
|
|
<!--l. 1250--><p class="noindent" >Note that a call to <span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">v</span><span
|
|
|
|
class="cmtt-10">%</span><span
|
|
|
|
class="cmtt-10">zero</span><span
|
|
|
|
class="cmtt-10">()</span> is provided as a shorthand, but is equivalent to a call
|
|
|
|
to <span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">v</span><span
|
|
|
|
class="cmtt-10">%</span><span
|
|
|
|
class="cmtt-10">set</span><span
|
|
|
|
class="cmtt-10">(</span><span
|
|
|
|
class="cmtt-10">zero</span><span
|
|
|
|
class="cmtt-10">)</span> with the <span class="lstinline"></span><span
|
|
|
|
class="cmtt-10">zero</span> constant having the appropriate type and
|
|
|
|
kind.
|
|
|
|
<!--l. 1254--><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">v</span> </dt><dd
|
|
|
|
class="description">the dense vector, with updated entries<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span><br
|
|
|
|
class="newline" /></dd></dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 1260--><p class="noindent" >
|
|
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.5 </span> <a
|
|
|
|
id="x15-510003.3.5"></a>get_vect — Get a copy of the vector contents</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-28">
|
|
|
|
extv = v%get_vect([n])
|
|
|
|
</pre>
|
|
|
|
<!--l. 1265--><p class="nopar" >
|
|
|
|
<!--l. 1267--><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">v</span> </dt><dd
|
|
|
|
class="description">the dense vector<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span><br
|
|
|
|
class="newline" />
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">n</span> </dt><dd
|
|
|
|
class="description">Size to be returned<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span>.<br
|
|
|
|
class="newline" />Type: <span
|
|
|
|
class="cmbx-10">optional</span>; default: entire vector.<br
|
|
|
|
class="newline" />
|
|
|
|
</dd></dl>
|
|
|
|
<!--l. 1281--><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">An allocatable array holding a copy of the dense vector
|
|
|
|
contents. If the argument <span
|
|
|
|
class="cmmi-10">n </span>is specified, the size of the returned array
|
|
|
|
equals the minimum between <span
|
|
|
|
class="cmmi-10">n </span>and the internal size of the vector, or 0 if
|
|
|
|
<span
|
|
|
|
class="cmmi-10">n </span>is negative; otherwise, the size of the array is the same as the internal
|
|
|
|
size of the vector.</dd></dl>
|
|
|
|
<!--l. 1290--><p class="noindent" >
|
|
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.6 </span> <a
|
|
|
|
id="x15-520003.3.6"></a>clone — Clone current object</h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-29">
|
|
|
|
call  x%clone(y,info)
|
|
|
|
</pre>
|
|
|
|
<!--l. 1294--><p class="nopar" >
|
|
|
|
<!--l. 1296--><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">x</span> </dt><dd
|
|
|
|
class="description">the dense vector.<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">local</span>.<br
|
|
|
|
class="newline" /></dd></dl>
|
|
|
|
<!--l. 1306--><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">y</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. 1313--><div class="crosslinks"><p class="noindent">[<a
|
|
|
|
href="userhtmlsu10.html" >next</a>] [<a
|
|
|
|
href="userhtmlsu6.html" >prev</a>] [<a
|
|
|
|
href="userhtmlsu6.html#tailuserhtmlsu6.html" >prev-tail</a>] [<a
|
|
|
|
href="userhtmlsu7.html" >front</a>] [<a
|
|
|
|
href="userhtmlsu7.html#userhtmlse4.html" >up</a>] </p></div>
|
|
|
|
<!--l. 1313--><p class="indent" > <a
|
|
|
|
id="tailuserhtmlsu7.html"></a>
|
|
|
|
</body></html>
|