|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html >
|
|
|
|
<head><title>psb_norm1 — 1-Norm of Vector</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
|
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)">
|
|
|
|
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)">
|
|
|
|
<!-- html,3 -->
|
|
|
|
<meta name="src" content="userhtml.tex">
|
|
|
|
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
|
|
|
</head><body
|
|
|
|
>
|
|
|
|
<!--l. 467--><div class="crosslinks"><p class="noindent">[<a
|
|
|
|
href="userhtmlsu19.html" >next</a>] [<a
|
|
|
|
href="userhtmlsu14.html" >prev</a>] [<a
|
|
|
|
href="userhtmlsu14.html#tailuserhtmlsu14.html" >prev-tail</a>] [<a
|
|
|
|
href="userhtmlsu12.html#tailuserhtmlsu15.html">tail</a>] [<a
|
|
|
|
href="userhtmlsu12.html#userhtmlsu18.html" >up</a>] </p></div>
|
|
|
|
<h4 class="subsectionHead"><span class="titlemark">4.6 </span> <a
|
|
|
|
id="x24-610004.6"></a>psb_norm1 — 1-Norm of Vector</h4>
|
|
|
|
<!--l. 469--><p class="noindent" >This function computes the 1-norm of a vector <span
|
|
|
|
class="cmmi-10">x</span>.<br
|
|
|
|
class="newline" />If <span
|
|
|
|
class="cmmi-10">x </span>is a real vector it computes 1-norm as:
|
|
|
|
<center class="math-display" >
|
|
|
|
<img
|
|
|
|
src="userhtml8x.png" alt="asum ← ∥xi∥
|
|
|
|
" class="math-display" ></center>
|
|
|
|
<!--l. 472--><p class="nopar" > else if <span
|
|
|
|
class="cmmi-10">x </span>is a complex vector then it computes 1-norm as:
|
|
|
|
<center class="math-display" >
|
|
|
|
<img
|
|
|
|
src="userhtml9x.png" alt="asum ← ∥re(x)∥ + ∥im (x)∥
|
|
|
|
1 1
|
|
|
|
" class="math-display" ></center>
|
|
|
|
<!--l. 474--><p class="nopar" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="verbatim" id="verbatim-45">
|
|
|
|
psb_geasum(x, desc_a, info [,global])
|
|
|
|
 <br />psb_norm1(x, desc_a, info [,global])
|
|
|
|
</div>
|
|
|
|
<!--l. 480--><p class="nopar" >
|
|
|
|
<div class="table">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 482--><p class="indent" > <a
|
|
|
|
id="x24-610016"></a><hr class="float"><div class="float"
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="center"
|
|
|
|
>
|
|
|
|
<!--l. 483--><p class="noindent" >
|
|
|
|
<div class="tabular"> <table id="TBL-6" class="tabular"
|
|
|
|
cellspacing="0" cellpadding="0"
|
|
|
|
><colgroup id="TBL-6-1g"><col
|
|
|
|
id="TBL-6-1"><col
|
|
|
|
id="TBL-6-2"><col
|
|
|
|
id="TBL-6-3"></colgroup><tr
|
|
|
|
class="hline"><td><hr></td><td><hr></td><td><hr></td></tr><tr
|
|
|
|
style="vertical-align:baseline;" id="TBL-6-1-"><td style="white-space:nowrap; text-align:left;" id="TBL-6-1-1"
|
|
|
|
class="td11"><span
|
|
|
|
class="cmmi-10">asum </span></td><td style="white-space:nowrap; text-align:left;" id="TBL-6-1-2"
|
|
|
|
class="td11"><span
|
|
|
|
class="cmmi-10">x </span></td><td style="white-space:nowrap; text-align:left;" id="TBL-6-1-3"
|
|
|
|
class="td11"><span
|
|
|
|
class="cmbx-10">Function </span></td></tr><tr
|
|
|
|
class="hline"><td><hr></td><td><hr></td><td><hr></td></tr><tr
|
|
|
|
style="vertical-align:baseline;" id="TBL-6-2-"><td style="white-space:nowrap; text-align:left;" id="TBL-6-2-1"
|
|
|
|
class="td11">Short Precision Real</td><td style="white-space:nowrap; text-align:left;" id="TBL-6-2-2"
|
|
|
|
class="td11">Short Precision Real </td><td style="white-space:nowrap; text-align:left;" id="TBL-6-2-3"
|
|
|
|
class="td11">psb_geasum</td>
|
|
|
|
</tr><tr
|
|
|
|
style="vertical-align:baseline;" id="TBL-6-3-"><td style="white-space:nowrap; text-align:left;" id="TBL-6-3-1"
|
|
|
|
class="td11">Long Precision Real </td><td style="white-space:nowrap; text-align:left;" id="TBL-6-3-2"
|
|
|
|
class="td11">Long Precision Real </td><td style="white-space:nowrap; text-align:left;" id="TBL-6-3-3"
|
|
|
|
class="td11">psb_geasum</td>
|
|
|
|
</tr><tr
|
|
|
|
style="vertical-align:baseline;" id="TBL-6-4-"><td style="white-space:nowrap; text-align:left;" id="TBL-6-4-1"
|
|
|
|
class="td11">Short Precision Real</td><td style="white-space:nowrap; text-align:left;" id="TBL-6-4-2"
|
|
|
|
class="td11">Short Precision Complex</td><td style="white-space:nowrap; text-align:left;" id="TBL-6-4-3"
|
|
|
|
class="td11">psb_geasum</td>
|
|
|
|
</tr><tr
|
|
|
|
style="vertical-align:baseline;" id="TBL-6-5-"><td style="white-space:nowrap; text-align:left;" id="TBL-6-5-1"
|
|
|
|
class="td11">Long Precision Real </td><td style="white-space:nowrap; text-align:left;" id="TBL-6-5-2"
|
|
|
|
class="td11">Long Precision Complex </td><td style="white-space:nowrap; text-align:left;" id="TBL-6-5-3"
|
|
|
|
class="td11">psb_geasum</td>
|
|
|
|
</tr><tr
|
|
|
|
class="hline"><td><hr></td><td><hr></td><td><hr></td></tr><tr
|
|
|
|
style="vertical-align:baseline;" id="TBL-6-6-"><td style="white-space:nowrap; text-align:left;" id="TBL-6-6-1"
|
|
|
|
class="td11"> </td></tr></table></div></div>
|
|
|
|
<br /> <div class="caption"
|
|
|
|
><span class="id">Table 6: </span><span
|
|
|
|
class="content">Data types</span></div><!--tex4ht:label?: x24-610016 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><hr class="endfloat" />
|
|
|
|
</div>
|
|
|
|
<dl class="description"><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">Type:</span> </dt><dd
|
|
|
|
class="description">Synchronous.
|
|
|
|
</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 local portion of global dense matrix <span
|
|
|
|
class="cmmi-10">x</span>. <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 rank one or two array or an object of type
|
|
|
|
<a
|
|
|
|
href="userhtmlsu7.html#vdata"><span
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
class="cmtt-10">_T</span><span
|
|
|
|
class="cmtt-10">_vect</span><span
|
|
|
|
class="cmtt-10">_type</span></a> containing numbers of type specified in Table <a
|
|
|
|
href="#x24-610016">6<!--tex4ht:ref: tab:f90asum --></a>.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">desc</span><span
|
|
|
|
class="cmbx-10">_a</span> </dt><dd
|
|
|
|
class="description">contains data structures for communications.<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: an object of type <a
|
|
|
|
href="userhtmlsu5.html#descdata"><span
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
class="cmtt-10">_desc</span><span
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">global</span> </dt><dd
|
|
|
|
class="description">Specifies whether the computation should include the global reduction
|
|
|
|
across all processes.<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">global </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: a logical scalar. Default: <span class="obeylines-h"><span class="verb"><span
|
|
|
|
class="cmtt-10">global=.true.</span></span></span><br
|
|
|
|
class="newline" />
|
|
|
|
</dd><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">is the 1-norm of vector <span
|
|
|
|
class="cmmi-10">x</span>.<br
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
class="cmbx-10">global </span>unless the optional variable <span class="obeylines-h"><span class="verb"><span
|
|
|
|
class="cmtt-10">global=.false.</span></span></span> has been
|
|
|
|
specified<br
|
|
|
|
class="newline" />Specified as: a long precision real number.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">info</span> </dt><dd
|
|
|
|
class="description">Error code.<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">out</span>.<br
|
|
|
|
class="newline" />An integer value; 0 means no error has been detected.</dd></dl>
|
|
|
|
<!--l. 536--><p class="noindent" ><span
|
|
|
|
class="cmbx-12">Notes</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ol class="enumerate1" >
|
|
|
|
<li
|
|
|
|
class="enumerate" id="x24-61003x1">The computation of a global result requires a global communication, which
|
|
|
|
entails a significant overhead. It may be necessary and/or advisable to compute
|
|
|
|
multiple norms at the same time; in this case, it is possible to improve the
|
|
|
|
runtime efficiency by using the following scheme: <!--l. 543-->
|
|
|
|
<div class="lstlisting" id="listing-3"><span class="label"><a
|
|
|
|
id="x24-61004r1"></a></span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">vres</span><span
|
|
|
|
class="cmtt-10">(1)</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">=</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">psb_geasum</span><span
|
|
|
|
class="cmtt-10">(</span><span
|
|
|
|
class="cmtt-10">x1</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">desc_a</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">info</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">global</span><span
|
|
|
|
class="cmtt-10">=.</span><span
|
|
|
|
class="cmtt-10">false</span><span
|
|
|
|
class="cmtt-10">.)</span><span
|
|
|
|
class="cmtt-10"> </span><br /><span class="label"><a
|
|
|
|
id="x24-61005r2"></a></span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">vres</span><span
|
|
|
|
class="cmtt-10">(2)</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">=</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">psb_geasum</span><span
|
|
|
|
class="cmtt-10">(</span><span
|
|
|
|
class="cmtt-10">x2</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">desc_a</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">info</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">global</span><span
|
|
|
|
class="cmtt-10">=.</span><span
|
|
|
|
class="cmtt-10">false</span><span
|
|
|
|
class="cmtt-10">.)</span><span
|
|
|
|
class="cmtt-10"> </span><br /><span class="label"><a
|
|
|
|
id="x24-61006r3"></a></span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">vres</span><span
|
|
|
|
class="cmtt-10">(3)</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">=</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">psb_geasum</span><span
|
|
|
|
class="cmtt-10">(</span><span
|
|
|
|
class="cmtt-10">x3</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">desc_a</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">info</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">global</span><span
|
|
|
|
class="cmtt-10">=.</span><span
|
|
|
|
class="cmtt-10">false</span><span
|
|
|
|
class="cmtt-10">.)</span><span
|
|
|
|
class="cmtt-10"> </span><br /><span class="label"><a
|
|
|
|
id="x24-61007r4"></a></span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">call</span><span
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
class="cmtt-10">psb_sum</span><span
|
|
|
|
class="cmtt-10">(</span><span
|
|
|
|
class="cmtt-10">ictxt</span><span
|
|
|
|
class="cmtt-10">,</span><span
|
|
|
|
class="cmtt-10">vres</span><span
|
|
|
|
class="cmtt-10">(1:3))</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--l. 549--><p class="noindent" >In this way the global communication, which for small sizes is a latency-bound
|
|
|
|
operation, is invoked only once.</li></ol>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 554--><div class="crosslinks"><p class="noindent">[<a
|
|
|
|
href="userhtmlsu19.html" >next</a>] [<a
|
|
|
|
href="userhtmlsu14.html" >prev</a>] [<a
|
|
|
|
href="userhtmlsu14.html#tailuserhtmlsu14.html" >prev-tail</a>] [<a
|
|
|
|
href="userhtmlsu15.html" >front</a>] [<a
|
|
|
|
href="userhtmlsu12.html#userhtmlsu18.html" >up</a>] </p></div>
|
|
|
|
<!--l. 554--><p class="indent" > <a
|
|
|
|
id="tailuserhtmlsu15.html"></a>
|
|
|
|
</body></html>
|