7.7.0. Generic IDX Macros and Functions
(lsh/libidx/idx-macros.lsh)




7.7.0.0. Resizing Macros and Functions
(lsh/libidx/idx-macros.lsh)


A set of macros and functions to resize vectors, matrices and tensors.

7.7.0.0.0. (midx-m1resize m n0)
(lsh/libidx/idx-macros.lsh)


a macro redims idx1 m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. In interpreted mode, the function idx1-resize can be called.
See: (idx1-resize m n0 )


7.7.0.0.1. (midx-m2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


a macro that redims idx2 m in-place

7.7.0.0.2. (midx-m3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


a macro that redims idx3 m in-place

7.7.0.0.3. (midx-m4resize m n0 n1 n2 n3)
(lsh/libidx/idx-macros.lsh)


a macro that redims idx4 m in-place

7.7.0.0.4. (midx-m5resize m n0 n1 n2 n3 n4)
(lsh/libidx/idx-macros.lsh)


a macro that redims idx5 m in-place

7.7.0.0.5. (idx-f1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of float m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.6. (idx-f2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of float m in-place

7.7.0.0.7. (idx-f3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of float m in-place

7.7.0.0.8. (idx-f4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of float m in-place

7.7.0.0.9. (idx-i1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of int m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.10. (idx-i2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of int m in-place

7.7.0.0.11. (idx-i3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of int m in-place

7.7.0.0.12. (idx-i4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of int m in-place

7.7.0.0.13. (idx-s1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of short m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.14. (idx-s2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of short m in-place

7.7.0.0.15. (idx-s3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of short m in-place

7.7.0.0.16. (idx-s4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of short m in-place

7.7.0.0.17. (idx-b1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of byte m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.18. (idx-b2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of byte m in-place

7.7.0.0.19. (idx-b3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of byte m in-place

7.7.0.0.20. (idx-b4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of byte m in-place

7.7.0.0.21. (idx-u1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of ubyte m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.22. (idx-u2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of ubyte m in-place

7.7.0.0.23. (idx-u3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of ubyte m in-place

7.7.0.0.24. (idx-u4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of ubyte m in-place

7.7.0.0.25. (idx-g1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of gptr m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.26. (idx-g2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of gptr m in-place

7.7.0.0.27. (idx-g3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of gptr m in-place

7.7.0.0.28. (idx-g4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of gptr m in-place

7.7.0.0.29. (idx-d1resize m n0)
(lsh/libidx/idx-macros.lsh)


redims idx1 of double m in-place with the new size n0 . Unlike redim, it does not create a temporary variable. Unlike idx-changedim, this macro increases the size of the storage if necessary. very efficient. exists also in macro form.
See: (midx-m1resize m n0 )


7.7.0.0.30. (idx-d2resize m n0 n1)
(lsh/libidx/idx-macros.lsh)


redims idx2 of double m in-place

7.7.0.0.31. (idx-d3resize m n0 n1 n2)
(lsh/libidx/idx-macros.lsh)


redims idx3 of double m in-place

7.7.0.0.32. (idx-d4resize m n0 n1 n2 n3))
(lsh/libidx/idx-macros.lsh)


redims idx4 of double m in-place

7.7.0.1. Macros for common operations
(lsh/libidx/idx-macros.lsh)




7.7.0.1.0. (midx-m2oversample input nlin ncol output)
(lsh/libidx/idx-macros.lsh)


macro for 2D oversampling

7.7.0.2. Obsolete Iterators for Inline C code
(lsh/libidx/idx-macros.lsh)


These function are kept for backward compatibility, but a largely superseded by cidx-bloop described in the Core section.

7.7.0.2.0. (cinline-idx1loop m type c j p1 [p2...])
(lsh/libidx/idx-macros.lsh)


man, that's a tough one to explain. don't try this at home anyway. this thing is like a loop for cinline. It executes the cinline instructions in p1 ... for each element of matrix m (must be an idx1). c , and j must be strings containing valid C variable identifiers, and type is a string that must contain a valid C type (like "float"). during the loop, C variable c will point to the current element of m , and C variable j will contain the index of that element. So a macro that fills the elements of a vector with its index plus a constant n can be written:
 (cinline-idx1loop mat "flt" "p" "i" (cinline "*p = i+%s;" n))


7.7.0.2.1. (cinline-idxloop2 m1 type1 m2 type2 c1 c2 j p1 [p2...])
(lsh/libidx/idx-macros.lsh)


same as cinline-idx1loop, but loops simultaneously on two vectors

7.7.0.2.2. (cinline-idxloop3 m1 type1 m2 type2 m3 type3 c1 c2 c3 j p1 [p2...])
(lsh/libidx/idx-macros.lsh)


same as cinline-idx1loop, but loops simultaneously on three vectors

7.7.0.2.3. (cinline-idx2loop m type c i j [l1...])
(lsh/libidx/idx-macros.lsh)


same as cinline-idx1loop but loops over all elements of an idx2. i and j are strings containing the C name of the row and column indices.

7.7.0.2.4. (cinline-idx2loop2 m1 type1 m2 type2 c1 c2 i j [l...])
(lsh/libidx/idx-macros.lsh)


same as cinline-idx1loop2 but loops over all elements of an idx2. i and j are strings containing the C name of the row and column indices.

7.7.0.2.5. (cinline-idx2loop3 m1 type1 m2 type2 m3 type3 c1 c2 c3 i j [l...])
(lsh/libidx/idx-macros.lsh)


same as cinline-idx1loop3 but loops over all elements of an idx2. i and j are strings containing the C name of the row and column indices.