<< max QD: 32 bytes decimal arithmetics norm >>

DD_QD (MuPAT) >> DD_QD (MuPAT) > QD: 32 bytes decimal arithmetics > min

min

minimal value of an array of QD numbers

Syntax

qd = min(QD)
QDrow = min(QD, "r"|1)
QDcol = min(QD, "c"|2)
[v, k] = min(QD..)

Parameters

QD

array of QD-encoded real numbers

qd

QD-encoded number.

QDrow

row of QD-encoded numbers.

QDcol

column of QD-encoded numbers.

v

One of the results qd, QDrow, QDcol, according to the used syntax.

k

vector: linearized index, indices of rows, or indices of columns in QD where the (first) minimum is found. Has the shape of v.

Description

v = min(QD), [v, k] = min(QD), and its input directional option v = min(QD,'r'|1|'c'|2) and [v, k] = min(QD,'r'|1|'c'|2) work for QD arrays as for usual decimal numbers. Please refer to the examples below and to the min() page to see details. "r" and 1 option values are equivalent ; "c" and 2 ones as well.

Please note that the syntax min(QD1,QD2,..) is not supported.

Examples

h = grand(3,5,"uin",-1,1); d = grand(3,5,3,"uin",0,2);
s = sign(h); d = d.*cat(3, s, s, s);
q = qd(h, d(:,:,1)*1e-17, d(:,:,2)*1e-34, d(:,:,3)*1e-51)

[v, k] = min(q)
[v, k] = min(q, "r")
[v, k] = min(q, 2)
--> h = grand(3,5,"uin",-1,1); d = grand(3,5,3,"uin",0,2);
--> s = sign(h); d = d.*cat(3, s, s, s);
--> q = qd(h, d(:,:,1)*1e-17, d(:,:,2)*1e-34, d(:,:,3)*1e-51)
 q  =
[d1]
  -1.   0.  -1.   0.   1.
  -1.  -1.   1.  -1.  -1.
  -1.   0.  -1.  -1.  -1.
[d2] 10^-17 *
  -1.   0.   0.   0.   0.
   0.  -2.   0.  -1.   0.
   0.   0.   0.  -2.   0.
[d3] 10^-34 *
  -1.   0.  -2.   0.   2.
  -2.  -2.   2.   0.  -1.
  -1.   0.   0.  -2.   0.
[d4] 10^-51 *
  -2.   0.  -1.   0.   2.
  -2.  -2.   0.  -2.  -2.
  -2.   0.   0.   0.   0.


--> [v, k] = min(q)
 k  =
   5.

 v  =
  -1.00000000000000002000000000000000163084848109243847770548190206E0


--> [v, k] = min(q, "r")
 k  =
   1.   2.   1.   3.   2.

 v  =
[d1]
  -1.  -1.  -1.  -1.  -1.
[d2] 10^-17 *
  -1.  -2.   0.  -2.   0.
[d3] 10^-34 *
  -1.  -2.  -2.  -2.  -1.
[d4] 10^-51 *
  -2.  -2.  -1.   0.  -2.


--> [v, k] = min(q, 2)
 k  =
   1.
   2.
   4.

 v  =
[d1]
  -1.
  -1.
  -1.
[d2] 10^-17 *
  -1.
  -2.
  -2.
[d3] 10^-34 *
  -1.
  -2.
  -2.
[d4] 10^-51 *
  -2.
  -2.
   0.

See Also

Authors

Copyright (C) 2018 - Samuel GOUGEON

Report an issue
<< max QD: 32 bytes decimal arithmetics norm >>