<< Overloads | DD_QD (MuPAT) | size >>

DD_QD (MuPAT) >> DD_QD (MuPAT) > concatenations

# concatenations

Horizontal and vertical concatenations of D, DD, QD arrays together

### Syntax

    [A , B]
    [A ; B]

[A , B] | D | DD | QD
D | . | x | x
DD | x | x | x
QD | x | x | x
| .... |
[A ; B] | D | DD | QD
D | . | x | x
DD | x | x | x
QD | x | x | x

### Parameters

D
  Array of Decimal numbers (Doubles)(8 bytes/number)
DD
  Array of Double-Double numbers (16 bytes/number)
QD
  Array of Quadruple-Double numbers (32 bytes/number)

### Description

The concatenations of D, DD, and QD together have the same meaning as for other regular arrays. When more than 2 operands are embraced, the concatenator is automatically applied in an iterative way.

When both neighboring operands have not the same typeof, the one having the lower resolution is automatically promoted to the other operand's typeof: D -> DD -> QD

### Examples

Homogeneous concatenations:

    a = ddrand(2,1), b = ddrand(2,2)
    [b a]           // Horizontal
    [a ; b(:,2)]    // Vertical

    --> a = ddrand(2,1), b = ddrand(2,2)
     a  =
    [d1]
       0.8833888
       0.6525135

    [d2] 10^-17 *
      -4.191495
       1.3547731

     b  =
    [d1]
       0.2146008   0.3616361
       0.312642    0.2922267

    [d2] 10^-17 *
      -0.809155   -1.762794
      -0.5817424  -2.1572964

    --> [b a]           // Horizontal
     ans  =
    [d1]
       0.2146008   0.3616361   0.8833888
       0.312642    0.2922267   0.6525135

    [d2] 10^-17 *
      -0.809155   -1.762794   -4.191495
      -0.5817424  -2.1572964   1.3547731

    --> [a ; b(:,2)]    // Vertical
     ans  =
    [d1]
       0.8833888
       0.6525135
       0.3616361
       0.2922267

    [d2] 10^-17 *
      -4.191495
       1.3547731
      -1.762794
      -2.1572964

Heterogeneous concatenations, with promotions

    [%pi  ddpi() qdpi()]
    [%e ; exp(dd(1))]

    --> [%pi  ddpi() qdpi()]
     ans  =
    [d1]
       3.1415927   3.1415927   3.1415927

    [d2] 10^-17 *
       0.   12.246468   12.246468

    [d3] 10^-34 *
       0.   0.  -29.947698

    [d4] 10^-51 *
       0.   0.   111.24542

    --> [%e ; exp(dd(1))]
     ans  =
    [d1]
       2.7182818
       2.7182818

    [d2] 10^-17 *
       0.
       14.456469

### See Also

- dd — builds an array of DD numbers
- qd — builds an array of QD numbers
- size
- DD & QD overloads — Available overloads for DD and QD real numbers

### Authors

Copyright (C) 2018 - Samuel GOUGEON

Report an issue
<< Overloads | DD_QD (MuPAT) | size >>