+ All Categories
Home > Documents > VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6...

VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6...

Date post: 23-Jan-2021
Category:
Upload: others
View: 6 times
Download: 1 times
Share this document with a friend
89
VSIPL Quick Reference Guide VSIPL/Brief [3.1] Release 3.1 May 2013
Transcript
Page 1: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

VSIPLQuick Reference Guide

VSIPL/Brief [3.1]

Release 3.1May 2013

Page 2: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Contents

1 VSIPL Introduction 1

1.1 Introduction to VSIPL . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1.1 Platform Requirements . . . . . . . . . . . . . . . . . . . 1

1.1.2 VSIPL Functionality . . . . . . . . . . . . . . . . . . . . . 1

1.1.3 VSIPL Objects . . . . . . . . . . . . . . . . . . . . . . . . 2

1.1.4 Other Features . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2 Basic VSIPL Concepts . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2.1 General Library Design Principles . . . . . . . . . . . . . 3

1.2.2 Memory Management . . . . . . . . . . . . . . . . . . . . 3

1.2.3 Structure of a VSIPL application . . . . . . . . . . . . . . 6

1.2.4 VSIPL Naming Conventions . . . . . . . . . . . . . . . . . 7

1.2.5 Non-standard Scalar Data Types . . . . . . . . . . . . . . 8

1.2.6 Data Array Layout . . . . . . . . . . . . . . . . . . . . . . 9

1.2.7 Errors and Restrictions . . . . . . . . . . . . . . . . . . . 10

1.3 Implementation-specific Details . . . . . . . . . . . . . . . . . . . 10

1.3.1 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3.2 Symbols and Flags . . . . . . . . . . . . . . . . . . . . . . 11

1.3.3 Complex Variables . . . . . . . . . . . . . . . . . . . . . . 12

1.3.4 Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.3.5 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Getting the Best Performance 13

2.1 Version Information . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.2 Memory Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.3 Vector/Matrix Format . . . . . . . . . . . . . . . . . . . . . . . . 13

2.4 Complex Number Format . . . . . . . . . . . . . . . . . . . . . . 15

2.5 Error Checking and Debugging . . . . . . . . . . . . . . . . . . . 15

2.6 Support Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.7 Scalar Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.8 Random Number Generation . . . . . . . . . . . . . . . . . . . . 16

2.9 Vector and Elementwise Operations . . . . . . . . . . . . . . . . 16

2.10 Signal Processing Functions . . . . . . . . . . . . . . . . . . . . . 16

2.11 FFT Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.12 FIR Filter, Convolution and Correlation Functions . . . . . . . . 17

VSIPL/Brief [3.1] NASoftware i

Page 3: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

2.13 Linear Algebra Functions . . . . . . . . . . . . . . . . . . . . . . 17

2.14 Matrix and Vector Operations . . . . . . . . . . . . . . . . . . . . 18

2.15 LU Decomposition, Cholesky and QRD Functions . . . . . . . . . 18

2.16 Special Linear System Solvers . . . . . . . . . . . . . . . . . . . . 18

2.17 Controlling the Number of Threads . . . . . . . . . . . . . . . . . 19

3 Support Functions 20

3.1 Initilialisation and Finalisation . . . . . . . . . . . . . . . . . . . 20

vsip init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

vsip finalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Thread SetParams . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.2 Array and Block Functions . . . . . . . . . . . . . . . . . . . . . 20

vsip Dblockadmit P . . . . . . . . . . . . . . . . . . . . . . . . . 20

vsip blockbind P . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

vsip cblockbind P . . . . . . . . . . . . . . . . . . . . . . . . . . 20

vsip Dblockcreate P . . . . . . . . . . . . . . . . . . . . . . . . . 21

vsip Dblockdestroy P . . . . . . . . . . . . . . . . . . . . . . . . 21

vsip blockfind P . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

vsip cblockfind P . . . . . . . . . . . . . . . . . . . . . . . . . . 21

vsip blockrebind P . . . . . . . . . . . . . . . . . . . . . . . . . . 21

vsip cblockrebind P . . . . . . . . . . . . . . . . . . . . . . . . . 22

vsip blockrelease P . . . . . . . . . . . . . . . . . . . . . . . . . 22

vsip cblockrelease P . . . . . . . . . . . . . . . . . . . . . . . . . 22

vsip complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

vsip cstorage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.3 Vector View Functions . . . . . . . . . . . . . . . . . . . . . . . . 22

vsip Dvalldestroy P . . . . . . . . . . . . . . . . . . . . . . . . . 22

vsip Dvbind P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

vsip Dvcloneview P . . . . . . . . . . . . . . . . . . . . . . . . . 23

vsip Dvcreate P . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

vsip Dvdestroy P . . . . . . . . . . . . . . . . . . . . . . . . . . 23

vsip Dvget P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

vsip Dvgetattrib P . . . . . . . . . . . . . . . . . . . . . . . . . . 24

vsip Dvgetblock P . . . . . . . . . . . . . . . . . . . . . . . . . . 24

vsip Dvgetlength P . . . . . . . . . . . . . . . . . . . . . . . . . 24

vsip Dvgetoffset P . . . . . . . . . . . . . . . . . . . . . . . . . . 25

vsip Dvgetstride P . . . . . . . . . . . . . . . . . . . . . . . . . . 25

vsip vimagview P . . . . . . . . . . . . . . . . . . . . . . . . . . 25

VSIPL/Brief [3.1] NASoftware ii

Page 4: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip Dvput P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

vsip Dvputattrib P . . . . . . . . . . . . . . . . . . . . . . . . . 25

vsip Dvputlength P . . . . . . . . . . . . . . . . . . . . . . . . . 26

vsip Dvputoffset P . . . . . . . . . . . . . . . . . . . . . . . . . . 26

vsip Dvputstride P . . . . . . . . . . . . . . . . . . . . . . . . . 26

vsip vrealview P . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

vsip Dvsubview P . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.4 Matrix View Functions . . . . . . . . . . . . . . . . . . . . . . . . 27

vsip Dmalldestroy P . . . . . . . . . . . . . . . . . . . . . . . . . 27

vsip Dmbind P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

vsip Dmcloneview P . . . . . . . . . . . . . . . . . . . . . . . . . 27

vsip Dmcolview P . . . . . . . . . . . . . . . . . . . . . . . . . . 27

vsip Dmcreate P . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

vsip Dmdestroy P . . . . . . . . . . . . . . . . . . . . . . . . . . 28

vsip Dmdiagview P . . . . . . . . . . . . . . . . . . . . . . . . . 28

vsip Dmget P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

vsip Dmgetattrib P . . . . . . . . . . . . . . . . . . . . . . . . . 28

vsip Dmgetblock P . . . . . . . . . . . . . . . . . . . . . . . . . 28

vsip Dmgetcollength P . . . . . . . . . . . . . . . . . . . . . . . 29

vsip Dmgetcolstride P . . . . . . . . . . . . . . . . . . . . . . . . 29

vsip Dmgetoffset P . . . . . . . . . . . . . . . . . . . . . . . . . 29

vsip Dmgetrowlength P . . . . . . . . . . . . . . . . . . . . . . . 29

vsip Dmgetrowstride P . . . . . . . . . . . . . . . . . . . . . . . 29

vsip mimagview P . . . . . . . . . . . . . . . . . . . . . . . . . . 29

vsip Dmput P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

vsip Dmputattrib P . . . . . . . . . . . . . . . . . . . . . . . . . 30

vsip Dmputcollength P . . . . . . . . . . . . . . . . . . . . . . . 30

vsip Dmputcolstride P . . . . . . . . . . . . . . . . . . . . . . . 30

vsip Dmputoffset P . . . . . . . . . . . . . . . . . . . . . . . . . 30

vsip Dmputrowlength P . . . . . . . . . . . . . . . . . . . . . . . 31

vsip Dmputrowstride P . . . . . . . . . . . . . . . . . . . . . . . 31

vsip mrealview P . . . . . . . . . . . . . . . . . . . . . . . . . . 31

vsip Dmrowview P . . . . . . . . . . . . . . . . . . . . . . . . . . 31

vsip Dmsubview P . . . . . . . . . . . . . . . . . . . . . . . . . . 31

vsip Dmtransview P . . . . . . . . . . . . . . . . . . . . . . . . . 32

4 Scalar Functions 33

4.1 Real Scalar Functions . . . . . . . . . . . . . . . . . . . . . . . . 33

VSIPL/Brief [3.1] NASoftware iii

Page 5: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip acos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip asin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip atan f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip atan2 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip ceil f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip cos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip cosh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip exp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip floor f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip log f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip log10 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip mag f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip pow f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip sin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip sinh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip sqrt f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip tan f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

vsip tanh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.2 Complex Scalar Functions . . . . . . . . . . . . . . . . . . . . . . 34

vsip arg f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip CADD f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip cadd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip RCADD f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip rcadd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip CDIV f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip cdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip CRDIV f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip crdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip CEXP f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip cexp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip CJMUL f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

vsip cjmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip cmag f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip cmagsq f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip CMPLX f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip cmplx f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip CMUL f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip cmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

VSIPL/Brief [3.1] NASoftware iv

Page 6: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip RCMUL f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip rcmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip CNEG f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip cneg f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip CONJ f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip conj f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip CRECIP f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip crecip f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip CSQRT f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

vsip csqrt f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip CSUB f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip csub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip RCSUB f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip rcsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip CRSUB f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip crsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip imag f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip polar f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip real f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip RECT f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vsip rect f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.3 Index Scalar Functions . . . . . . . . . . . . . . . . . . . . . . . . 37

vsip MATINDEX . . . . . . . . . . . . . . . . . . . . . . . . . . 37

vsip matindex . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

vsip mcolindex . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

vsip mrowindex . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5 Random Number Generation 38

5.1 Random Number Functions . . . . . . . . . . . . . . . . . . . . . 38

vsip randcreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip randdestroy . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip randu f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip crandu f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip vrandu f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip cvrandu f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip randn f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip crandn f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

vsip vrandn f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

VSIPL/Brief [3.1] NASoftware v

Page 7: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip cvrandn f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6 Elementwise Functions 40

6.1 Elementary Mathematical Functions . . . . . . . . . . . . . . . . 40

vsip vacos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip macos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip vasin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip masin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip vatan f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip matan f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip vatan2 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip matan2 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip vcos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip mcos f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip vcosh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip mcosh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip vexp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vsip cvexp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip mexp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip cmexp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip vexp10 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip mexp10 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip vlog f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip cvlog f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip mlog f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip cmlog f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip vlog10 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip mlog10 f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip vsin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip msin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip vsinh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip msinh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vsip Dvsqrt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip Dmsqrt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip vtan f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip mtan f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip vtanh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip mtanh f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

VSIPL/Brief [3.1] NASoftware vi

Page 8: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

6.2 Unary Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip varg f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip marg f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip vceil f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip cvconj f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip cmconj f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

vsip Dvcumsum P . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip Dmcumsum P . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip veuler f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip meuler f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip vfloor f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip Dvmag P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip Dmmag P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip vcmagsq f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip mcmagsq f . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip Dvmeanval P . . . . . . . . . . . . . . . . . . . . . . . . . . 43

vsip Dmmeanval P . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dvmeansqval P . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dmmeansqval P . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dvmodulate P . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dvneg P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dmneg P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dvrecip P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip Dmrecip P . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip vrsqrt f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vsip mrsqrt f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip vsq f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip msq f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip Dvsumval P . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip Dmsumval P . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip vsumsqval f . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip msumsqval f . . . . . . . . . . . . . . . . . . . . . . . . . . 45

6.3 Binary Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip Dvadd P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip Dmadd P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

vsip rcvadd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip rcmadd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip Dsvadd P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

VSIPL/Brief [3.1] NASoftware vii

Page 9: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip Dsmadd P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip rscvadd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip rscmadd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip Dvdiv P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip Dmdiv P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip rcvdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip rcmdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vsip crvdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip crmdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip svdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip Dsmdiv P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip rscvdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip rscvsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip rscmdiv f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip rscmsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip Dvsdiv P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip Dmsdiv P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip Dvexpoavg P . . . . . . . . . . . . . . . . . . . . . . . . . . 47

vsip Dmexpoavg P . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip vhypot f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip mhypot f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip cvjmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip cmjmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip Dvmul P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip Dmmul P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip rcvmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip rcmmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip Dsvmul P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

vsip Dsmmul P . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip rscvmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip rscmmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip DvDmmul P . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip rvcmmul f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip Dvsub P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip Dmsub P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip crvsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip crmsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

vsip rcvsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

VSIPL/Brief [3.1] NASoftware viii

Page 10: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip rcmsub f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dsvsub P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dsmsub P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

6.4 Ternary Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dvam P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dvma P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dvmsa P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dvmsb P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dvsam P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

vsip Dvsbm P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip Dvsma P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip Dvsmsa P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

6.5 Logical Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip valltrue bl . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip malltrue bl . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip vanytrue bl . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip manytrue bl . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip Dvleq P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip Dmleq P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

vsip vlge P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip mlge P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip vlgt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip mlgt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip vlle P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip mlle P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip vllt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip mllt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

vsip Dvlne P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip Dmlne P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6.6 Selection Operations . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vclip P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vinvclip P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vindexbool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vmax f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vmaxmg f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vcmaxmgsq f . . . . . . . . . . . . . . . . . . . . . . . . . . 53

vsip vcmaxmgsqval f . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vmaxmgval f . . . . . . . . . . . . . . . . . . . . . . . . . . 54

VSIPL/Brief [3.1] NASoftware ix

Page 11: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip vmaxval f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vmin f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vminmg f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vcminmgsq f . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vcminmgsqval f . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vminmgval f . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip vminval f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

6.7 Bitwise and Boolean Logical Operators . . . . . . . . . . . . . . . 54

vsip vand P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

vsip mand P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vsip vnot P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vsip mnot P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vsip vor P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vsip mor P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vsip vxor P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vsip mxor P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

6.8 Element Generation and Copy . . . . . . . . . . . . . . . . . . . 55

vsip Dvcopy P P . . . . . . . . . . . . . . . . . . . . . . . . . . 56

vsip Dmcopy P P . . . . . . . . . . . . . . . . . . . . . . . . . . 56

vsip Dvfill P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

vsip Dmfill P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

vsip vramp P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

6.9 Manipulation Operations . . . . . . . . . . . . . . . . . . . . . . 57

vsip vcmplx f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

vsip mcmplx f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

vsip Dvgather P . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

vsip Dmgather P . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

vsip vimag f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

vsip mimag f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

vsip vpolar f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip mpolar f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip vreal f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip mreal f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip vrect f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip mrect f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip Dvscatter P . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip Dmscatter P . . . . . . . . . . . . . . . . . . . . . . . . . . 58

vsip Dvswap P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

VSIPL/Brief [3.1] NASoftware x

Page 12: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip Dmswap P . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

6.10 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

vsip vcsummgval f . . . . . . . . . . . . . . . . . . . . . . . . . . 59

7 Signal Processing Functions 60

7.1 FFT Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip ccfftip create f . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip ccfftop create f . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip crfftop create f . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip rcfftop create f . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip fft destroy f . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip fft getattr f . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip ccfftip f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip ccfftop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip crfftop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip rcfftop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

vsip ccfftmip create f . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip ccfftmop create f . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip crfftmop create f . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip rcfftmop create f . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip fftm destroy f . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip fftm getattr f . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip ccfftmip f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip ccfftmop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip crfftmop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip rcfftmop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

vsip ccfft2dip create f . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip ccfft2dop create f . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip crfft2dop create f . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip rcfft2dop create f . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip fft2d destroy f . . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip fft2d getattr f . . . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip ccfft2dip f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip ccfft2dop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip crfft2dop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

vsip rcfft2dop f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

7.2 Convolution/Correlation Functions . . . . . . . . . . . . . . . . . 63

vsip conv1d create f . . . . . . . . . . . . . . . . . . . . . . . . . 63

VSIPL/Brief [3.1] NASoftware xi

Page 13: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip conv1d destroy f . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip conv1d getattr f . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip convolve1d f . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip conv2d create f . . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip conv2d destroy f . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip conv2d getattr f . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip convolve2d f . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip Dcorr1d create P . . . . . . . . . . . . . . . . . . . . . . . . 63

vsip Dcorr1d destroy P . . . . . . . . . . . . . . . . . . . . . . . 63

vsip Dcorr1d getattr P . . . . . . . . . . . . . . . . . . . . . . . 64

vsip Dcorrelate1d P . . . . . . . . . . . . . . . . . . . . . . . . . 64

vsip Dcorr2d create P . . . . . . . . . . . . . . . . . . . . . . . . 64

vsip Dcorr2d destroy P . . . . . . . . . . . . . . . . . . . . . . . 64

vsip Dcorr2d getattr P . . . . . . . . . . . . . . . . . . . . . . . 64

vsip Dcorrelate2d P . . . . . . . . . . . . . . . . . . . . . . . . . 64

7.3 Window Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 64

vsip vcreate blackman f . . . . . . . . . . . . . . . . . . . . . . . 64

vsip vcreate cheby f . . . . . . . . . . . . . . . . . . . . . . . . . 64

vsip vcreate hanning f . . . . . . . . . . . . . . . . . . . . . . . 64

vsip vcreate kaiser f . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.4 Filter Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

vsip Dfir create P . . . . . . . . . . . . . . . . . . . . . . . . . . 65

vsip Dfir destroy P . . . . . . . . . . . . . . . . . . . . . . . . . 65

vsip Dfirflt P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

vsip Dfir getattr P . . . . . . . . . . . . . . . . . . . . . . . . . 65

vsip Dfir reset P . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.5 Miscellaneous signal Processing Functions . . . . . . . . . . . . . 65

vsip vhisto f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

8 Linear Algebra 66

8.1 Matrix and Vector Operations . . . . . . . . . . . . . . . . . . . . 66

vsip cmherm f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vsip cvjdot f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vsip gemp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vsip cgemp f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vsip gems f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vsip cgems f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vsip Dmprod P . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

VSIPL/Brief [3.1] NASoftware xii

Page 14: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip cmprodh P . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

vsip cmprodj P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

vsip Dmprodt P . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

vsip Dmvprod P . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

vsip Dmtrans P . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

vsip Dvdot P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

vsip Dvmprod P . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip vouter f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip cvouter f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

8.2 Special Linear System Solvers . . . . . . . . . . . . . . . . . . . . 68

vsip covsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip ccovsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip llsqsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip cllsqsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip toepsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

vsip ctoepsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

8.3 General Square Linear System Solver . . . . . . . . . . . . . . . . 69

vsip Dlud P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip Dlud create P . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip Dlud destroy P . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip Dlud getattr P . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip lusol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip clusol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

8.4 Symmetric Positive Definite Linear System Solver . . . . . . . . . 69

vsip chold f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip cchold f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip chold create f . . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip cchold create f . . . . . . . . . . . . . . . . . . . . . . . . . 69

vsip Dchold destroy P . . . . . . . . . . . . . . . . . . . . . . . 70

vsip Dchold getattr P . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip cholsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip ccholsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

8.5 Overdetermined Linear System Solver . . . . . . . . . . . . . . . 70

vsip qrd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip cqrd f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip qrd create f . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip cqrd create f . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip Dqrd destroy P . . . . . . . . . . . . . . . . . . . . . . . . . 70

VSIPL/Brief [3.1] NASoftware xiii

Page 15: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

vsip Dqrd getattr P . . . . . . . . . . . . . . . . . . . . . . . . . 70

vsip qrdprodq f . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

vsip cqrdprodq f . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

vsip qrdsolr f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

vsip cqrdsolr f . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

vsip qrsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

vsip cqrsol f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

8.6 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

vsip Dminvlu P . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

9 Glossary 72

VSIPL/Brief [3.1] NASoftware xiv

Page 16: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

1.1 Introduction to VSIPLThe purpose of the Vector, Signal, and Image Processing Library (VSIPL) is tosupport portable, high performance application programs. The VSIPL specifica-tion is based upon existing libraries that have evolved and matured over decadesof scientific and engineering computing. A layer of abstraction is added to sup-port portability across diverse memory and processor architectures. The primarydesign focus of the specification has been embedded signal processing platforms.Enhanced portability of workstation applications is a side benefit.

1.1.1 Platform Requirements

VSIPL was designed so that it could be implemented on a wide variety of hard-ware. In order to use VSIPL functions on a given platform, a VSIPL compliantlibrary must be available for the particular hardware and a tool-set (ANSI Ccompiler and linker) available for the operating system.

1.1.2 VSIPL Functionality

The VSIPL specification provides a number of functions to the programmer thatsupport high performance numerical computation on dense rectangular arrays.These are organised in the VSIPL documentation according to category. Theavailable categories include:

• Support

– Library initialisation and finalisation

– Object creation and interaction

– Memory management

• Basic Scalar Operations

• Basic Vector Operations

• Random Number Generation

• Signal Processing

– FFT operations

– Filtering

– Correlation and convolution

• Linear Algebra

VSIPL/Brief [3.1] NASoftware 1

Page 17: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

– Basic matrix operations

– Linear system solution

– Least-squares problem solution

Although there are many functions in the VSIPL specification, not all functionsare available in all libraries. The contents of a specific VSIPL library subset aredefined in a profile. As of the completion of VSIPL 1.0 two profiles have beenapproved by the VSIPL Forum, referred to as the ‘Core’ and ‘Core Lite’ profiles.The ‘Core’ profile includes most of the signal processing and matrix algebrafunctionality of the library. The ‘Core Lite’ profile includes a smaller subset,suitable for vector-based signal processing applications. The VSIPL specificationdefines more functions than are present in either of these profiles.

This library implements the ‘Core’ profile with some extensions.

1.1.3 VSIPL Objects

The main difference between the VSIPL standard and existing libraries is acleaner encapsulation of memory management through an ‘object-based’ design.In VSIPL, a block can be thought of as a contiguous area of memory for storage ofdata. A block consists of a data array, which is the memory used for data storage,and a block object, which is an abstract data type which stores informationnecessary for VSIPL to access the data array. VSIPL allows the user to constructa view of the data in a block as a vector, matrix, or higher dimensional object. Aview consists of a block, which contains the data of interest, and a view object,which is an abstract data type that stores information necessary for VSIPL toaccess the data of interest.

Blocks and views are opaque: they can only be created, accessed and destroyedvia library functions. Object data members are private to hide the details ofnon-portable memory hierarchy management. VSIPL library developers mayhide information peculiar to their implementations in the objects in order toprevent the application programmer from accidentally writing code that is nei-ther portable nor compatible.

Data arrays in VSIPL exist in one of two logical data spaces. These are theuser data space, and VSIPL data space. VSIPL functions may only operate ondata in VSIPL space. User supplied functions may only operate on data in userspace. Data may be moved between these logical spaces. Depending on thespecific implementation, this move may incur actual data movement penalties ormay simply be a bookkeeping procedure. The user should consider the data inVSIPL space to be inaccessible except through VSIPL functions.

VSIPL/Brief [3.1] NASoftware 2

Page 18: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

1.1.4 Other Features

Two versions of the library are described, referred to as development and per-formance libraries. These libraries operate to produce identical results withthe exception of error reporting and timing. The performance version of theVSIPL library does not provide any error detection or handling except in the caseof memory allocation. Other programming errors under a VSIPL performancelibrary may have unpredictable results, up to and including complete systemcrashes. The development library runs slower than the performance library butincludes more error detection capabilities.

1.2 Basic VSIPL Concepts1.2.1 General Library Design Principles

VSIPL supports high performance numerical computation on dense rectangulararrays, and incorporates the following well-established characteristics of existingscientific and engineering libraries:

1. Elements are stored in one-dimensional data arrays, which appear to theapplication programmer as a single contiguous block of memory.

2. Data arrays can be viewed as either real or complex, vectors or matrices.

3. All operations on data arrays are performed indirectly through view ob-jects, each of which specifies a particular view of a data array with partic-ular offset, length(s) and stride(s).

4. In general, the application programmer cannot combine operators in a sin-gle statement to evaluate expressions. Operators which return a scalar maybe combined, but most operators will return a view type or are void andmay not be combined.

Operators are restricted to views of a data array that can be specified by anoffset, lengths and strides. Views that are more arbitrary are converted intothese simple views by functions like gather and back again by functions likescatter. VSIPL does not support triangular or sparse matrices very well, thoughfuture extensions might address these. The main difference between the VSIPLand existing libraries is a cleaner encapsulation of the above principles throughan ‘object-based’ design. All of the view attributes are encapsulated in opaqueobjects: such an object can only be created, accessed and destroyed via libraryfunctions, which references it via a pointer.

1.2.2 Memory Management

The management of memory is important to efficient algorithm development.This is especially true in embedded systems, many of which are memory limited.

VSIPL/Brief [3.1] NASoftware 3

Page 19: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

In VSIPL memory management is handled by the implementation. This sectiondescribes VSIPL memory management and how the user interacts with VSIPLobjects.

Terminology

The terms user data, VSIPL data, admitted, and released are used throughoutthis document when describing memory allocation. It is important that thereader understands the terms that are defined in this section and in the Glossary.

Object Memory Allocation

All objects in VSIPL consist of abstract data types (ADT) that contain attributesdefining the underlying data accessed by the object. Certain of the attributesare accessible to the application programmer via access functions; however, theremay be any number of attributes assigned by the VSIPL library developer forinternal use. Each time an object is defined, memory must be allocated for theADT. All VSIPL objects are allocated by VSIPL library functions. There isno method by which the application programmer may allocate space for theseobjects outside of VSIPL. Most VSIPL objects are relatively small and of fixedsize; however, some of the objects created for signal processing or linear algebramay allocate large workspaces.

Data Memory Allocation

A data array is an area of memory where data is stored. Data arrays in VSIPLexist in one of two logical data spaces. These are the user data space, and VSIPLdata space. VSIPL functions may only operate on data in VSIPL space. Usersupplied functions may only operate on data in user space. Data may be movedbetween these logical spaces. Depending on the specific implementation, thismove may incur actual data movement penalties or may simply be a bookkeepingprocedure. The user should consider the data in VSIPL space to be inaccessibleexcept through VSIPL functions.

A data array allocated by the application, using any method not part of theVSIPL standard, is considered to be a user data array. The application has apointer to the user data array and knowledge of its type and size. Therefore theapplication can access a user data array directly using pointers, although it isnot always correct to do so.

A data array allocated by a VSIPL function call is referred to as a VSIPL dataarray. The user has no proper method to retrieve a pointer to such a data array;it may only be accessed via VSIPL function calls.

Users may access data arrays in VSIPL space using an entity referred to as ablock. The data array associated with a block is a contiguous series of elementsof a given type. There is one block type for each type of data processed byVSIPL.

VSIPL/Brief [3.1] NASoftware 4

Page 20: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

There are two categories of block: user blocks and VSIPL blocks. A user blockis one that has been associated with a user data array. A VSIPL block is onethat has been associated with a VSIPL data array. The data array referenced bythe block is referred to as being ‘bound’ to the block. The user must provide apointer to the associated data for a user block. The VSIPL library will allocatespace for the data associated with a VSIPL block. Blocks can also be createdwithout any data and then associated with data in user space. The process ofassociating user space data with a block is called binding . A block which doesnot have data bound to it may not be used, as there is no data to operate on.

A block that has been associated with data may exist in one of two states,admitted and released. The data in an admitted block is in the logical VSIPLdata space, and the data in a released block is in the logical user data space.The process of moving data from the logical VSIPL data space to the logical userdata space is called admission; the reverse process is called release.

Data in an admitted block is owned by the VSIPL library, and VSIPL functionsoperate on this data under the assumption that the data will only be modifiedusing VSIPL functions. VSIPL blocks are always in the admitted state. Userblocks may be in an admitted state. User data in an admitted block shall not beoperated on except by VSIPL functions. Direct manipulation of user data boundto an admitted block via pointers to the allocated memory is incorrect and maycause erroneous behaviour.

Data in a released block may be accessed by the user, but VSIPL functions shouldnot perform computation on it. User blocks are created in the released state.The block must be admitted to VSIPL before VSIPL functions can operate onthe data bound to the block. A user block may be admitted for use by VSIPLand released when direct access to the data is needed by the application program.A VSIPL block may not be released.

Blocks represent logically contiguous data areas in memory (physical layout isundefined for VSIPL space), but users often wish to operate on non-contiguoussubsets of these data areas. To provide support for such operations, VSIPLrequires that users operate on the data in a block through another object calleda view. Views allow the user to specify non-contiguous subsets of a data arrayand inform VSIPL how the data will be accessed (for example, as a vector ormatrix). When creating a vector view, the user specifies an offset into the block,a view length, and a stride value which specifies the number of elements (definedin the type of the block) to advance between each access. Thus, for a block whosecorresponding data array contains four elements, a view with an offset value ofzero, a stride of two, and a length of two represents a logical data set consistingof members zero and two of the original block. For a matrix view, stride andlength parameters are specified in each dimension, and a single offset is specified.By varying the stride, row-major or column-major matrices can be created.

A block may have any number of views created on it; this allows the user to use

VSIPL/Brief [3.1] NASoftware 5

Page 21: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

vector views to access particular rows or columns of a matrix view, for example.Since the blocks are typed, views are also typed. However, because views alsoinclude usage information (e.g. vector or matrix), there are multiple view typesfor each block type corresponding to how the data will be accessed. These typesare immutable; thus for example, a block cannot have both integer and floatviews associated with it. This would not be useful in any event because the datalayout inside VSIPL space is vendor specific.

New views of a block may be created directly using a block object, or indirectlyusing a previously created view of the block. Except for finding the real orimaginary view of a complex view, all views may be created directly using theblock object.

1.2.3 Structure of a VSIPL application

Although there are a number of ways to program an application, the basic VSIPLprogram consists of the following sequence:

VSIPL/Brief [3.1] NASoftware 6

Page 22: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

Destroy view(s)Release and destroy block(s)Finalise the VSIPL library

Obtain databind (or rebind) blocks to data

Operate on data using viewsRelease block(s) to user data space

Admit block(s) to VSIPL data space

Initialise VSIPL libraryCreate block(s)Create view(s) and bind them to block(s)Create object(s) for filters, FFTs, solvers, etc

Destroy object(s) for filters, FFTs, solvers, etc

Iterate?

A VSIPL program must initialise the VSIPL library with a call to vsip init

before calling any other VSIPL function. Any program that uses VSIPL andthat terminates must call vsip finalize before terminating. See the Supportchapter for additional conditions and restrictions on these functions.

1.2.4 VSIPL Naming Conventions

While there is nothing to prevent a programmer from writing VSIPL-compatiblefunctions, only those functions that are approved and included in formal VSIPLdocumentation are a part of VSIPL. Functions outside the standard should notuse the VSIPL naming conventions in order to avoid confusion and applicationporting problems. In particular, names outside of VSIPL should not start with

VSIPL/Brief [3.1] NASoftware 7

Page 23: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

vsip or vsipl, in either upper or lower case.

Names for VSIPL types, objects and functions have the following format:

vsip 〈depth〉〈shape〉basename 〈precision–type〉

The shape qualifier specifies scalar, vector or matrix; the depth qualifier specifiesreal or complex; the precision–type qualifier specifies the data type (boolean,integer, or float) and its precision.

The depth qualifier is r or c for real or complex, respectively. The real qualifieris understood (not included as part of the name) if there can be no confusion.For a generic name D is used to indicate either real or complex.

The shape qualifier is s, v or m for scalar, vector or matrix, respectively. Thescalar qualifier is understood (not included as part of the name) if there can beno confusion. For a generic name S is used to indicate any shape.

The precision–type qualifier is one of the following:

i signed integer bl booleansi short signed integer vi vector indexu unsigned integer mi matrix indexf float

This qualifier has no default value; it is only omitted on void functions. For ageneric name P is used to indicate any precision–type.

For example, the generic function vsip DSmag P takes the magnitude (absolutevalue) of its argument. Specific instances of this function could include:

vsip mag i (real) (scalar) integervsip cmag f complex (scalar) floatvsip vmag f vector of (real) floatsvsip cvmag f vector of complex floatsvsip mmag f matrix of (real) floatsvsip cmmag f matrix of complex floats

For functions with arguments of different depths, shapes or types, the quali-fiers may be repeated. For example the copy functions have two precision–typequalifiers corresponding to the data types of the source and destination arrays.

1.2.5 Non-standard Scalar Data Types

In general, VSIPL scalar data types correspond to particular C data types de-pending on the underlying implementation. However, ANSI C does not defineboolean or complex scalar types, both of which are defined in VSIPL. This sectionsummarises requirements for these data types.

VSIPL/Brief [3.1] NASoftware 8

Page 24: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

Boolean Data Types

The VSIPL boolean data type (bl) is either true or false when used by a VSIPLfunction which sets or uses the boolean type. If a numeric vector or matrix iscopied to a boolean vector or matrix then the value zero is copied to the booleanas false. Any other value is copied as true. If a boolean vector or matrix is copiedto a numeric vector or matrix then the value false is copied as a zero, and thevalue true is copied as positive one. If a VSIPL function returns a boolean scalarthen a false is returned as zero and a true is non-zero. If a scalar is tested asboolean using a VSIPL function then a zero is tested as false and a non-zero istested as true.

Complex Data Types

The definition of the complex scalar is available in public header files, and hasthe usual structure for complex data as normally defined in ANSI C programs. Ingeneral, users are encouraged to not use the structure directly, but to instead useVSIPL scalar functions for manipulating complex scalars. This should enhanceportability of user code.

1.2.6 Data Array Layout

A user data array that is bound to a block has a particular required layout,depending on the type of the block. This section describes the required layout ofthe user data array for various block types. The application programmer mustuse the data array formats for user data. These formats allow portable input ofuser data into VSIPL and portable output of VSIPL results to the application.

For basic VSIPL types, the user data array is simply contiguous memory of thecorresponding VSIPL type. This applies to floating-point, integer, boolean andvector index types.

For matrix index data, the user data array is contiguous memory of type vsip scalar vi;each matrix index element is two consecutive elements of type vsip scalar vi; thefirst element is the row, the second is the column. Note that the matrix indexelement in a user data array is not the same as vsip scalar mi.

For complex float or complex integer data, the user data array is either interleavedor split as described below. Both the interleaved and split formats are supportedfor user data. Note that the data format for complex user data arrays is not oftype vsip cscalar P.

Interleaved The user data array is contiguous memory of type vsip scalar P.The complex element is two consecutive elements of type vsip scalar P.The first element is the real component and the second is the imaginarycomponent.

Split The user data array consists of two contiguous memory regions of equal

VSIPL/Brief [3.1] NASoftware 9

Page 25: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

length, each of type vsip scalar P. The real and the imaginary regionsare determined when the memory is bound to the block. A complex elementconsists of corresponding elements from the real and imaginary regions.

1.2.7 Errors and Restrictions

Many functions require that their arguments be conformant. This means thatthe objects passed have compatible attributes: for example, size and shape ofmatrices, lengths of vectors or filter kernels.

If an argument is required to be valid, it means:

• a pointer is not NULL

• a flag is a member of the required enumerated type

• an object has been initialised and not destroyed.

Errors can occur for the following reasons:

1. an argument is outside the domain for calculation

2. over/underflow during calculation

3. failure to allocate memory

4. algorithm failure because of inappropriate data (as when a matrix does nothave full rank)

5. arguments are invalid, out of range, or non-conformant.

Only errors of type 5 are regarded as fatal: in this case, the development versionof the library will write a message to stderr and call exit.

Errors of types 3 and 4 are signalled through the return value of the function.A create function will return NULL if the allocation fails; functions with integerreturn codes use zero to indicate success.

The calling program is not alerted to errors of types 1 and 2.

1.3 Implementation-specific Details1.3.1 Types

The following VSIPL base types are available:

VSIPL/Brief [3.1] NASoftware 10

Page 26: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

vsip scalar i

vsip scalar si

vsip scalar u

vsip scalar bl vsip bool

vsip scalar vi vsip index

vsip scalar mi

vsip scalar f

vsip cscalar i

vsip cscalar si

vsip cscalar f

vsip offset

vsip stride

vsip length

VSIPL also passes information around in abstract data types. These objects areopaque structures (implemented as incomplete typedefs) and they can only becreated, accessed, and destroyed with library functions that reference them viaa pointer. Some are used to describe the data layout in memory; others storeinformation on filters, matrix decompositions, and so on. Some objects have a‘get attribute’ function that allows the user access to the internal values.

The following structures for passing data are available:

vsip block f vsip vview f vsip mview f

vsip block i vsip vview i vsip mview i

vsip block si vsip vview si vsip mview si

vsip block bl vsip vview bl

vsip block vi vsip vview vi

vsip block mi vsip vview mi

vsip cblock f vsip cvview f vsip cmview f

vsip cblock i vsip cvview i vsip cmview i

vsip cblock si vsip cvview si vsip cmview si

1.3.2 Symbols and Flags

The following symbolic constants are defined.

VSIP MIN SCALAR F VSIP MAX SCALAR F

VSIP MIN SCALAR I VSIP MAX SCALAR I

VSIP MIN SCALAR SI VSIP MAX SCALAR SI

VSIP MIN SCALAR BL VSIP MAX SCALAR BL

VSIP MIN SCALAR VI VSIP MAX SCALAR VI

VSIP TRUE

VSIP FALSE

VSIP PI

VSIPL/Brief [3.1] NASoftware 11

Page 27: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 1. VSIPL Introduction

Other symbols are defined in enumerated types. The valid choices are listed witheach function description.

1.3.3 Complex Variables

The preferred storage arrangement for complex data is split.

1.3.4 Hints

VSIPL provides the following mechanisms for the programmer to indicate pref-erences for optimisation: they are all ignored in the current implementation.

• Flags of the enumerated type vsip memory hint specified when allocatingor creating some objects.

• Flags of the enumerated type vsip alg hint used to indicate whetheralgorithmic optimisation should minimise execution time, memory use, ormaximise numerical accuracy.

• An indication of how many times an object will be used (filters and FFT’shave such a parameter).

1.3.5 Notation

The following standard mathematical notation is used in the function descrip-tions.

:= assignment operatori square root of −1|x| absolute value of the real number x|z| modulus of the complex number zbxc floor of the real number x (largest integer less than or equal to x)dxe ceiling of the real number x (smallest integer greater than or equal to x)z∗ conjugate of the complex number zMT transpose of the matrix MMH Hermitian (conjugate transpose) of the complex matrix M

Note that in expressions i is always the square root of −1; vectors and matricesare indexed with j and k.

An elementwise operation on vectors will be written C[j] := A[j] + B[j]. Some-times, the range of the index variable is not given explicitly; in such cases it isclear from the context that it runs over all the elements in the vectors and thatthe lengths of the vectors must be equal.

An M by N matrix has M rows and N columns.

VSIPL/Brief [3.1] NASoftware 12

Page 28: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

This section is a short guide for programmers using the NAS VSIPL Library. Itcontains explanations of library behaviour, and tips on selecting the right storageoptions for your data to increase performance.

2.1 Version InformationInformation about the version of the NAS VSIPL library you are using can befound in the comments at the top of the include file vsip.h. There is no waythat a program can determine the library version at run-time.

2.2 Memory AlignmentThe efficiency of many operations is improved if data within memory is correctlyaligned on certain word boundaries. This is only of concern for memory allocatedoutside VSIPL and then bound to a VSIPL block — any storage allocated bythe library via a create function is optimally aligned automatically.

Vectors and matrices can be loaded and stored faster if they are vector aligned.

The following table gives the vector alignment and minimum vector length forfloat data:

Technology Vector AligmentSSE 16AVX 32AltiVec 16

Alignment can be controlled using a function such as memalign. This is a Cfunction that is not in the ANSI standard but is available on many systems. Itis defined in malloc.h on Linux systems.

The following macro redefines malloc so that all memory allocation is optimallyaligned:

#include <malloc.h>

#define malloc(SIZE) memalign(16, SIZE)

Some operating systems (e.g. Apple’s OSX) automatically align all memory to a16-byte boundary so memalign is not needed.

2.3 Vector/Matrix FormatWhen available, vector and matrix calculations are done using single instruction,multiple data (SIMD) instructions to process several elements simultaneously.This imposes a minimum vector length given in the table below:

VSIPL/Brief [3.1] NASoftware 13

Page 29: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

Technology

minimumVector Length(floats)

SSE 4AVX 8AltiVec 4

For short ints (16 bits) the vector length should be twice that of the float vectorlength. If the vector unit supports doubles (64 bits), then the vector lengthshould be half that of floats.

For best performance all input and output vectors should:

• have a stride of 1

Vectors and matrices can be loaded and stored much quicker when theyare contiguous in memory. The library includes special optimisations fora stride length of 2 (which was added for interleaved complex numbers),but all other non-unit strides will be significantly slower than a stride of 1and, in many cases, almost as slow as unvectorised scalar code. Note that,a stride of −1 will also be significantly slower than a stride of +1.

• be vector aligned and have a vector/matrix view offset of zero or a multipleof the vector length.

VSIPL vector and matrix views have an option to offset the start of thevector/matrix from the start of the block; for optimal performance thisshould be zero or a multiple of the vector length otherwise the start of thevector/matrix will not be vector aligned.

• have length greater than or equal to the vector length

The vector unit works on arrays of the vector length so no speed up isgained by using the library on vectors of length less than this.

• have row (row major matrices) or column (column major matrices) lengthdivisible by the vector length

For a row major matrix: if the row length of a matrix is not divisible bythe vector length then the alignment of the first element of each row willchange for each row/column. For optimal performance the first element ofeach row should be vector aligned.

If the row length cannot be set to a number divisible by the vector length, amatrix view can be created with a column stride divisible by vector lengthand greater than the row length. This technique can be used to vectoralign the first element of every row.

The same rule applies to columns in column major matrices.

VSIPL/Brief [3.1] NASoftware 14

Page 30: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

• have a length divisible by the vector length

Any elements at the end of the vector which cannot be dealt with by thevector unit must be dealt with in normal scalar code, which will decreasethe performance. The decrease in performance becomes less important forlonger vectors.

2.4 Complex Number FormatVSIPL supports two storage formats for complex numbers: split and interleaved.Which format you use depends on personal choice or the task being performed.

Split This is the default format in this implementation of VSIPL. It is what isreturned when you call a create function. It is also the optimal format touse when calling most NAS VSIPL functions (see Linear Algebra sectionfor some exceptions).

Interleaved To create data blocks in this format, you must allocate the memoryyourself and then bind it to a VSIPL complex block. It is the optimalformat to use when calling some linear algebra functions.

The internal storage format does not change when you admit or release real orcomplex data.

2.5 Error Checking and DebuggingTwo versions of the NAS VSIPL library are provided: a performance versionand a development version. The development version of the library (signifiedby a ‘D’ in the library’s name) contains full error checking (as specified by theVSIPL standard) and should always be used when developing and debuggingapplications.

A few library functions return status information: always check the return codeof those that do.

The performance version of the library contains no error checking, and con-sequently runs faster than the development library. The performance libraryshould only be used with applications that have been run successfully with thedevelopment version of the library.

When timing code, the performance version of the library should be used.

Note: the performance version of the library reads in data before it knows howmuch will be used and as a result often reads more data than is needed. Thisis not a problem, except when using memory checkers such as Electric Fencewhich object to this behaviour. The development library only reads in the datait intends to use and so is safe to use with memory checkers.

VSIPL/Brief [3.1] NASoftware 15

Page 31: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

2.6 Support FunctionsAlways call vsip init and vsip finalize at the beginning and end of a pro-gram.

Note: For the AltiVec optimized library, calling vsip init will put the AltiVecunit into non-Java mode if it is not already. This speeds up most AltiVec in-structions.

See Memory Alignment and Vector/Matrix sections for full information on theoptimal creation of blocks and views.

Many of the VSIPL create and bind functions have a memory hint parameter.This parameter is ignored in the current version of the library.

2.7 Scalar FunctionsAs the vector unit works on arrays of the vector length, scalar functions in thelibrary are not vectorised.

2.8 Random Number GenerationThe random number generation functions have not been vectorised in the currentversion of the library.

2.9 Vector and Elementwise OperationsAll vector and elementwise operations work optimally on vectors which matchthe conditions given in Section 2.3. Complex vectors should be stored split (thedefault when using VSIPL create functions).

2.10 Signal Processing FunctionsAll signal processing operations work optimally on vectors which match the con-ditions given in Section 2.3. Complex vectors should be stored split (the defaultwhen using VSIPL create functions).

Most of the signal processing routines are split into three stages:

• a create stage

• a compute stage

• a destroy stage.

The library has been optimised to minimise the time taken to do the computestage, which means as much precomputation as possible is done in the createstage. If you are using the same signal processing routine on many vectors of thesame length, it is far quicker to just create the required signal processing objectonce and reuse it for each computation stage rather than recreating the objecteach time it is needed.

VSIPL/Brief [3.1] NASoftware 16

Page 32: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

2.11 FFT FunctionsTo get the best performance from an FFT, a vector must have length a multipleof the numbers 2, 4, 8, and 3 only. If a vector length is not a multiple of thesenumbers, a DFT may be done, which is considerably slower than an FFT.

Factors of 3 should be avoided if possible. An FFT will only be done for factorsof 3 if the length also has a factor of 16, otherwise a DFT is done.

When doing large FFT’s, optimal routines have been developed for the lengths:4096, 8192, 16384, 32768, and 65536. These lengths should be much quicker thanlengths of similar magnitude.

In-place FFT’s are normally faster than out-of-place FFT’s.

FFT’s are fastest with a scale factor of 1. However, if you need to use a differentscale factor, it is better to let the FFT routine do the scaling rather than to doit yourself.

The internal FFT routines only work on vector aligned data with a stride of1. If vectors are used which do not match these restrictions an internal copy ofthe vector will be made. This is an important consideration when using largevectors. Also, if complex vectors are not stored split an internal copy will bemade.

The current version of the NAS VSIPL library does not have any special FFTroutines for doing multiple FFT’s, so the time to do n single FFT’s will beapproximately the same as using the multiple FFT routines on a matrix of nrows.

The ntimes parameter to the FFT functions is ignored. The algorithmic hint isonly used in the FFT create function: if the VSIP ALG NOISE hint is used, theFFT create function will take significantly longer. By default, the algorithms areoptimised to minimise execution time.

2.12 FIR Filter, Convolution and Correlation Func-tions

These functions call the FFT functions internally and are therefore subject tothe same restrictions.

Hints are ignored with the exception of the internal calling of the FFT createfunction described in the FFT functions section.

2.13 Linear Algebra FunctionsFor optimal performance the vectors and matrices used with the linear algebrafunctions should match the conditions given in Section 2.3. (See also the sectionsbelow when using complex LU, complex Cholesky, or complex QRD functions).

VSIPL/Brief [3.1] NASoftware 17

Page 33: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

2.14 Matrix and Vector OperationsMatrix and vector operations should work optimally on row or column majormatrices (row major is the default), however, the restriction exists that all ma-trices passed to a function should be of the same order. For example, usingtwo row major matrices as input to a function and a column major as outputwill be slower than using all row major or all column major. When matricesare passed to NAS VSIPL functions that are not all of the same order, the li-brary will assume they are all row major and treat the column major matricesas strided matrices. (See also the sections below when using LU, Cholesky, orQRD functions).

2.15 LU Decomposition, Cholesky and QRD Func-tions

These functions have three separate stages:

• a create stage

• a compute stage

• a destroy stage.

The library has been optimised to minimise the time taken to do the computestage, which means as much precomputation as possible is done in the createstage. If you are using the linear algebra routine on many matrices of the samesize, it is far quicker to just create the required linear algebra object once andreuse it for each computation stage rather than recreating the object each timeit is needed.

If matrices of different orders or strided matrices are passed to these functions, aninternal copy will be made of the entire matrix before the computation is done.This is an important consideration when using large matrices. (Note: unalignedmatrices do NOT require internal copying provided they have a stride of one andall matrices used with the functions are of the same order).

COMPLEX: unlike the rest of the NAS VSIPL library, the complex versionsof these functions work on INTERLEAVED data. If non-interleaved complexmatrices or vectors are passed to these functions, an interleaved internal copywill be created. This is an important consideration when using large matrices.

When using the QRD functions, it is only necessary to save the Q matrix if usingthe qrdprodq function; the qrsol and qrdsolr do not need the Q matrix.

2.16 Special Linear System SolversThe covsol and llsqsol functions internally use the QRD functions and so havethe same requirements for optimal performance, including requiring interleaved

VSIPL/Brief [3.1] NASoftware 18

Page 34: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 2. Getting the Best Performance

complex data.

The toepsol functions are based on vector operations and so have the samerequirements for optimal performance.

2.17 Controlling the Number of ThreadsThe NAS VSIPL library is multithreaded and will take advantage of multiplecores on the processor invoking it. Utilising multiple threads is automatic:

• The maximum number of threads used is set when vsip init is called.

• The maximum number running at any one time is also set at that point.If a threaded routine is called with (say) 4 threads and we have hit thismaximum number running then four of them are shut down before the newfunction is executed.

• The number of threads invoked when a routine is called, is decided by thatroutine by reference to the data (vector or matrix) size specified in the call,to provide the best performance for that call.

It is possible to change the maximum number of threads used.

1. A threaded, and a non-threaded (“serial”) version of the library are pro-vided. If you wish to only ever use one thread in a library call, use theserial version of the library.

2. The maximum number of threads used for a specific function call, and themaximum number kept running at any one time, can be changed by acall to the routine Thread SetParams with arguments num threads andmax num running. This call, if used, must be made before the libraryinitialisation routine vsip init is called.

If no call to Thread SetParams is made, the library default values will beutilised.

VSIPL/Brief [3.1] NASoftware 19

Page 35: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

3.1 Initilialisation and Finalisation

Prototype Descriptionintvsip init(void * ptr);

Provides initialisation, allowing the li-brary to allocate and set a global state,and prepare to support the use ofVSIPL functionality by the user.

intvsip finalize(void * ptr);

Provides cleanup and releases resourcesused by VSIPL (if the last of a nestedseries of calls), allowing the library toguarantee that any resources allocatedby vsip init are no longer in use afterthe call is complete.

voidThread SetParams(vsip length num threads,vsip length max num running);

Allows the library to allocate a numberof threads.

3.2 Array and Block Functions

Prototype Descriptionintvsip Dblockadmit P(vsip Dblock P * block,vsip scalar bl update);

Admit a data block for VSIPL opera-tions.The following instances are supported:

vsip blockadmit fvsip blockadmit ivsip blockadmit sivsip cblockadmit fvsip cblockadmit ivsip cblockadmit sivsip blockadmit blvsip blockadmit vivsip blockadmit mi

vsip block P *vsip blockbind P(vsip scalar P * user data,vsip length num items,vsip memory hint hint);

Create and bind a VSIPL block to auser-allocated data array.The following instances are supported:

vsip blockbind fvsip blockbind ivsip blockbind sivsip blockbind blvsip blockbind vivsip blockbind mi

vsip cblock P *vsip cblockbind P(vsip scalar P * user data1,vsip scalar P * user data2,vsip length num items,vsip memory hint hint);

Create and bind a VSIPL complexblock to a user-allocated data array.The following instances are supported:

vsip cblockbind fvsip cblockbind ivsip cblockbind si

VSIPL/Brief [3.1] NASoftware 20

Page 36: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dblock P *vsip Dblockcreate P(vsip length num items,vsip memory hint hint);

Creates a VSIPL block and binds a(VSIPL-allocated) data array to it.The following instances are supported:

vsip blockcreate fvsip blockcreate ivsip blockcreate sivsip cblockcreate fvsip cblockcreate ivsip cblockcreate sivsip blockcreate blvsip blockcreate vivsip blockcreate mi

voidvsip Dblockdestroy P(vsip Dblock P * block);

Destroy a VSIPL block object and anymemory allocated for it by VSIPL.The following instances are supported:

vsip blockdestroy fvsip blockdestroy ivsip blockdestroy sivsip cblockdestroy fvsip cblockdestroy ivsip cblockdestroy sivsip blockdestroy blvsip blockdestroy vivsip blockdestroy mi

vsip scalar P *vsip blockfind P(const vsip block P * block);

Find the pointer to the data bound toa VSIPL released block object.The following instances are supported:

vsip blockfind fvsip blockfind ivsip blockfind sivsip blockfind blvsip blockfind vivsip blockfind mi

voidvsip cblockfind P(const vsip cblock P * block,vsip scalar P ** user data1,vsip scalar P ** user data2);

Find the pointer(s) to the data boundto a VSIPL released complex block ob-ject.The following instances are supported:

vsip cblockfind fvsip cblockfind ivsip cblockfind si

vsip scalar P *vsip blockrebind P(vsip block P * block,vsip scalar P * new data);

Rebind a VSIPL block to user-specifieddata.The following instances are supported:

vsip blockrebind fvsip blockrebind ivsip blockrebind sivsip blockrebind blvsip blockrebind vivsip blockrebind mi

VSIPL/Brief [3.1] NASoftware 21

Page 37: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvoidvsip cblockrebind P(vsip cblock P * block,vsip scalar P * new data1,vsip scalar P * new data2,vsip scalar P ** old data1,vsip scalar P ** old data2);

Rebind a VSIPL complex block to user-specified data.The following instances are supported:

vsip cblockrebind fvsip cblockrebind ivsip cblockrebind si

vsip scalar P *vsip blockrelease P(vsip block P * block,vsip scalar bl update);

Release a VSIPL block for direct useraccess.The following instances are supported:

vsip blockrelease fvsip blockrelease ivsip blockrelease sivsip blockrelease blvsip blockrelease vivsip blockrelease mi

voidvsip cblockrelease P(vsip cblock P * block,vsip scalar bl update,vsip scalar P ** user data1,vsip scalar P ** user data2);

Release a complex block from VSIPLfor direct user access.The following instances are supported:

vsip cblockrelease fvsip cblockrelease ivsip cblockrelease si

voidvsip complete(void);

Force all deferred VSIPL execution tocomplete.

vsip cmplx memvsip cstorage(void);

Returns the preferred complex storageformat for the system.

3.3 Vector View Functions

Prototype Descriptionvoidvsip Dvalldestroy P(vsip Dvview P * vector);

Destroy a vector, its associated block,and any VSIPL data array bound tothe block.The following instances are supported:

vsip valldestroy fvsip valldestroy ivsip valldestroy sivsip cvalldestroy fvsip cvalldestroy ivsip cvalldestroy sivsip valldestroy blvsip valldestroy vivsip valldestroy mi

VSIPL/Brief [3.1] NASoftware 22

Page 38: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dvview P *vsip Dvbind P(vsip Dblock P * block,vsip offset offset,vsip stride stride,vsip length length);

Create a vector view object and bind itto a block object.The following instances are supported:

vsip vbind fvsip vbind ivsip vbind sivsip cvbind fvsip cvbind ivsip cvbind sivsip vbind blvsip vbind vivsip vbind mi

vsip Dvview P *vsip Dvcloneview P(const vsip Dvview P * vector);

Create a clone of a vector view.The following instances are supported:

vsip vcloneview fvsip vcloneview ivsip vcloneview sivsip cvcloneview fvsip cvcloneview ivsip cvcloneview sivsip vcloneview blvsip vcloneview vivsip vcloneview mi

vsip Dvview P *vsip Dvcreate P(vsip length length,vsip memory hint hint);

Creates a block object and a vectorview object of the block.The following instances are supported:

vsip vcreate fvsip vcreate ivsip vcreate sivsip cvcreate fvsip cvcreate ivsip cvcreate sivsip vcreate blvsip vcreate vivsip vcreate mi

vsip Dblock P *vsip Dvdestroy P(vsip Dvview P * vector);

Destroy a vector view object and re-turn a pointer to the associated blockobject.The following instances are supported:

vsip vdestroy fvsip vdestroy ivsip vdestroy sivsip cvdestroy fvsip cvdestroy ivsip cvdestroy sivsip vdestroy blvsip vdestroy vivsip vdestroy mi

VSIPL/Brief [3.1] NASoftware 23

Page 39: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dscalar Pvsip Dvget P(const vsip Dvview P * vector,vsip index j);

Get the value of a specified element ofa vector view object.The following instances are supported:

vsip vget fvsip vget ivsip vget sivsip cvget fvsip cvget ivsip cvget sivsip vget blvsip vget vivsip vget mi

voidvsip Dvgetattrib P(const vsip Dvview P * vector,vsip Dvattr P * attr);

Return the attributes of a vector viewobject.The following instances are supported:

vsip vgetattrib fvsip vgetattrib ivsip vgetattrib sivsip cvgetattrib fvsip cvgetattrib ivsip cvgetattrib sivsip vgetattrib blvsip vgetattrib vivsip vgetattrib mi

vsip Dblock P *vsip Dvgetblock P(const vsip Dvview P * vector);

Get the block attribute of a vector viewobject.The following instances are supported:

vsip vgetblock fvsip vgetblock ivsip vgetblock sivsip cvgetblock fvsip cvgetblock ivsip cvgetblock sivsip vgetblock blvsip vgetblock vivsip vgetblock mi

vsip lengthvsip Dvgetlength P(const vsip Dvview P * vector);

Get the length attribute of a vectorview object.The following instances are supported:

vsip vgetlength fvsip vgetlength ivsip vgetlength sivsip cvgetlength fvsip cvgetlength ivsip cvgetlength sivsip vgetlength blvsip vgetlength vivsip vgetlength mi

VSIPL/Brief [3.1] NASoftware 24

Page 40: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip offsetvsip Dvgetoffset P(const vsip Dvview P * vector);

Get the offset attribute of a vector viewobject.The following instances are supported:

vsip vgetoffset fvsip vgetoffset ivsip vgetoffset sivsip cvgetoffset fvsip cvgetoffset ivsip cvgetoffset sivsip vgetoffset blvsip vgetoffset vivsip vgetoffset mi

vsip stridevsip Dvgetstride P(const vsip Dvview P * vector);

Get the stride attribute of a vector viewobject.The following instances are supported:

vsip vgetstride fvsip vgetstride ivsip vgetstride sivsip cvgetstride fvsip cvgetstride ivsip cvgetstride sivsip vgetstride blvsip vgetstride vivsip vgetstride mi

vsip vview P *vsip vimagview P(const vsip cvview P *complex vector);

Create a vector view object of theimaginary part of a complex vectorfrom a complex vector view object.The following instances are supported:

vsip vimagview fvsip vimagview ivsip vimagview si

voidvsip Dvput P(vsip Dvview P * vector,vsip index j,vsip Dscalar P value);

Set the value of a specified element ofa vector view object.The following instances are supported:

vsip vput fvsip vput ivsip vput sivsip cvput fvsip cvput ivsip cvput sivsip vput blvsip vput vivsip vput mi

vsip Dvview P *vsip Dvputattrib P(vsip Dvview P * ve3tor,const vsip Dvattr P * attr);

Set the attributes of a vector view ob-ject.The following instances are supported:

vsip vputattrib fvsip vputattrib ivsip vputattrib sivsip cvputattrib fvsip cvputattrib ivsip cvputattrib sivsip vputattrib blvsip vputattrib vivsip vputattrib mi

VSIPL/Brief [3.1] NASoftware 25

Page 41: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dvview P *vsip Dvputlength P(vsip Dvview P * vector,vsip length length);

Set the length attribute of a vector viewobject.The following instances are supported:

vsip vputlength fvsip vputlength ivsip vputlength sivsip cvputlength fvsip cvputlength ivsip cvputlength sivsip vputlength blvsip vputlength vivsip vputlength mi

vsip Dvview P *vsip Dvputoffset P(vsip Dvview P * vector,vsip offset offset);

Set the offset attribute of a vector viewobject.The following instances are supported:

vsip vputoffset fvsip vputoffset ivsip vputoffset sivsip cvputoffset fvsip cvputoffset ivsip cvputoffset sivsip vputoffset blvsip vputoffset vivsip vputoffset mi

vsip Dvview P *vsip Dvputstride P(vsip Dvview P * vector,vsip stride stride);

Set the stride attribute of a vector viewobject.The following instances are supported:

vsip vputstride fvsip vputstride ivsip vputstride sivsip cvputstride fvsip cvputstride ivsip cvputstride sivsip vputstride blvsip vputstride vivsip vputstride mi

vsip vview P *vsip vrealview P(const vsip cvview P *complex vector);

Create a vector view object of the realpart of a complex vector from a com-plex vector view object.The following instances are supported:

vsip vrealview fvsip vrealview ivsip vrealview si

vsip Dvview P *vsip Dvsubview P(const vsip Dvview P * vector,vsip index j,vsip length n);

Create a vector view object that is asubview of a vector view object.The following instances are supported:

vsip vsubview fvsip vsubview ivsip vsubview sivsip cvsubview fvsip cvsubview ivsip cvsubview sivsip vsubview blvsip vsubview vivsip vsubview mi

VSIPL/Brief [3.1] NASoftware 26

Page 42: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

3.4 Matrix View Functions

Prototype Descriptionvoidvsip Dmalldestroy P(vsip Dmview P * matrix);

Destroy a matrix, its associated block,and any VSIPL data array bound tothe block.The following instances are supported:

vsip malldestroy fvsip malldestroy ivsip malldestroy sivsip cmalldestroy fvsip cmalldestroy ivsip cmalldestroy sivsip malldestroy bl

vsip Dmview P *vsip Dmbind P(vsip Dblock P * block,vsip offset offset,vsip stride col stride,vsip length col length,vsip stride row stride,vsip length row length);

Create a matrix view object and bindit to a block object.The following instances are supported:

vsip mbind fvsip mbind ivsip mbind sivsip cmbind fvsip cmbind ivsip cmbind sivsip mbind bl

vsip Dmview P *vsip Dmcloneview P(const vsip Dmview P * matrix);

Create a clone of a matrix view.The following instances are supported:

vsip mcloneview fvsip mcloneview ivsip mcloneview sivsip cmcloneview fvsip cmcloneview ivsip cmcloneview sivsip mcloneview bl

vsip Dvview P *vsip Dmcolview P(const vsip Dmview P * matrix,vsip index j);

Create a vector view object of a spec-ified column of the source matrix viewobject.The following instances are supported:

vsip mcolview fvsip mcolview ivsip mcolview sivsip cmcolview fvsip cmcolview ivsip cmcolview sivsip mcolview bl

vsip Dmview P *vsip Dmcreate P(vsip length col length,vsip length row length,vsip major rc,vsip memory hint hint);

Creates a block object and matrix viewobject of the block.The following instances are supported:

vsip mcreate fvsip mcreate ivsip mcreate sivsip cmcreate fvsip cmcreate ivsip cmcreate sivsip mcreate bl

VSIPL/Brief [3.1] NASoftware 27

Page 43: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dblock P *vsip Dmdestroy P(vsip Dmview P * matrix);

Destroy a matrix view object and re-turns a pointer to the associated blockobject.The following instances are supported:

vsip mdestroy fvsip mdestroy ivsip mdestroy sivsip cmdestroy fvsip cmdestroy ivsip cmdestroy sivsip mdestroy bl

vsip Dvview P *vsip Dmdiagview P(const vsip Dmview P * matrix,vsip stride index);

Create a vector view object of a matrixdiagonal of a matrix view object.The following instances are supported:

vsip mdiagview fvsip mdiagview ivsip mdiagview sivsip cmdiagview fvsip cmdiagview ivsip cmdiagview sivsip mdiagview bl

vsip Dscalar Pvsip Dmget P(const vsip Dmview P * matrix,vsip index i,vsip index j);

Get the value of a specified element ofa matrix view object.The following instances are supported:

vsip mget fvsip mget ivsip mget sivsip cmget fvsip cmget ivsip cmget sivsip mget bl

voidvsip Dmgetattrib P(const vsip Dmview P * matrix,vsip Dmattr P * attr);

Get the attributes of a matrix view ob-ject.The following instances are supported:

vsip mgetattrib fvsip mgetattrib ivsip mgetattrib sivsip cmgetattrib fvsip cmgetattrib ivsip cmgetattrib sivsip mgetattrib bl

vsip Dblock P *vsip Dmgetblock P(const vsip Dmview P * matrix);

Get the block attribute of a matrixview object.The following instances are supported:

vsip mgetblock fvsip mgetblock ivsip mgetblock sivsip cmgetblock fvsip cmgetblock ivsip cmgetblock sivsip mgetblock bl

VSIPL/Brief [3.1] NASoftware 28

Page 44: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip lengthvsip Dmgetcollength P(const vsip Dmview P * matrix);

Get the column length attribute of amatrix view object.The following instances are supported:

vsip mgetcollength fvsip mgetcollength ivsip mgetcollength sivsip cmgetcollength fvsip cmgetcollength ivsip cmgetcollength sivsip mgetcollength bl

vsip stridevsip Dmgetcolstride P(const vsip Dmview P * matrix);

Get the column stride attribute of amatrix view object.The following instances are supported:

vsip mgetcolstride fvsip mgetcolstride ivsip mgetcolstride sivsip cmgetcolstride fvsip cmgetcolstride ivsip cmgetcolstride sivsip mgetcolstride bl

vsip offsetvsip Dmgetoffset P(const vsip Dmview P * matrix);

Get the offset attribute of a matrixview object.The following instances are supported:

vsip mgetoffset fvsip mgetoffset ivsip mgetoffset sivsip cmgetoffset fvsip cmgetoffset ivsip cmgetoffset sivsip mgetoffset bl

vsip lengthvsip Dmgetrowlength P(const vsip Dmview P * matrix);

Get the row length attribute of a ma-trix view object.The following instances are supported:

vsip mgetrowlength fvsip cmgetrowlength fvsip cmgetrowlength ivsip cmgetrowlength si

vsip stridevsip Dmgetrowstride P(const vsip Dmview P * matrix);

Get the row stride attribute of a matrixview object.The following instances are supported:

vsip mgetrowstride fvsip mgetrowstride ivsip mgetrowstride sivsip cmgetrowstride fvsip cmgetrowstride ivsip cmgetrowstride sivsip mgetrowstride bl

vsip mview P *vsip mimagview P(const vsip cmview P *complex matrix);

Create a matrix view object of theimaginary part of complex matrix froma complex matrix view object.The following instances are supported:

vsip mimagview fvsip mimagview ivsip mimagview si

VSIPL/Brief [3.1] NASoftware 29

Page 45: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvoidvsip Dmput P(const vsip Dmview P * matrix,vsip index i,vsip index j,vsip Dscalar P value);

Set the value of a specified element ofa matrix view object.The following instances are supported:

vsip mput fvsip mput ivsip mput sivsip cmput fvsip cmput ivsip cmput sivsip mput bl

vsip Dmview P *vsip Dmputattrib P(vsip Dmview P * matrix,const vsip Dmattr P * attr);

Set the attributes of a matrix view ob-ject.The following instances are supported:

vsip mputattrib fvsip mputattrib ivsip mputattrib sivsip cmputattrib fvsip cmputattrib ivsip cmputattrib sivsip mputattrib bl

vsip Dmview P *vsip Dmputcollength P(vsip Dmview P * matrix,vsip length n2);

Set the column length attribute of amatrix view object.The following instances are supported:

vsip mputcollength fvsip mputcollength ivsip mputcollength sivsip cmputcollength fvsip cmputcollength ivsip cmputcollength sivsip mputcollength bl

vsip Dmview P *vsip Dmputcolstride P(vsip Dmview P * matrix,vsip stride s2);

Set the column stride attribute of a ma-trix view object.The following instances are supported:

vsip mputcolstride fvsip mputcolstride ivsip mputcolstride sivsip cmputcolstride fvsip cmputcolstride ivsip cmputcolstride sivsip mputcolstride bl

vsip Dmview P *vsip Dmputoffset P(vsip Dmview P * matrix,vsip offset offset);

Set the offset attribute of a matrix viewobject.The following instances are supported:

vsip mputoffset fvsip mputoffset ivsip mputoffset sivsip cmputoffset fvsip cmputoffset ivsip cmputoffset sivsip mputoffset bl

VSIPL/Brief [3.1] NASoftware 30

Page 46: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dmview P *vsip Dmputrowlength P(vsip Dmview P * matrix,vsip length n1);

Set the row length attribute of a matrixview object.The following instances are supported:

vsip mputrowlength fvsip mputrowlength ivsip mputrowlength sivsip cmputrowlength fvsip cmputrowlength ivsip cmputrowlength sivsip mputrowlength bl

vsip Dmview P *vsip Dmputrowstride P(vsip Dmview P * matrix,vsip stride s1);

Set the row stride attribute of a matrixview object.The following instances are supported:

vsip mputrowstride fvsip mputrowstride ivsip mputrowstride sivsip cmputrowstride fvsip cmputrowstride ivsip cmputrowstride sivsip mputrowstride bl

vsip mview P *vsip mrealview P(const vsip cmview P *complex matrix);

Create a matrix view object of the realpart of complex matrix from a complexmatrix view object.The following instances are supported:

vsip mrealview fvsip mrealview ivsip mrealview si

vsip Dvview P *vsip Dmrowview P(const vsip Dmview P * matrix,vsip index i);

Create a vector view object of a speci-fied row of the source matrix view ob-ject.The following instances are supported:

vsip mrowview fvsip mrowview ivsip mrowview sivsip cmrowview fvsip cmrowview ivsip cmrowview sivsip mrowview bl

vsip Dmview P *vsip Dmsubview P(const vsip Dmview P * matrix,vsip index i,vsip index j,vsip length m,vsip length n);

Create a matrix view object that is asubview of matrix view object.The following instances are supported:

vsip msubview fvsip msubview ivsip msubview sivsip cmsubview fvsip cmsubview ivsip cmsubview sivsip msubview bl

VSIPL/Brief [3.1] NASoftware 31

Page 47: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 3. Support Functions

Prototype Descriptionvsip Dmview P *vsip Dmtransview P(const vsip Dmview P * matrix);

Create a matrix view object that is thetranspose of a matrix view object.The following instances are supported:

vsip mtransview fvsip mtransview ivsip mtransview sivsip cmtransview fvsip cmtransview ivsip cmtransview sivsip mtransview bl

VSIPL/Brief [3.1] NASoftware 32

Page 48: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 4. Scalar Functions

4.1 Real Scalar Functions

Prototype Descriptionvsip scalar fvsip acos f(const vsip scalar f A);

Computes the principal radian value in[0, π] of the inverse cosine of a scalar.

vsip scalar fvsip asin f(const vsip scalar f A);

Computes the principal radian value in[0, π] of the inverse sine of a scalar.

vsip scalar fvsip atan f(const vsip scalar f A);

Computes the principal radian value in[−π/2, π/2] of the inverse tangent of ascalar.

vsip scalar fvsip atan2 f(const vsip scalar f A,const vsip scalar f B);

Computes the four-quadrant radianvalue in [−π, π] of the inverse tangentof the ratio of two scalars.

vsip scalar fvsip ceil f(const vsip scalar f A);

Computes the ceiling of a scalar.

vsip scalar fvsip cos f(const vsip scalar f A);

Computes the cosine of a scalar anglein radians.

vsip scalar fvsip cosh f(const vsip scalar f A);

Computes the hyperbolic cosine of ascalar.

vsip scalar fvsip exp f(const vsip scalar f A);

Computes the exponential of a scalar.

vsip scalar fvsip floor f(const vsip scalar f A);

Computes the floor of a scalar.

vsip scalar fvsip log f(const vsip scalar f A);

Computes the natural logarithm of ascalar.

vsip scalar fvsip log10 f(const vsip scalar f A);

Computes the base 10 logarithm of ascalar.

vsip scalar fvsip mag f(const vsip scalar f A);

Computes the magnitude (absolutevalue) of a scalar.

vsip scalar fvsip pow f(const vsip scalar f A,const vsip scalar f B);

Computes the power function of twoscalars.

vsip scalar fvsip sin f(const vsip scalar f A);

Computes the sine of a scalar angle inradians.

vsip scalar fvsip sinh f(const vsip scalar f A);

Computes the hyperbolic sine of ascalar.

vsip scalar fvsip sqrt f(const vsip scalar f A);

Computes the square root of a scalar.

vsip scalar fvsip tan f(const vsip scalar f A);

Computes the tangent of a scalar anglein radians.

VSIPL/Brief [3.1] NASoftware 33

Page 49: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 4. Scalar Functions

Prototype Descriptionvsip scalar fvsip tanh f(const vsip scalar f A);

Computes the hyperbolic tangent of ascalar.

4.2 Complex Scalar Functions

Prototype Descriptionvsip scalar fvsip arg f(vsip cscalar f x);

Returns the argument in radians[−π, π] of a complex scalar.

voidvsip CADD f(vsip cscalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex sum of twoscalars.

vsip cscalar fvsip cadd f(vsip cscalar f x,vsip cscalar f y);

Computes the complex sum of twoscalars.

voidvsip RCADD f(vsip scalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex sum of twoscalars.

vsip cscalar fvsip rcadd f(vsip scalar f x,vsip cscalar f y);

Computes the complex sum of twoscalars.

voidvsip CDIV f(vsip cscalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex quotient of twoscalars.

vsip cscalar fvsip cdiv f(vsip cscalar f x,vsip cscalar f y);

Computes the complex quotient of twoscalars.

voidvsip CRDIV f(vsip cscalar f x,vsip scalar f y,vsip cscalar f * z);

Computes the complex quotient of twoscalars.

vsip cscalar fvsip crdiv f(vsip cscalar f x,vsip scalar f y);

Computes the complex quotient of twoscalars.

voidvsip CEXP f(vsip cscalar f x,vsip cscalar f * y);

Computes the exponential of a scalar.

vsip cscalar fvsip cexp f(const vsip cscalar f A);

Computes the exponential of a scalar.

voidvsip CJMUL f(vsip cscalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the product a complex scalarwith the conjugate of a second complexscalar.

VSIPL/Brief [3.1] NASoftware 34

Page 50: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 4. Scalar Functions

Prototype Descriptionvsip cscalar fvsip cjmul f(vsip cscalar f x,vsip cscalar f y);

Computes the product a complex scalarwith the conjugate of a second complexscalar.

vsip cscalar fvsip cmag f(const vsip cscalar f A);

Computes the magnitude (absolutevalue) of a scalar.

vsip scalar fvsip cmagsq f(vsip cscalar f x);

Computes the magnitude squared of acomplex scalar.

voidvsip CMPLX f(vsip scalar f a,vsip scalar f b,vsip cscalar f * r);

Form a complex scalar from two realscalars.

vsip cscalar fvsip cmplx f(vsip scalar f re,vsip scalar f im);

Form a complex scalar from two realscalars.

voidvsip CMUL f(vsip cscalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex product of twoscalars.

vsip cscalar fvsip cmul f(vsip cscalar f x,vsip cscalar f y);

Computes the complex product of twoscalars.

voidvsip RCMUL f(vsip scalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex product of twoscalars.

vsip cscalar fvsip rcmul f(vsip scalar f x,vsip cscalar f y);

Computes the complex product of twoscalars.

voidvsip CNEG f(vsip cscalar f x,vsip cscalar f * y);

Computes the negation of a complexscalar.

vsip cscalar fvsip cneg f(vsip cscalar f x);

Computes the negation of a complexscalar.

voidvsip CONJ f(vsip cscalar f x,vsip cscalar f * y);

Computes the complex conjugate of ascalar.

vsip cscalar fvsip conj f(vsip cscalar f x);

Computes the complex conjugate of ascalar.

voidvsip CRECIP f(vsip cscalar f x,vsip cscalar f * y);

Computes the reciprocal of a complexscalar.

vsip cscalar fvsip crecip f(vsip cscalar f x);

Computes the reciprocal of a complexscalar.

voidvsip CSQRT f(vsip cscalar f x,vsip cscalar f * y);

Computes the square root a complexscalar.

VSIPL/Brief [3.1] NASoftware 35

Page 51: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 4. Scalar Functions

Prototype Descriptionvsip cscalar fvsip csqrt f(vsip cscalar f x);

Computes the square root a complexscalar.

voidvsip CSUB f(vsip cscalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex difference oftwo scalars.

vsip cscalar fvsip csub f(vsip cscalar f x,vsip cscalar f y);

Computes the complex difference oftwo scalars.

voidvsip RCSUB f(vsip scalar f x,vsip cscalar f y,vsip cscalar f * z);

Computes the complex difference oftwo scalars.

vsip cscalar fvsip rcsub f(vsip scalar f x,vsip cscalar f y);

Computes the complex difference oftwo scalars.

voidvsip CRSUB f(vsip cscalar f x,vsip scalar f y,vsip cscalar f * z);

Computes the complex difference oftwo scalars.

vsip cscalar fvsip crsub f(vsip cscalar f x,vsip scalar f y);

Computes the complex difference oftwo scalars.

vsip scalar fvsip imag f(vsip cscalar f x);

Extract the imaginary part of a com-plex scalar.

voidvsip polar f(vsip cscalar f a,vsip scalar f * r,vsip scalar f * t);

Convert a complex scalar from rectan-gular to polar form. The polar dataconsists of a real scalar containing theradius and a corresponding real scalarcontaining the argument (angle) of thecomplex scalar.

vsip scalar fvsip real f(vsip cscalar f x);

Extract the real part of a complexscalar.

voidvsip RECT f(vsip scalar f radius,vsip scalar f theta,vsip cscalar f * r);

Convert a pair of real scalars from com-plex polar to complex rectangular form.

vsip cscalar fvsip rect f(vsip scalar f r,vsip scalar f t);

Convert a pair of real scalars from com-plex polar to complex rectangular form.

VSIPL/Brief [3.1] NASoftware 36

Page 52: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 4. Scalar Functions

4.3 Index Scalar Functions

Prototype Descriptionvoidvsip MATINDEX(vsip index r,vsip index c,vsip scalar mi * mi);

Form a matrix index from two vectorindices.

vsip scalar mivsip matindex(vsip index r,vsip index c);

Form a matrix index from two vectorindices.

vsip indexvsip mcolindex(vsip scalar mi mi);

Returns the column vector index froma matrix index.

vsip indexvsip mrowindex(vsip scalar mi mi);

Returns the row vector index from amatrix index.

VSIPL/Brief [3.1] NASoftware 37

Page 53: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 5. Random Number Generation

5.1 Random Number Functions

Prototype Descriptionvsip randstate *vsip randcreate(const vsip index seed,const vsip index numprocs,const vsip index id,const vsip rng portable);

Create a random number generatorstate object.

intvsip randdestroy(vsip randstate * rand);

Destroys (frees the memory used by) arandom number generator state object.Returns zero on success, non-zero onfailure.

vsip scalar fvsip randu f(vsip randstate * state);

Generate a uniformly distributed(pseudo-)random number. Floatingpoint values are uniformly distributedover the open interval (0,1). Integerdeviates are uniformly distributed overthe open interval (0, 231 − 1).

vsip cscalar fvsip crandu f(vsip randstate * state);

Generate a uniformly distributed(pseudo-)random number. Floatingpoint values are uniformly distributedover the open interval (0,1). Integerdeviates are uniformly distributed overthe open interval (0, 231 − 1).

voidvsip vrandu f(vsip randstate * state,const vsip vview f * R);

Generate a uniformly distributed(pseudo-)random number. Floatingpoint values are uniformly distributedover the open interval (0,1). Integerdeviates are uniformly distributed overthe open interval (0, 231 − 1).

voidvsip cvrandu f(vsip randstate * state,const vsip cvview f * R);

Generate a uniformly distributed(pseudo-)random number. Floatingpoint values are uniformly distributedover the open interval (0,1). Integerdeviates are uniformly distributed overthe open interval (0, 231 − 1).

vsip scalar fvsip randn f(vsip randstate * state);

Generate an approximately normallydistributed (pseudo-)random deviatehaving mean zero and unit variance:N(0, 1). The random numbers are gen-erated by summing values returned bythe uniform random number generator.

vsip cscalar fvsip crandn f(vsip randstate * state);

Generate an approximately normallydistributed (pseudo-)random deviatehaving mean zero and unit variance:N(0, 1). The random numbers are gen-erated by summing values returned bythe uniform random number generator.

VSIPL/Brief [3.1] NASoftware 38

Page 54: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 5. Random Number Generation

Prototype Descriptionvoidvsip vrandn f(vsip randstate * state,const vsip vview f * R);

Generate an approximately normallydistributed (pseudo-)random deviatehaving mean zero and unit variance:N(0, 1). The random numbers are gen-erated by summing values returned bythe uniform random number generator.

voidvsip cvrandn f(vsip randstate * state,const vsip cvview f * R);

Generate an approximately normallydistributed (pseudo-)random deviatehaving mean zero and unit variance:N(0, 1). The random numbers are gen-erated by summing values returned bythe uniform random number generator.

VSIPL/Brief [3.1] NASoftware 39

Page 55: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

6.1 Elementary Mathematical Functions

Prototype Descriptionvoidvsip vacos f(const vsip vview f * A,const vsip vview f * R);

Computes the principal radian value in[0, π] of the inverse cosine for each ele-ment of a vector.

voidvsip macos f(const vsip mview f * A,const vsip mview f * R);

Computes the principal radian value in[0, π] of the inverse cosine for each ele-ment of a matrix.

voidvsip vasin f(const vsip vview f * A,const vsip vview f * R);

Computes the principal radian value in[0, π] of the inverse sine for each ele-ment of a vector.

voidvsip masin f(const vsip mview f * A,const vsip mview f * R);

Computes the principal radian value in[0, π] of the inverse sine for each ele-ment of a matrix.

voidvsip vatan f(const vsip vview f * A,const vsip vview f * R);

Computes the principal radian value in[−π/2, π/2] of the inverse tangent foreach element of a vector.

voidvsip matan f(const vsip mview f * A,const vsip mview f * R);

Computes the principal radian value in[−π/2, π/2] of the inverse tangent foreach element of a matrix.

voidvsip vatan2 f(const vsip vview f * A,const vsip vview f * B,const vsip vview f * R);

Computes the four-quadrant radianvalue in [−π, π] of the inverse tangentof the ratio of the elements of two inputvectors.

voidvsip matan2 f(const vsip mview f * A,const vsip mview f * B,const vsip mview f * R);

Computes the four-quadrant radianvalue in [−π, π] of the inverse tangentof the ratio of the elements of two inputmatrices.

voidvsip vcos f(const vsip vview f * A,const vsip vview f * R);

Computes the cosine for each elementof a vector. Element angle values arein radians.

voidvsip mcos f(const vsip mview f * A,const vsip mview f * R);

Computes the cosine for each elementof a matrix. Element angle values arein radians.

voidvsip vcosh f(const vsip vview f * A,const vsip vview f * R);

Computes the hyperbolic cosine foreach element of a vector.

voidvsip mcosh f(const vsip mview f * A,const vsip mview f * R);

Computes the hyperbolic cosine foreach element of a matrix.

voidvsip vexp f(const vsip vview f * A,const vsip vview f * R);

Computes the exponential functionvalue for each element of a vector.

VSIPL/Brief [3.1] NASoftware 40

Page 56: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip cvexp f(const vsip cvview f * A,const vsip cvview f * R);

Computes the exponential functionvalue for each element of a vector.

voidvsip mexp f(const vsip mview f * A,const vsip mview f * R);

Computes the exponential functionvalue for each element of a matrix.

voidvsip cmexp f(const vsip cmview f * A,const vsip cmview f * R);

Computes the exponential functionvalue for each element of a matrix.

voidvsip vexp10 f(const vsip vview f * A,const vsip vview f * R);

Computes the base 10 exponential foreach element of a vector.

voidvsip mexp10 f(const vsip mview f * A,const vsip mview f * R);

Computes the base 10 exponential foreach element of a matrix.

voidvsip vlog f(const vsip vview f * A,const vsip vview f * R);

Computes the natural logarithm foreach element of a vector.

voidvsip cvlog f(const vsip cvview f * A,const vsip cvview f * R);

Computes the natural logarithm foreach element of a vector.

voidvsip mlog f(const vsip mview f * A,const vsip mview f * R);

Computes the natural logarithm foreach element of a matrix.

voidvsip cmlog f(const vsip cmview f * A,const vsip cmview f * R);

Computes the natural logarithm foreach element of a matrix.

voidvsip vlog10 f(const vsip vview f * A,const vsip vview f * R);

Compute the base ten logarithm foreach element of a vector.

voidvsip mlog10 f(const vsip mview f * A,const vsip mview f * R);

Compute the base ten logarithm foreach element of a matrix.

voidvsip vsin f(const vsip vview f * A,const vsip vview f * R);

Compute the sine for each element ofa vector. Element angle values are inradians.

voidvsip msin f(const vsip mview f * A,const vsip mview f * R);

Compute the sine for each element ofa matrix. Element angle values are inradians.

voidvsip vsinh f(const vsip vview f * A,const vsip vview f * R);

Computes the hyperbolic sine for eachelement of a vector.

voidvsip msinh f(const vsip mview f * A,const vsip mview f * R);

Computes the hyperbolic sine for eachelement of a matrix.

VSIPL/Brief [3.1] NASoftware 41

Page 57: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dvsqrt P(const vsip Dvview P * A,const vsip Dvview P * R);

Compute the square root for each ele-ment of a vector.The following instances are supported:

vsip vsqrt fvsip cvsqrt f

voidvsip Dmsqrt P(const vsip Dmview P * A,const vsip Dmview P * R);

Compute the square root for each ele-ment of a matrix.The following instances are supported:

vsip msqrt fvsip cmsqrt f

voidvsip vtan f(const vsip vview f * A,const vsip vview f * R);

Compute the tangent for each elementof a vector. Element angle values arein radians.

voidvsip mtan f(const vsip mview f * A,const vsip mview f * R);

Compute the tangent for each elementof a matrix. Element angle values arein radians.

voidvsip vtanh f(const vsip vview f * A,const vsip vview f * R);

Computes the hyperbolic tangent foreach element of a vector.

voidvsip mtanh f(const vsip mview f * A,const vsip mview f * R);

Computes the hyperbolic tangent foreach element of a matrix.

6.2 Unary Operations

Prototype Descriptionvoidvsip varg f(const vsip cvview f * A,const vsip vview f * R);

Computes the argument in radians[−π, π] for each element of a complexvector.

voidvsip marg f(const vsip cmview f * A,const vsip mview f * R);

Computes the argument in radians[−π, π] for each element of a complexmatrix.

voidvsip vceil f(const vsip vview f * A,const vsip vview f * R);

Computes the ceiling for each elementof a vector.

voidvsip cvconj f(const vsip cvview f * A,const vsip cvview f * R);

Compute the conjugate for each ele-ment of a complex vector.

voidvsip cmconj f(const vsip cmview f * A,const vsip cmview f * R);

Compute the conjugate for each ele-ment of a complex matrix.

VSIPL/Brief [3.1] NASoftware 42

Page 58: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dvcumsum P(const vsip Dvview P * A,const vsip Dvview P * R);

Compute the cumulative sum of the el-ements of a vector.The following instances are supported:

vsip vcumsum fvsip vcumsum ivsip cvcumsum fvsip cvcumsum i

voidvsip Dmcumsum P(vsip major dir,const vsip Dmview P * R);

Compute the cumulative sums of theelements in the rows or columns of amatrix.The following instances are supported:

vsip mcumsum fvsip mcumsum ivsip cmcumsum fvsip cmcumsum i

voidvsip veuler f(const vsip vview f * A,const vsip cvview f * R);

Computes the complex numbers corre-sponding to the angle of a unit vectorin the complex plane for each elementof a vector.

voidvsip meuler f(const vsip mview f * A,const vsip cmview f * R);

Computes the complex numbers corre-sponding to the angle of a unit vectorin the complex plane for each elementof a matrix.

voidvsip vfloor f(const vsip vview f * A,const vsip vview f * R);

Computes the floor for each element ofa vector.

voidvsip Dvmag P(const vsip Dvview P * A,const vsip vview P * R);

Compute the magnitude for each ele-ment of a vector.The following instances are supported:

vsip vmag fvsip vmag ivsip vmag sivsip cvmag f

voidvsip Dmmag P(const vsip Dmview P * A,const vsip mview P * R);

Compute the magnitude for each ele-ment of a matrix.The following instances are supported:

vsip mmag fvsip cmmag f

voidvsip vcmagsq f(const vsip cvview f * A,const vsip vview f * R);

Computes the square of the magnitudesfor each element of a vector.

voidvsip mcmagsq f(const vsip cmview f * A,const vsip mview f * R);

Computes the square of the magnitudesfor each element of a matrix.

vsip Dscalar Pvsip Dvmeanval P(const vsip Dvview P * A);

Returns the mean value of the elementsof a vector.The following instances are supported:

vsip vmeanval fvsip cvmeanval f

VSIPL/Brief [3.1] NASoftware 43

Page 59: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvsip Dscalar Pvsip Dmmeanval P(const vsip Dmview P * A);

Returns the mean value of the elementsof a matrix.The following instances are supported:

vsip mmeanval fvsip cmmeanval f

vsip scalar Pvsip Dvmeansqval P(const vsip Dvview P * A);

Returns the mean magnitude squaredvalue of the elements of a vector.The following instances are supported:

vsip vmeansqval fvsip cvmeansqval f

vsip scalar Pvsip Dmmeansqval P(const vsip Dmview P * A);

Returns the mean magnitude squaredvalue of the elements of a matrix.The following instances are supported:

vsip mmeansqval fvsip cmmeansqval f

vsip scalar Pvsip Dvmodulate P(const vsip Dvview P * A,const vsip scalar P nu,const vsip scalar P phi,const vsip Dvview P * R);

Computes the modulation of a real vec-tor by a specified complex frequency.The following instances are supported:

vsip vmodulate fvsip cvmodulate f

voidvsip Dvneg P(const vsip Dvview P * A,const vsip Dvview P * R);

Computes the negation for each ele-ment of a vector.The following instances are supported:

vsip vneg fvsip vneg ivsip vneg sivsip cvneg f

voidvsip Dmneg P(const vsip Dmview P * A,const vsip Dmview P * R);

Computes the negation for each ele-ment of a matrix.The following instances are supported:

vsip mneg fvsip mneg ivsip cmneg f

voidvsip Dvrecip P(const vsip Dvview P * A,const vsip Dvview P * R);

Computes the reciprocal for each ele-ment of a vector.The following instances are supported:

vsip vrecip fvsip cvrecip f

voidvsip Dmrecip P(const vsip Dmview P * A,const vsip Dmview P * R);

Computes the reciprocal for each ele-ment of a matrix.The following instances are supported:

vsip mrecip fvsip cmrecip f

voidvsip vrsqrt f(const vsip vview f * A,const vsip vview f * R);

Computes the reciprocal of the squareroot for each element of a vector.

VSIPL/Brief [3.1] NASoftware 44

Page 60: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip mrsqrt f(const vsip mview f * A,const vsip mview f * R);

Computes the reciprocal of the squareroot for each element of a matrix.

voidvsip vsq f(const vsip vview f * A,const vsip vview f * R);

Computes the square for each elementof a vector.

voidvsip msq f(const vsip mview f * A,const vsip mview f * R);

Computes the square for each elementof a matrix.

vsip scalar Pvsip Dvsumval P(const vsip vview P * A);

Returns the sum of the elements of avector.The following instances are supported:

vsip vsumval fvsip vsumval ivsip vsumval sivsip vsumval blvsip cvsumval fvsip cvsumval i

vsip scalar Pvsip Dmsumval P(const vsip mview P * A);

Returns the sum of the elements of avector.The following instances are supported:

vsip msumval fvsip msumval ivsip cmsumval fvsip cmsumval i

vsip scalar fvsip vsumsqval f(const vsip vview f * A);

Returns the sum of the squares of theelements of a vector.

vsip scalar fvsip msumsqval f(const vsip mview f * A);

Returns the sum of the squares of theelements of a matrix.

6.3 Binary Operations

Prototype Descriptionvoidvsip Dvadd P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the sum, by element, of twovectors.The following instances are supported:

vsip vadd fvsip vadd ivsip vadd sivsip cvadd fvsip cvadd i

voidvsip Dmadd P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the sum, by element, of twomatrices.The following instances are supported:

vsip madd fvsip madd ivsip cmadd f

VSIPL/Brief [3.1] NASoftware 45

Page 61: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip rcvadd f(const vsip vview f * A,const vsip cvview f * B,const vsip cvview f * R);

Computes the sum, by element, of twovectors.

voidvsip rcmadd f(const vsip mview f * A,const vsip cmview f * B,const vsip cmview f * R);

Computes the sum, by element, of twomatrices.

voidvsip Dsvadd P(const vsip Dscalar P a,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the sum, by element, of ascalar and a vector.The following instances are supported:

vsip svadd fvsip svadd ivsip svadd sivsip csvadd f

voidvsip Dsmadd P(const vsip Dscalar P a,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the sum, by element, of ascalar and a matrix.The following instances are supported:

vsip smadd fvsip smadd ivsip csmadd f

voidvsip rscvadd f(const vsip scalar f a,const vsip cvview f * B,const vsip cvview f * R);

Computes the sum, by element, of areal scalar and a complex vector.

voidvsip rscmadd f(const vsip scalar f a,const vsip cmview f * B,const vsip cmview f * R);

Computes the sum, by element, of areal scalar and a complex matrix.

voidvsip Dvdiv P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the quotient, by element, oftwo vectors.The following instances are supported:

vsip vdiv fvsip cvdiv f

voidvsip Dmdiv P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the quotient, by element, oftwo matrices.The following instances are supported:

vsip mdiv fvsip cmdiv f

voidvsip rcvdiv f(const vsip scalar f a,const vsip cvview f * B,const vsip cvview f * R);

Computes the quotient, by element, oftwo vectors.

voidvsip rcmdiv f(const vsip scalar f a,const vsip cmview f * B,const vsip cmview f * R);

Computes the quotient, by element, oftwo matrices.

VSIPL/Brief [3.1] NASoftware 46

Page 62: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip crvdiv f(const vsip cvview f * A,const vsip vview f * B,const vsip cvview f * R);

Computes the quotient, by element, oftwo vectors.

voidvsip crmdiv f(const vsip cmview f * A,const vsip mview f * B,const vsip cmview f * R);

Computes the quotient, by element, oftwo matrices.

voidvsip svdiv f(const vsip scalar f a,const vsip vview f * B,const vsip vview f * R);

Computes the quotient, by element, ofa scalar and a vector.

voidvsip Dsmdiv P(const vsip Dscalar P a,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the quotient, by element, ofa scalar and a matrix.The following instances are supported:

vsip smdiv fvsip csmdiv f

voidvsip rscvdiv f(const vsip scalar f a,const vsip cvview f * B,const vsip cvview f * R);

Computes the quotient, by element, ofa real scalar and a complex vector.

voidvsip rscvsub f(const vsip scalar f a,const vsip cvview f * B,const vsip cvview f * R);

Computes the difference, by element, ofa real scalar and a complex vector.

voidvsip rscmdiv f(const vsip scalar f a,const vsip cmview f * B,const vsip cmview f * R);

Computes the quotient, by element, ofa real scalar and a complex matrix.

voidvsip rscmsub f(const vsip scalar f a,const vsip cmview f * B,const vsip cmview f * R);

Computes the difference, by element, ofa real scalar and a complex matrix.

voidvsip Dvsdiv P(const vsip Dvview P * A,const vsip Dscalar P b,const vsip Dvview P * R);

Computes the quotient, by element, ofa vector and a scalar.The following instances are supported:

vsip vsdiv fvsip cvrsdiv f

voidvsip Dmsdiv P(const vsip Dmview P * A,const vsip Dscalar P b,const vsip Dmview P * R);

Computes the quotient, by element, ofa matrix and a scalar.The following instances are supported:

vsip msdiv fvsip cmrsdiv f

voidvsip Dvexpoavg P(const vsip scalar P a,const vsip Dvview P * B,const vsip Dvview P * C);

Computes an exponential weighted av-erage, by element, of two vectors.The following instances are supported:

vsip vexpoavg fvsip cvexpoavg f

VSIPL/Brief [3.1] NASoftware 47

Page 63: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dmexpoavg P(const vsip scalar P a,const vsip Dmview P * B,const vsip Dmview P * C);

Computes an exponential weighted av-erage, by element, of two matrices.The following instances are supported:

vsip mexpoavg fvsip cmexpoavg f

voidvsip vhypot f(const vsip vview f * A,const vsip vview f * B,const vsip vview f * R);

Computes the square root of the sum ofsquares, by element, of two input vec-tors.

voidvsip mhypot f(const vsip mview f * A,const vsip mview f * B,const vsip mview f * R);

Computes the square root of the sum ofsquares, by element, of two input ma-trices.

voidvsip cvjmul f(const vsip cvview f * A,const vsip cvview f * B,const vsip cvview f * R);

Computes the product of a complexvector with the conjugate of a secondcomplex vector, by element.

voidvsip cmjmul f(const vsip cmview f * A,const vsip cmview f * B,const vsip cmview f * R);

Computes the product of a complexmatrix with the conjugate of a secondcomplex matrix, by element.

voidvsip Dvmul P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the product, by element, oftwo vectors.The following instances are supported:

vsip vmul fvsip vmul ivsip vmul sivsip cvmul f

voidvsip Dmmul P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the product, by element, oftwo matrices.The following instances are supported:

vsip mmul fvsip mmul ivsip cmmul f

voidvsip rcvmul f(const vsip vview f * A,const vsip cvview f * B,const vsip cvview f * R);

Computes the product, by element, oftwo vectors.

voidvsip rcmmul f(const vsip mview f * A,const vsip cmview f * B,const vsip cmview f * R);

Computes the product, by element, oftwo matrices.

voidvsip Dsvmul P(const vsip Dscalar P a,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the product, by element, ofa scalar and a vector.The following instances are supported:

vsip svmul fvsip svmul ivsip svmul sivsip csvmul f

VSIPL/Brief [3.1] NASoftware 48

Page 64: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dsmmul P(const vsip Dscalar P a,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the product, by element, ofa scalar and a matrix.The following instances are supported:

vsip smmul fvsip csmmul f

voidvsip rscvmul f(const vsip scalar f a,const vsip cvview f * B,const vsip cvview f * R);

Computes the product, by element, ofa real scalar and a complex vector.

voidvsip rscmmul f(const vsip scalar f a,const vsip cmview f * B,const vsip cmview f * R);

Computes the product, by element, ofa real scalar and a complex matrix.

voidvsip DvDmmul P(const vsip Dvview P * A,const vsip Dmview P * B,const vsip major major,const vsip Dmview P * R);

Computes the product, by element, ofa vector and the rows or columns of amatrix.The following instances are supported:

vsip vmmul fvsip cvmmul f

voidvsip rvcmmul f(const vsip vview f * A,const vsip cmview f * B,const vsip major major,const vsip cmview f * R);

Computes the product, by element, ofa vector and the rows or columns of amatrix.

voidvsip Dvsub P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the difference, by element, oftwo vectors.The following instances are supported:

vsip vsub fvsip vsub ivsip vsub sivsip cvsub f

voidvsip Dmsub P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the difference, by element, oftwo matrices.The following instances are supported:

vsip msub fvsip msub ivsip cmsub f

voidvsip crvsub f(const vsip cvview f * A,const vsip vview f * B,const vsip cvview f * R);

Computes the difference, by element, oftwo vectors.

voidvsip crmsub f(const vsip cmview f * A,const vsip mview f * B,const vsip cmview f * R);

Computes the difference, by element, oftwo matrices.

voidvsip rcvsub f(const vsip vview f * A,const vsip cvview f * B,const vsip cvview f * R);

Computes the difference, by element, oftwo vectors.

VSIPL/Brief [3.1] NASoftware 49

Page 65: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip rcmsub f(const vsip mview f * A,const vsip cmview f * B,const vsip cmview f * R);

Computes the difference, by element, oftwo matrices.

voidvsip Dsvsub P(const vsip Dscalar P a,const vsip Dvview P * B,const vsip Dvview P * R);

Computes the difference, by element, ofa scalar and a vector.The following instances are supported:

vsip svsub fvsip svsub ivsip svsub sivsip csvsub f

voidvsip Dsmsub P(const vsip Dscalar P a,const vsip Dmview P * B,const vsip Dmview P * R);

Computes the difference, by element, ofa scalar and a matrix.The following instances are supported:

vsip smsub fvsip smsub ivsip csmsub f

6.4 Ternary Operations

Prototype Descriptionvoidvsip Dvam P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * C,const vsip Dvview P * R);

Computes the sum of two vectors andproduct of a third vector, by element.The following instances are supported:

vsip vam fvsip cvam f

voidvsip Dvma P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * C,const vsip Dvview P * R);

Computes the product of two vectorsand sum of a third vector, by element.The following instances are supported:

vsip vma fvsip cvma f

voidvsip Dvmsa P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dscalar P c,const vsip Dvview P * R);

Computes the product of two vectorsand sum of a scalar, by element.The following instances are supported:

vsip vmsa fvsip cvmsa f

voidvsip Dvmsb P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * C,const vsip Dvview P * R);

Computes the product of two vectorsand difference of a third vector, by ele-ment.The following instances are supported:

vsip vmsb fvsip cvmsb f

voidvsip Dvsam P(const vsip Dvview P * A,const vsip Dscalar P b,const vsip Dvview P * C,const vsip Dvview P * R);

Computes the sum of a vector and ascalar, and product with a second vec-tor, by element.The following instances are supported:

vsip vsam fvsip cvsam f

VSIPL/Brief [3.1] NASoftware 50

Page 66: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dvsbm P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip Dvview P * C,const vsip Dvview P * R);

Computes the difference of two vectors,and product with a third vector, by el-ement.The following instances are supported:

vsip vsbm fvsip cvsbm f

voidvsip Dvsma P(const vsip Dvview P * A,const vsip Dscalar P b,const vsip Dvview P * C,const vsip Dvview P * R);

Computes the product of a vector anda scalar, and sum with a second vector,by element.The following instances are supported:

vsip vsma fvsip cvsma f

voidvsip Dvsmsa P(const vsip Dvview P * A,const vsip Dscalar P b,const vsip Dscalar P c,const vsip Dvview P * R);

Computes the product of a vector anda scalar, and sum with a second scalar,by element.The following instances are supported:

vsip vsmsa fvsip cvsmsa f

6.5 Logical Operations

Prototype Descriptionvsip scalar blvsip valltrue bl(const vsip vview bl * A);

Returns true if all the elements of a vec-tor are true.

vsip scalar blvsip malltrue bl(const vsip vview bl * A);

Returns true if all the elements of a vec-tor are true.

vsip scalar blvsip vanytrue bl(const vsip vview bl * A);

Returns true if one or more elements ofa vector are true.

vsip scalar blvsip manytrue bl(const vsip vview bl * A);

Returns true if one or more elements ofa vector are true.

voidvsip Dvleq P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘equal’, by element, of two vectors.The following instances are supported:

vsip vleq fvsip vleq ivsip cvleq fvsip cvleq i

voidvsip Dmleq P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip vview bl * R);

Computes the boolean comparisonof ‘equal’, by element, of two vec-tors/matrices.The following instances are supported:

vsip mleq fvsip mleq ivsip cmleq fvsip cmleq i

VSIPL/Brief [3.1] NASoftware 51

Page 67: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip vlge P(const vsip vview P * A,const vsip vview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘greater than or equal’, by element, oftwo vectors.The following instances are supported:

vsip vlge fvsip vlge i

voidvsip mlge P(const vsip mview P * A,const vsip mview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘greater than or equal’, by element, oftwo vectors/matrices.The following instances are supported:

vsip mlge fvsip mlge i

voidvsip vlgt P(const vsip vview P * A,const vsip vview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘greater than’, by element, of two vec-tors.The following instances are supported:

vsip vlgt fvsip vlgt i

voidvsip mlgt P(const vsip mview P * A,const vsip mview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘greater than’, by element, of two vec-tors/matrices.The following instances are supported:

vsip mlgt fvsip mlgt i

voidvsip vlle P(const vsip vview P * A,const vsip vview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘less than or equal’, by element, of twovectors.The following instances are supported:

vsip vlle fvsip vlle i

voidvsip mlle P(const vsip mview P * A,const vsip mview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘less than or equal’, by element, of twovectors/matrices.The following instances are supported:

vsip mlle fvsip mlle i

voidvsip vllt P(const vsip vview P * A,const vsip vview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘less than’, by element, of two vectors.The following instances are supported:

vsip vllt fvsip vllt i

voidvsip mllt P(const vsip mview P * A,const vsip mview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘less than’, by element, of two vec-tors/matrices.The following instances are supported:

vsip mllt fvsip mllt i

VSIPL/Brief [3.1] NASoftware 52

Page 68: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dvlne P(const vsip Dvview P * A,const vsip Dvview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘not equal’, by element, of two vectors.The following instances are supported:

vsip vlne fvsip vlne ivsip cvlne fvsip cvlne i

voidvsip Dmlne P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip vview bl * R);

Computes the boolean comparison of‘not equal’, by element, of two vec-tors/matrices.The following instances are supported:

vsip mlne fvsip mlne ivsip cmlne fvsip cmlne i

6.6 Selection Operations

Prototype Descriptionvoidvsip vclip P(const vsip vview P * A,const vsip scalar P t1,const vsip scalar P t2,const vsip scalar P c1,const vsip scalar P c2,const vsip vview P * R);

Computes the generalised double clip,by element, of two vectors.The following instances are supported:

vsip vclip fvsip vclip ivsip vclip si

voidvsip vinvclip P(const vsip vview P * A,const vsip scalar P t1,const vsip scalar P t2,const vsip scalar P t3,const vsip scalar P c1,const vsip scalar P c2,const vsip vview P * R);

Computes the generalised inverteddouble clip, by element, of two vectors.The following instances are supported:

vsip vinvclip fvsip vinvclip ivsip vinvclip si

vsip lengthvsip vindexbool(const vsip vview bl * X,vsip vview vi * Y);

Computes an index vector of the in-dices of the non-false elements of theboolean vector, and returns the num-ber of non-false elements.

voidvsip vmax f(const vsip vview f * A,const vsip vview f * B,const vsip vview f * R);

Computes the maximum, by element,of two vectors.

voidvsip vmaxmg f(const vsip vview f * A,const vsip vview f * B,const vsip vview f * R);

Computes the maximum magnitude(absolute value), by element, of twovectors.

voidvsip vcmaxmgsq f(const vsip cvview f * A,const vsip cvview f * B,const vsip vview f * R);

Computes the maximum magnitudesquared, by element, of two complexvectors.

VSIPL/Brief [3.1] NASoftware 53

Page 69: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvsip scalar fvsip vcmaxmgsqval f(const vsip cvview f * A,vsip index * index);

Returns the index and value of themaximum magnitude squared of the el-ements of a complex vector. The indexis returned by reference as one of thearguments.

vsip scalar fvsip vmaxmgval f(const vsip vview f * A,vsip index * index);

Returns the index and value of themaximum absolute value of the ele-ments of a vector. The index is re-turned by reference as one of the ar-guments.

vsip scalar fvsip vmaxval f(const vsip vview f * A,vsip index * index);

Returns the index and value of themaximum value of the elements of avector. The index is returned by ref-erence as one of the arguments.

voidvsip vmin f(const vsip vview f * A,const vsip vview f * B,const vsip vview f * R);

Computes the minimum, by element, oftwo vectors.

voidvsip vminmg f(const vsip vview f * A,const vsip vview f * B,const vsip vview f * R);

Computes the minimum magnitude(absolute value), by element, of twovectors.

voidvsip vcminmgsq f(const vsip cvview f * A,const vsip cvview f * B,const vsip vview f * R);

Computes the minimum magnitudesquared, by element, of two complexvectors.

vsip scalar fvsip vcminmgsqval f(const vsip cvview f * A,vsip index * index);

Returns the index and value of the min-imum magnitude squared of the ele-ments of a complex vector. The indexis returned by reference as one of thearguments.

vsip scalar fvsip vminmgval f(const vsip vview f * A,vsip index * index);

Returns the index and value of the min-imum absolute value of the elements ofa vector. The index is returned by ref-erence as one of the arguments.

vsip scalar fvsip vminval f(const vsip vview f * A,vsip index * index);

Returns the index and value of the min-imum value of the elements of a vector.The index is returned by reference asone of the arguments.

6.7 Bitwise and Boolean Logical Operators

Prototype Descriptionvoidvsip vand P(const vsip vview P * A,const vsip vview P * B,const vsip vview P * R);

Computes the bitwise and, by element,of two vectors.The following instances are supported:

vsip vand ivsip vand sivsip vand bl

VSIPL/Brief [3.1] NASoftware 54

Page 70: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip mand P(const vsip mview P * A,const vsip mview P * B,const vsip mview P * R);

Computes the bitwise and, by element,of two matrices.The following instances are supported:

vsip mand ivsip mand sivsip mand bl

voidvsip vnot P(const vsip vview P * A,const vsip vview P * R);

Computes the bitwise not (one’s com-plement), by element, of two vectors.The following instances are supported:

vsip vnot ivsip vnot sivsip vnot bl

voidvsip mnot P(const vsip mview P * A,const vsip mview P * R);

Computes the bitwise not (one’s com-plement), by element, of two matrices.The following instances are supported:

vsip mnot ivsip mnot sivsip mnot bl

voidvsip vor P(const vsip vview P * A,const vsip vview P * B,const vsip vview P * R);

Computes the bitwise inclusive or, byelement, of two vectors.The following instances are supported:

vsip vor ivsip vor sivsip vor bl

voidvsip mor P(const vsip mview P * A,const vsip mview P * B,const vsip mview P * R);

Computes the bitwise inclusive or, byelement, of two matrices.The following instances are supported:

vsip mor ivsip mor sivsip mor bl

voidvsip vxor P(const vsip vview P * A,const vsip vview P * B,const vsip vview P * R);

Computes the bitwise exclusive or, byelement, of two vectors.The following instances are supported:

vsip vxor ivsip vxor sivsip vxor bl

voidvsip mxor P(const vsip mview P * A,const vsip mview P * B,const vsip mview P * R);

Computes the bitwise exclusive or, byelement, of two matrices.The following instances are supported:

vsip mxor ivsip mxor sivsip mxor bl

6.8 Element Generation and Copy

VSIPL/Brief [3.1] NASoftware 55

Page 71: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dvcopy P P(const vsip Dvview P * A,const vsip Dvview P * R);

Copy the source vector to the destina-tion vector performing any necessarytype conversion of the standard ANSIC scalar types.The following instances are supported:

vsip vcopy f fvsip vcopy f ivsip vcopy f sivsip vcopy f blvsip vcopy i fvsip vcopy i ivsip vcopy i sivsip vcopy i vivsip vcopy si fvsip vcopy si ivsip vcopy si sivsip vcopy bl fvsip vcopy bl blvsip vcopy vi ivsip vcopy vi vivsip vcopy mi mivsip cvcopy f f

voidvsip Dmcopy P P(const vsip Dmview P * A,const vsip Dmview P * R);

Copy the source matrix to the destina-tion matrix performing any necessarytype conversion of the standard ANSIC scalar types.The following instances are supported:

vsip mcopy f fvsip mcopy f ivsip mcopy f sivsip mcopy f blvsip mcopy i fvsip mcopy i ivsip mcopy i sivsip mcopy si fvsip mcopy si ivsip mcopy si sivsip mcopy bl fvsip mcopy bl blvsip cmcopy f f

voidvsip Dvfill P(const vsip Dscalar P a,const vsip Dvview P * R);

Fill a vector with a constant value.The following instances are supported:

vsip vfill fvsip vfill ivsip vfill sivsip cvfill f

voidvsip Dmfill P(const vsip Dscalar P a,const vsip Dmview P * R);

Fill a matrix with a constant value.The following instances are supported:

vsip mfill fvsip mfill ivsip mfill sivsip cmfill f

VSIPL/Brief [3.1] NASoftware 56

Page 72: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip vramp P(const vsip scalar P alpha,const vsip scalar P beta,const vsip vview P * R);

Computes a vector ramp by starting atan initial value and incrementing eachsuccessive element by the ramp stepsize.The following instances are supported:

vsip vramp fvsip vramp ivsip vramp si

6.9 Manipulation Operations

Prototype Descriptionvoidvsip vcmplx f(const vsip vview f * A,const vsip vview f * B,const vsip cvview f * R);

Form a complex vector from two realvectors.

voidvsip mcmplx f(const vsip mview f * A,const vsip mview f * B,const vsip cmview f * R);

Form a complex matrix from two realmatrices.

voidvsip Dvgather P(const vsip Dvview P * X,const vsip vview vi * I,const vsip Dvview P * Y);

The gather operation selects elementsof a source vector using indices sup-plied by an index vector. The selectedelements are placed sequentially in anoutput vector so that the output vec-tor and the index vector are indexedthe same.The following instances are supported:

vsip vgather fvsip vgather ivsip vgather sivsip cvgather f

voidvsip Dmgather P(const vsip Dmview P * X,const vsip vview mi * I,const vsip Dvview P * Y);

The gather operation selects elementsof a source vector/matrix using indicessupplied by an index vector. The se-lected elements are placed sequentiallyin an output vector so that the outputvector and the index vector are indexedthe same.The following instances are supported:

vsip mgather fvsip mgather ivsip mgather sivsip cmgather f

voidvsip vimag f(const vsip cvview f * A,const vsip vview f * R);

Extract the imaginary part of a com-plex vector.

voidvsip mimag f(const vsip cmview f * A,const vsip mview f * R);

Extract the imaginary part of a com-plex matrix.

VSIPL/Brief [3.1] NASoftware 57

Page 73: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip vpolar f(const vsip cvview f * A,const vsip vview f * R,const vsip vview f * P);

Convert a complex vector from rectan-gular to polar form. The polar dataconsists of a real vector containing theradius and a corresponding real vectorcontaining the argument (angle) of thecomplex input data.

voidvsip mpolar f(const vsip cmview f * A,const vsip mview f * R,const vsip mview f * P);

Convert a complex matrix from rect-angular to polar form. The polar dataconsists of a real matrix containing theradius and a corresponding real matrixcontaining the argument (angle) of thecomplex input data.

voidvsip vreal f(const vsip cvview f * A,const vsip vview f * R);

Extract the real part of a complex vec-tor.

voidvsip mreal f(const vsip cmview f * A,const vsip mview f * R);

Extract the real part of a complex ma-trix.

voidvsip vrect f(const vsip vview f * R,const vsip vview f * P,const vsip cvview f * A);

Convert a pair of real vectors from com-plex polar to complex rectangular form.

voidvsip mrect f(const vsip mview f * R,const vsip mview f * P,const vsip cmview f * A);

Convert a pair of real matrices fromcomplex polar to complex rectangularform.

voidvsip Dvscatter P(const vsip Dvview P * X,const vsip Dvview P * Y,const vsip vview vi * I);

The scatter operation sequentially useselements of a source vector and an in-dex vector. The element of the vectorindex is used to select a storage loca-tion in the output vector to store theelement from the source vector.The following instances are supported:

vsip vscatter fvsip vscatter ivsip vscatter sivsip cvscatter f

voidvsip Dmscatter P(const vsip Dvview P * X,const vsip Dmview P * Y,const vsip vview mi * I);

The scatter operation sequentially useselements of a source vector and an in-dex vector. The element of the vec-tor/matrix index is used to select astorage location in the output vec-tor/matrix to store the element fromthe source vector.The following instances are supported:

vsip mscatter fvsip mscatter ivsip mscatter sivsip cmscatter f

VSIPL/Brief [3.1] NASoftware 58

Page 74: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 6. Elementwise Functions

Prototype Descriptionvoidvsip Dvswap P(const vsip Dvview P * A,const vsip Dvview P * B);

Swap elements between two vectors.The following instances are supported:

vsip vswap fvsip vswap ivsip vswap sivsip cvswap f

voidvsip Dmswap P(const vsip Dmview P * A,const vsip Dmview P * B);

Swap elements between two matrices.The following instances are supported:

vsip mswap fvsip mswap ivsip mswap sivsip cmswap f

6.10 Extensions

Prototype Descriptionvsip scalar fvsip vcsummgval f(const vsip cvview f * A);

Returns the sum of the magnitudes ofthe elements of a complex vector.

VSIPL/Brief [3.1] NASoftware 59

Page 75: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 7. Signal Processing Functions

7.1 FFT Functions

Prototype Descriptionvsip fft f *vsip ccfftip create f(const vsip index length,const vsip scalar f scale,const vsip fft dir dir,const vsip length ntimes,const vsip alg hint hint);

Create a 1D FFT object.

vsip fft f *vsip ccfftop create f(const vsip index length,const vsip scalar f scale,const vsip fft dir dir,const vsip length ntimes,const vsip alg hint hint);

Create a 1D FFT object.

vsip fft f *vsip crfftop create f(const vsip index length,const vsip scalar f scale,const vsip length ntimes,const vsip alg hint hint);

Create a 1D FFT object.

vsip fft f *vsip rcfftop create f(const vsip index length,const vsip scalar f scale,const vsip length ntimes,const vsip alg hint hint);

Create a 1D FFT object.

intvsip fft destroy f(vsip fft f * plan);

Destroy an FFT object.

voidvsip fft getattr f(const vsip fft f * plan,vsip fft attr f * attr);

Return the attributes of an FFT ob-ject.

voidvsip ccfftip f(const vsip fft f * plan,const vsip cvview f * xy);

Apply a complex-to-complex FastFourier Transform (FFT).

voidvsip ccfftop f(const vsip fft f * plan,const vsip cvview f * x,const vsip cvview f * y);

Apply a complex-to-complex FastFourier Transform (FFT).

voidvsip crfftop f(const vsip fft f * plan,const vsip cvview f * x,const vsip vview f * y);

Apply a complex-to-real Fast FourierTransform (FFT).

voidvsip rcfftop f(const vsip fft f * plan,const vsip vview f * x,const vsip cvview f * y);

Apply a real-to-complex Fast FourierTransform (FFT).

VSIPL/Brief [3.1] NASoftware 60

Page 76: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 7. Signal Processing Functions

Prototype Descriptionvsip fftm f *vsip ccfftmip create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip fft dir dir,const vsip major major,const vsip length ntimes,const vsip alg hint hint);

Create a 1D multiple FFT object.

vsip fftm f *vsip ccfftmop create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip fft dir dir,const vsip major major,const vsip length ntimes,const vsip alg hint hint);

Create a 1D multiple FFT object.

vsip fftm f *vsip crfftmop create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip major major,const vsip length ntimes,const vsip alg hint hint);

Create a 1D multiple FFT object.

vsip fftm f *vsip rcfftmop create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip major major,const vsip length ntimes,const vsip alg hint hint);

Create a 1D multiple FFT object.

intvsip fftm destroy f(vsip fftm f * plan);

Destroy an FFT object.

voidvsip fftm getattr f(const vsip fftm f * plan,vsip fftm attr f * attr);

Return the attributes of an FFT ob-ject.

voidvsip ccfftmip f(const vsip fftm f * plan,const vsip cmview f * XY);

Apply a multiple complex-to-complexFast Fourier Transform (FFT).

voidvsip ccfftmop f(const vsip fftm f * plan,const vsip cmview f * X,const vsip cmview f * Y);

Apply a multiple complex-to-complexFast Fourier Transform (FFT).

voidvsip crfftmop f(const vsip fftm f * plan,const vsip cmview f * X,const vsip mview f * Y);

Apply a multiple complex-to-real FastFourier Transform (FFT).

voidvsip rcfftmop f(const vsip fftm f * plan,const vsip mview f * X,const vsip cmview f * Y);

Apply a multiple real-to-complex out ofplace Fast Fourier Transform (FFT).

VSIPL/Brief [3.1] NASoftware 61

Page 77: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 7. Signal Processing Functions

Prototype Descriptionvsip fft2d f *vsip ccfft2dip create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip fft dir dir,const vsip length ntimes,const vsip alg hint hint);

Create a 2D FFT object.

vsip fft2d f *vsip ccfft2dop create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip fft dir dir,const vsip length ntimes,const vsip alg hint hint);

Create a 2D FFT object.

vsip fft2d f *vsip crfft2dop create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip length ntimes,const vsip alg hint hint);

Create a 2D FFT object.

vsip fft2d f *vsip rcfft2dop create f(const vsip index rows,const vsip index cols,const vsip scalar f scale,const vsip length ntimes,const vsip alg hint hint);

Create a 2D FFT object.

intvsip fft2d destroy f(vsip fft2d f * plan);

Destroy an FFT object.

voidvsip fft2d getattr f(const vsip fft2d f * plan,vsip fft2d attr f * attr);

Return the attributes of an FFT ob-ject.

voidvsip ccfft2dip f(const vsip fft2d f * plan,const vsip cmview f * XY);

Apply a complex-to-complex 2D FastFourier Transform (FFT).

voidvsip ccfft2dop f(const vsip fft2d f * plan,const vsip cmview f * X,const vsip cmview f * Y);

Apply a complex-to-complex 2D FastFourier Transform (FFT).

voidvsip crfft2dop f(const vsip fft2d f * plan,const vsip cmview f * X,const vsip mview f * Y);

Apply a complex-to-real 2D FastFourier Transform (FFT).

voidvsip rcfft2dop f(const vsip fft2d f * plan,const vsip mview f * X,const vsip cmview f * Y);

Apply a real-to-complex 2D FastFourier Transform (FFT).

VSIPL/Brief [3.1] NASoftware 62

Page 78: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 7. Signal Processing Functions

7.2 Convolution/Correlation Functions

Prototype Descriptionvsip conv1d f *vsip conv1d create f(const vsip vview f * kernel,const vsip symmetry symm,const vsip length N,const vsip length D,const vsip support region support,const vsip length ntimes,const vsip alg hint hint);

Create a decimated 1D convolution fil-ter object.

intvsip conv1d destroy f(vsip conv1d f * plan);

Destroy a 1D convolution object.

voidvsip conv1d getattr f(const vsip conv1d f * plan,vsip conv1d attr f * attr);

Returns the attributes for a 1D convo-lution object.

voidvsip convolve1d f(const vsip conv1d f * plan,const vsip vview f * x,const vsip vview f * y);

Compute a decimated real one-dimensional (1D) convolution of twovectors.

vsip conv2d f *vsip conv2d create f(const vsip mview f * H,const vsip symmetry symm,const vsip length P,const vsip length Q,const vsip length D,const vsip support region support,const vsip length ntimes,const vsip alg hint hint);

Create a decimated 2D convolution fil-ter object.

intvsip conv2d destroy f(vsip conv2d f * plan);

Destroy a 2D convolution object.

voidvsip conv2d getattr f(const vsip conv2d f * plan,vsip conv2d attr f * attr);

Returns the attributes for a 2D convo-lution object.

voidvsip convolve2d f(const vsip conv2d f * plan,const vsip mview f * x,const vsip mview f * y);

Compute a decimated real two-dimensional (2D) convolution of twomatrices.

vsip Dcorr1d P *vsip Dcorr1d create P(const vsip length M,const vsip length N,const vsip support region support,const vsip length ntimes,const vsip alg hint hint);

Create a 1D correlation object.The following instances are supported:

vsip corr1d create fvsip ccorr1d create f

intvsip Dcorr1d destroy P(vsip Dcorr1d P * plan);

Destroy a 1D correlation object.The following instances are supported:

vsip corr1d destroy fvsip ccorr1d destroy f

VSIPL/Brief [3.1] NASoftware 63

Page 79: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 7. Signal Processing Functions

Prototype Descriptionvoidvsip Dcorr1d getattr P(const vsip Dcorr1d P * plan,vsip Dcorr1d attr P * attr);

Return the attributes for a 1D correla-tion object.The following instances are supported:

vsip corr1d getattr fvsip ccorr1d getattr f

voidvsip Dcorrelate1d P(const vsip Dcorr1d P * plan,const vsip bias bias,const vsip Dvview P * ref,const vsip Dvview P * x,const vsip Dvview P * y);

Compute a real one-dimensional (1D)correlation of two vectors.The following instances are supported:

vsip correlate1d fvsip ccorrelate1d f

vsip Dcorr2d P *vsip Dcorr2d create P(const vsip length M,const vsip length N,vsip length P,vsip length Q,const vsip support region support,const vsip length ntimes,const vsip alg hint hint);

Create a 2D correlation object.The following instances are supported:

vsip corr2d create fvsip ccorr2d create f

intvsip Dcorr2d destroy P(vsip Dcorr2d P * plan);

Destroy a 2D correlation object.The following instances are supported:

vsip corr2d destroy fvsip ccorr2d destroy f

voidvsip Dcorr2d getattr P(const vsip Dcorr2d P * plan,vsip Dcorr2d attr P * attr);

Return the attributes for a 2D correla-tion object.The following instances are supported:

vsip corr2d getattr fvsip ccorr2d getattr f

voidvsip Dcorrelate2d P(const vsip Dcorr2d P * plan,const vsip bias bias,const vsip Dmview P * ref,const vsip Dmview P * x,const vsip Dmview P * y);

Compute a two-dimensional (2D) cor-relation of two matrices.The following instances are supported:

vsip correlate2d fvsip ccorrelate2d f

7.3 Window Functions

Prototype Descriptionvsip vview f *vsip vcreate blackman f(const vsip length N,const vsip memory hint hint);

Create a vector with Blackman windowweights.

vsip vview f *vsip vcreate cheby f(const vsip length N,const vsip scalar f ripple,const vsip memory hint hint);

Create a vector with Dolph-Chebyshevwindow weights.

vsip vview f *vsip vcreate hanning f(const vsip length N,const vsip memory hint hint);

Create a vector with Hanning windowweights.

VSIPL/Brief [3.1] NASoftware 64

Page 80: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 7. Signal Processing Functions

Prototype Descriptionvsip vview f *vsip vcreate kaiser f(const vsip length N,const vsip scalar f beta,const vsip memory hint hint);

Create a vector with Kaiser windowweights.

7.4 Filter Functions

Prototype Descriptionvsip Dfir P *vsip Dfir create P(const vsip Dvview P * kernel,const vsip symmetry symm,const vsip length N,const vsip length D,const vsip obj state state,const vsip length ntimes,const vsip alg hint hint);

Create a decimated FIR filter object.The following instances are supported:

vsip fir create fvsip cfir create f

intvsip Dfir destroy P(vsip Dfir P * plan);

Destroy a FIR filter object.The following instances are supported:

vsip fir destroy fvsip cfir destroy f

intvsip Dfirflt P(vsip Dfir P * plan,const vsip Dvview P * x,const vsip Dvview P * y);

FIR filter an input sequence and deci-mate the output.The following instances are supported:

vsip firflt fvsip cfirflt f

voidvsip Dfir getattr P(const vsip Dfir P * plan,vsip Dfir attr P * attr);

Return the attributes of a FIR filter ob-ject.The following instances are supported:

vsip fir getattr fvsip cfir getattr f

voidvsip Dfir reset P(vsip Dfir P * fir);

Reset the state of a decimated FIR fil-ter object.The following instances are supported:

vsip fir reset fvsip cfir reset f

7.5 Miscellaneous signal Processing Functions

Prototype Descriptionvoidvsip vhisto f(const vsip vview f * A,const vsip scalar f min,const vsip scalar f max,const vsip hist opt opt,const vsip vview f * R);

Compute the histogram of a vector.

VSIPL/Brief [3.1] NASoftware 65

Page 81: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 8. Linear Algebra

8.1 Matrix and Vector Operations

Prototype Descriptionvoidvsip cmherm f(const vsip cmview f * A,const vsip cmview f * R);

Complex Hermitian (conjugate trans-pose) of a matrix.

vsip cscalar fvsip cvjdot f(const vsip cvview f * A,const vsip cvview f * B);

Compute the conjugate inner (dot)product of two complex vectors.

voidvsip gemp f(const vsip scalar f alpha,const vsip mview f * A,const vsip mat op Aop,const vsip mview f * B,const vsip mat op Bop,const vsip scalar f beta,const vsip mview f * R);

Calculate the general product of twomatrices and accumulate.

voidvsip cgemp f(const vsip cscalar f alpha,const vsip cmview f * A,const vsip mat op Aop,const vsip cmview f * B,const vsip mat op Bop,const vsip cscalar f beta,const vsip cmview f * R);

Calculate the general product of twomatrices and accumulate.

voidvsip gems f(const vsip scalar f alpha,const vsip mview f * A,const vsip mat op Aop,const vsip scalar f beta,const vsip mview f * C);

Calculate a general matrix sum.

voidvsip cgems f(const vsip cscalar f alpha,const vsip cmview f * A,const vsip mat op Aop,const vsip cscalar f beta,const vsip cmview f * C);

Calculate a general matrix sum.

voidvsip Dmprod P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip Dmview P * R);

Calculate the product of two matrices.The following instances are supported:

vsip mprod fvsip mprod ivsip mprod sivsip cmprod fvsip cmprod ivsip cmprod si

VSIPL/Brief [3.1] NASoftware 66

Page 82: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 8. Linear Algebra

Prototype Descriptionvoidvsip cmprodh P(const vsip cmview P * A,const vsip cmview P * B,const vsip cmview P * R);

Calculate the product a complex ma-trix and the Hermitian of a complexmatrix.The following instances are supported:

vsip cmprodh fvsip cmprodh ivsip cmprodh si

voidvsip cmprodj P(const vsip cmview P * A,const vsip cmview P * B,const vsip cmview P * R);

Calculate the product a complex ma-trix and the conjugate of a complex ma-trix.The following instances are supported:

vsip cmprodj fvsip cmprodj ivsip cmprodj si

voidvsip Dmprodt P(const vsip Dmview P * A,const vsip Dmview P * B,const vsip Dmview P * R);

Calculate the product of a matrix andthe transpose of a matrix.The following instances are supported:

vsip mprodt fvsip mprodt ivsip mprodt sivsip cmprodt fvsip cmprodt ivsip cmprodt si

voidvsip Dmvprod P(const vsip Dmview P * A,const vsip Dvview P * X,const vsip Dvview P * Y);

Calculate a matrix–vector product.The following instances are supported:

vsip mvprod fvsip mvprod ivsip mvprod sivsip cmvprod fvsip cmvprod ivsip cmvprod si

voidvsip Dmtrans P(const vsip Dmview P * A,const vsip Dmview P * R);

Transpose a matrix.The following instances are supported:

vsip mtrans blvsip mtrans fvsip mtrans ivsip mtrans sivsip cmtrans fvsip cmtrans ivsip cmtrans si

vsip Dscalar Pvsip Dvdot P(const vsip Dvview P * A,const vsip Dvview P * B);

Compute the inner (dot) product oftwo vectors.The following instances are supported:

vsip vdot fvsip cvdot f

VSIPL/Brief [3.1] NASoftware 67

Page 83: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 8. Linear Algebra

Prototype Descriptionvoidvsip Dvmprod P(const vsip Dvview P * X,const vsip Dmview P * A,const vsip Dvview P * Y);

Calculate a vector–matrix product.The following instances are supported:

vsip vmprod fvsip vmprod ivsip vmprod sivsip cvmprod fvsip cvmprod ivsip cvmprod si

voidvsip vouter f(const vsip scalar f alpha,const vsip vview f * X,const vsip vview f * Y,const vsip vview f * R);

Calculate the outer product of two vec-tors.

voidvsip cvouter f(const vsip cscalar f alpha,const vsip cvview f * X,const vsip cvview f * Y,const vsip cvview f * R);

Calculate the outer product of two vec-tors.

8.2 Special Linear System Solvers

Prototype Descriptionintvsip covsol f(const vsip mview f * A,const vsip mview f * XB);

Solve a covariance linear system prob-lem.

intvsip ccovsol f(const vsip cmview f * A,const vsip cmview f * XB);

Solve a covariance linear system prob-lem.

intvsip llsqsol f(const vsip mview f * A,const vsip mview f * XB);

Solve a linear least squares problem.

intvsip cllsqsol f(const vsip cmview f * A,const vsip cmview f * XB);

Solve a linear least squares problem.

intvsip toepsol f(const vsip vview f * T,const vsip vview f * B,const vsip vview f * W,const vsip vview f * X);

Solve a real symmetric positive definiteToeplitz linear system.

intvsip ctoepsol f(const vsip cvview f * T,const vsip cvview f * B,const vsip cvview f * W,const vsip cvview f * X);

Solve a real symmetric positive definiteToeplitz linear system.

VSIPL/Brief [3.1] NASoftware 68

Page 84: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 8. Linear Algebra

8.3 General Square Linear System Solver

Prototype Descriptionintvsip Dlud P(vsip clu P * lud,const vsip Dmview P * A);

Compute an LU decomposition of asquare matrix using partial pivoting.The following instances are supported:

vsip lud fvsip clud f

vsip Dlu P *vsip Dlud create P(const vsip length N);

Create an LU decomposition object.The following instances are supported:

vsip lud create fvsip clud create f

intvsip Dlud destroy P(vsip Dlu P * lud);

Destroy an LU decomposition object.The following instances are supported:

vsip lud destroy fvsip clud destroy f

voidvsip Dlud getattr P(const vsip Dlu P * lud,vsip Dlu attr P * attr);

Returns the attributes of an LU decom-position object.The following instances are supported:

vsip lud getattr fvsip clud getattr f

intvsip lusol f(const vsip clu f * clud,const vsip mat op opA,const vsip mview f * XB);

Solve a square linear system.

intvsip clusol f(const vsip clu f * clud,const vsip mat op opA,const vsip cmview f * XB);

Solve a square linear system.

8.4 Symmetric Positive Definite Linear System Solver

Prototype Descriptionintvsip chold f(vsip cchol f * chold,const vsip mview f * A);

Compute a Cholesky decomposition ofa symmetric positive definite matrix.

intvsip cchold f(vsip cchol f * chold,const vsip cmview f * A);

Compute a Cholesky decomposition ofa symmetric positive definite matrix.

vsip chol f *vsip chold create f(const vsip mat uplo uplo,const vsip length n);

Creates a Cholesky decomposition ob-ject.

vsip cchol f *vsip cchold create f(const vsip mat uplo uplo,const vsip length n);

Creates a Cholesky decomposition ob-ject.

VSIPL/Brief [3.1] NASoftware 69

Page 85: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 8. Linear Algebra

Prototype Descriptionintvsip Dchold destroy P(vsip Dchol P * chold);

Destroy a Cholesky decomposition ob-ject.The following instances are supported:

vsip chold destroy fvsip cchold destroy f

voidvsip Dchold getattr P(const vsip Dchol P * chold,vsip Dchol attr P * attr);

Returns the attributes of a Choleskydecomposition object.The following instances are supported:

vsip chold getattr fvsip cchold getattr f

intvsip cholsol f(const vsip cchol f * chold,const vsip mview f * XB);

Solve a symmetric positive definite lin-ear system.

intvsip ccholsol f(const vsip cchol f * chold,const vsip cmview f * XB);

Solve a symmetric positive definite lin-ear system.

8.5 Overdetermined Linear System Solver

Prototype Descriptionintvsip qrd f(vsip cqr f * qrd,const vsip mview f * A);

Compute a QR decomposition of a ma-trix .

intvsip cqrd f(vsip cqr f * qrd,const vsip cmview f * A);

Compute a QR decomposition of a ma-trix .

vsip qr f *vsip qrd create f(const vsip length m,const vsip length n,const vsip qrd qopt qopt);

Create a QR decomposition object.

vsip cqr f *vsip cqrd create f(const vsip length m,const vsip length n,const vsip qrd qopt qopt);

Create a QR decomposition object.

intvsip Dqrd destroy P(vsip Dqr P * qrd);

Destroy a QR decomposition object.The following instances are supported:

vsip qrd destroy fvsip cqrd destroy f

voidvsip Dqrd getattr P(const vsip Dqr P * qrd,vsip Dqr attr P * attr);

Returns the attributes of a QR decom-position object.The following instances are supported:

vsip qrd getattr fvsip cqrd getattr f

VSIPL/Brief [3.1] NASoftware 70

Page 86: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 8. Linear Algebra

Prototype Descriptionintvsip qrdprodq f(const vsip qr f * qrd,const vsip mat op opQ,const vsip mat side apQ,const vsip mview f * C);

Multiply a matrix by the matrix Qfrom a QR decomposition.

intvsip cqrdprodq f(const vsip cqr f * qrd,const vsip mat op opQ,const vsip mat side apQ,const vsip cmview f * C);

Multiply a matrix by the matrix Qfrom a QR decomposition.

intvsip qrdsolr f(const vsip qr f * qrd,const vsip mat op OpR,const vsip scalar f alpha,const vsip mview f * XB);

Solve linear system based on the ma-trix R, from QR decomposition of thematrix A.

intvsip cqrdsolr f(const vsip cqr f * qrd,const vsip mat op OpR,const vsip cscalar f alpha,const vsip cmview f * XB);

Solve linear system based on the ma-trix R, from QR decomposition of thematrix A.

intvsip qrsol f(const vsip qr f * qrd,const vsip qrd prob prob,const vsip mview f * XB);

Solve either a linear covariance or linearleast squares problem.

intvsip cqrsol f(const vsip cqr f * qrd,const vsip qrd prob prob,const vsip cmview f * XB);

Solve either a linear covariance or linearleast squares problem.

8.6 Extensions

Prototype Descriptionvoidvsip Dminvlu P(const vsip Dmview P * A,const vsip vview i * V,const vsip Dmview P * R);

Invert a square matrix using LU de-composition.The following instances are supported:

vsip minvlu fvsip cminvlu f

VSIPL/Brief [3.1] NASoftware 71

Page 87: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 9. Glossary

Admitted Block state where the data array (memory) and associatedviews are available for VSIPL computations, and not avail-able for user I/O or access.

Attribute Characteristic or state of an object, such as admitted / re-leased, stride, or length.

Binary Function A function with two input arguments.Block A data storage abstraction representing contiguous data ele-

ments consisting of a data array and a VSIPL block object.Block Object Descriptor for a data array and its attributes, including a

reference to the data array, the state of the block, data typeand size.

Block Offset The number of elements from the start of a block. A viewwith a block offset of zero starts at the beginning of theblock.

Boolean Used to represent the values of true and false, where false isalways zero, and true is non-zero.

Bound A view or block is bound to a data array if it references thedata array.

Cloned View An exact duplicate of a view object.Column Rightmost dimension in a matrix.Column Stride The number of block elements between successive elements

within a column.Complex Block Block containing only complex elements. There are two for-

mats for released complex blocks – split and interleaved.The complex data format for admitted complex blocks isnot known to the user.

Conformant Views Views that are the correct shape/size for a given computa-tion.

const Object An object that is not modified by the function, althoughdata referenced by the const object may be modified.

Create To allocate memory for an object and initialise it (if appro-priate).

Data Array Memory where data is stored.Derived Block A real block derived from a complex block. Note that the

only way to create a derived block is to create a derived viewof the real or complex component of a split complex view.In all other cases, retrieving the block from a view returns areference to the original block.

VSIPL/Brief [3.1] NASoftware 72

Page 88: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 9. Glossary

Derived View A derived view is a view created using a VSIPL functionwhose arguments include another view (a parent view). Thederived view’s data is some subset of the parent view’s data.The data subset depends on the function call, and is physi-cally co-located in memory with the parent view’s data.

Destroy To release the memory allocated to an object.Development LibraryAn implementation of VSIPL that maximises error reporting

at the possible expense of performance.Domain The set of all valid input values to a function.Element The atomic portion of data associated with a block or a view .

For example, an element of a complex block of precisiondouble is a complex number of precision double; for a viewof type float an element is a single float number.

Hermitian TransposeConjugate transpose.Hint Information provided by the user to some VSIPL functions

to aid optimization. Hints are optional and may be ignoredby the implementation. Wrong hints may result in incorrectbehavior.

In-Place A type of algorithm implementation in which the memoryused to hold the input to an algorithm is overwritten (com-pletely or partially) with the output data. Often referred toin the context of an FFT algorithm.

Interleaved Complex Storage format for user data arrays where the real and com-plex element components alternate in physical memory.

Kernel The filter vector used in a FIR filter, or the vector or matrixused as the weights in a convolution.

Length Number of elements in a view along a view dimension.Matrix A two-dimensional view.Opaque An opaque object may not be manipulated by simple as-

signment statements. Its attributes must be set/retrievedthrough access functions. All VSIPL objects are opaque.

Out-of-place If none of the output views in a function call overlap theinput views, the function is considered out-of-place.

Overlapped Indicates that two or more views or blocks share one or morememory locations.

Production Library A VSIPL implementation that maximises performance at thepossible expense of not detecting user errors.

Range Valid output values from a function.Real Block A block containing only real elements.Region of Support For neighborhood operations (i.e. FIR filtering, convolu-

tion), the non-zero values in the kernel, or the output. Forexample, a 3 × 3 FIR filter has a ‘kernel region of support’of 3× 3.

VSIPL/Brief [3.1] NASoftware 73

Page 89: VSIPL/Brief [3.1] · vsip cvrandn f. . . . . . . . . . . . . . . . . . . . . . . . . . . .39 6 Elementwise Functions40 6.1 Elementary Mathematical Functions ...

Chapter 9. Glossary

Released Block state where the associated data array is available foruser I/O and application access, but not available for VSIPLcomputations.

Row Left-most dimension of a matrix.Row Stride The number of block elements between successive elements

within a row .Split Complex Storage format for released complex blocks where the real

element components are stored in one physically contiguousdata array , and the imaginary components are stored in aseparate physically contiguous data array.

Stride Distance between successive elements of the block data arrayin a view along a view dimension. Strides can be positive,negative, or zero.

Subview A derived view that describes a subset of the data from theoriginal view, and is the same type as the original view.

Tensor An n-dimensional matrix. VSIPL only supports three-dimensional tensors (3-tensor). The three dimensions arereferred to as X, Y and Z.

Ternary Function A function with three input arguments.Unary Function A function with a single input argument.User Block A block which is associated with user data arrays. User

blocks are created in the released state and may be admittedand released.

User Data Array Memory that has been allocated by the application for thestorage of data using some functionality not part of theVSIPL standard.

Vector A one-dimensional view .View A portion of a block, and a view object describing it. The

view object has structural information allowing the data tobe interpreted as a one-, two- or three-dimensional array forarithmetic processing.

View Dimension A view represents a one-, two-, or three-dimensional dataorganisation termed respectively a vector, matrix or tensor.A view dimension represents one of the standard directionsof these data representations.

View Object A description of a portion of a block, including structuralinformation that allows the data to be interpreted as a one-,two- or three-dimensional array for arithmetic processing.Attributes of the view object include offset, stride(s) andlength(s).

VSIPL Block Block referencing or bound to VSIPL data. A VSIPL blockis created in the admitted state and may not be released.

VSIPL Data Array Memory that has been allocated for the storage of data usingsome functionality that is part of the VSIPL standard.

VSIPL/Brief [3.1] NASoftware 74


Recommended