7.7.2. IDX of Double Precision Floating Point Numbers
(lsh/libidx/idx-double.lsh)


Basic operations on vectors, matrices, and tensors of doubles

7.7.2.0. (idx-d2timesd2 A B C)
(lsh/libidx/idx-double.lsh)


2d x 2d matrix multiply: C = A * B

7.7.2.1. (idx-d1reverse vector)
(lsh/libidx/idx-double.lsh)


Reverses in-place the order of the elements of a vector . not very efficient, but I didn't have time to re-write a faster one for SN3.1

7.7.2.2. (idx-d1fill m f)
(lsh/libidx/idx-double.lsh)


fill elements of m with double f .

7.7.2.3. (idx-d2fill m f)
(lsh/libidx/idx-double.lsh)


fill idx2 m with value f

7.7.2.4. (idx-d3fill m f)
(lsh/libidx/idx-double.lsh)


fill idx3 m with value f

7.7.2.5. (idx-d1dotc m f q)
(lsh/libidx/idx-double.lsh)


multiply elements of m by double f , put result in q

7.7.2.6. (idx-d2dotc m f q)
(lsh/libidx/idx-double.lsh)


multiply elements of m by double f , put result in q

7.7.2.7. (idx-d3dotc m f q)
(lsh/libidx/idx-double.lsh)


multiply elements of m by double f , put result in q

7.7.2.8. (idx-d1dotcacc m f q)
(lsh/libidx/idx-double.lsh)


multiply elements of m by double f , accumulate result in q

7.7.2.9. (idx-d2dotcacc m f q)
(lsh/libidx/idx-double.lsh)


multiply elements of m by double f , accumulate result in q

7.7.2.10. (idx-d3dotcacc m f q)
(lsh/libidx/idx-double.lsh)


multiply elements of m by double f , accumulate result in q

7.7.2.11. (idx-d1addc m f q)
(lsh/libidx/idx-double.lsh)


add elements of m to double f , put result in q

7.7.2.12. (idx-d2addc m f q)
(lsh/libidx/idx-double.lsh)


add elements of m by double f , put result in q

7.7.2.13. (idx-d3addc m f q)
(lsh/libidx/idx-double.lsh)


add elements of m by double f , put result in q

7.7.2.14. (idx-d1lincomb x cx y cy z)
(lsh/libidx/idx-double.lsh)


performs a linear combination of vectors x and y using coefficients cx and cy . Put result in z .

7.7.2.15. (idx-d1tanh x1 y1)
(lsh/libidx/idx-double.lsh)


Computes the regular tanh of x1 element by element, result in y1 .

7.7.2.16. (idx-d1inv x1 y1)
(lsh/libidx/idx-double.lsh)


puts inverse of each element of x1 into corresponding elements in y1

7.7.2.17. (idx-d1sign x y)
(lsh/libidx/idx-double.lsh)


Elements of y are set to the sgn function of elements of x .

7.7.2.18. (idx-d1clip x y)
(lsh/libidx/idx-double.lsh)




7.7.2.19. (idx-d1sup m)
(lsh/libidx/idx-double.lsh)


returns largest element in m

7.7.2.20. (idx-d1max m [r])
(lsh/libidx/idx-double.lsh)


if r is present, put largest element of idx1 m into idx0 r otherwise returns largest element.

7.7.2.21. (idx-d2max m [r])
(lsh/libidx/idx-double.lsh)


if r is present, put largest element of idx1 m into idx0 r otherwise returns largest element.

7.7.2.22. (idx-d1inf m)
(lsh/libidx/idx-double.lsh)


returns smallest element in m

7.7.2.23. (idx-d1min m [r])
(lsh/libidx/idx-double.lsh)


if r is present, put smallest element of idx1 m into idx0 r otherwise returns smallest element.

7.7.2.24. (idx-d2min m [r])
(lsh/libidx/idx-double.lsh)


if r is present, put smallest element of idx1 m into idx0 r otherwise returns smallest element.

7.7.2.25. (idx-d1indexmax m)
(lsh/libidx/idx-double.lsh)


returns index (int) of largest element in m

7.7.2.26. (idx-d1indexmin m)
(lsh/libidx/idx-double.lsh)


returns index (int) of smallest element in m

7.7.2.27. (index-of-max m)
(lsh/libidx/idx-double.lsh)


return index of largest element in idx1 m

7.7.2.28. (idx-d1fill-with-index m)
(lsh/libidx/idx-double.lsh)


fill the elements of idx1 m with their index.

7.7.2.29. (idx-d1avg vector)
(lsh/libidx/idx-double.lsh)


Returns the average of the numbers in the input vector .

7.7.2.30. (idx-d1prod vec)
(lsh/libidx/idx-double.lsh)


returns the product of the elements of the input vector vec ,

7.7.2.31. (idx-d1logsum m)
(lsh/libidx/idx-double.lsh)


computes a "log-add" of the elements in m , i.e. -log( 1/n Sum_i ( exp( - m_i ) )) where n is the dimension of m . This is the wrong logsum advocated by Yann. Use idx-d1logadd instead.

7.7.2.32. (idx-d2logsum m)
(lsh/libidx/idx-double.lsh)


same as idx-d1logsum, but in 2 dimensions -log( 1/n Sum_ij ( exp( - m_ij ) )) where n is the number of elements in m This is the wrong logsum advocated by Yann. Use idx-d2logadd instead.

7.7.2.33. (idx-d1logadd m)
(lsh/libidx/idx-double.lsh)


computes a "log-add" of the elements in m , i.e. -log( Sum_i ( exp( - m_i ) ))

7.7.2.34. (idx-d2logadd m)
(lsh/libidx/idx-double.lsh)


same as idx-d1logadd, but in 2 dimensions -log( Sum_ij ( exp( - m_ij ) ))

7.7.2.35. (idx-d1logaddb m beta)
(lsh/libidx/idx-double.lsh)


computes a "log-add" with inverse temperature b of the elements in m , i.e. -1/beta log ( Sum_i ( exp( - beta*m_i ) ))

7.7.2.36. (idx-d2logaddb m beta)
(lsh/libidx/idx-double.lsh)


same as idx-f1logaddb, but in 2 dimensions -1/beta log( Sum_ij ( exp( - beta*m_ij ) ))

7.7.2.37. (idx-d1logdotd1 m p)
(lsh/libidx/idx-double.lsh)


computes a "log-add" of term-by-termt products of elements in m and p , i.e. -log( p_i Sum_i ( exp( - m_i ) )) p should be a normalized probability vector for this to be meaningful

7.7.2.38. (idx-d2logdotd2 m)
(lsh/libidx/idx-double.lsh)


same as idx-d1logdotd1, but in 2 dimensions

7.7.2.39. (idx-d1blogdotd1 m p out)
(lsh/libidx/idx-double.lsh)


This is the "bprop" corresponding to idx-d1logdotd1 m is the input (preferably positive costs), p is the prior vector, and on output out is the vector of partial derivatives of (idx1-d1logdotd1 m p ) with respect to each element of m .

7.7.2.40. (idx-d1subextd1 x y z)
(lsh/libidx/idx-double.lsh)


Computes the external subtraction z[i, j] = x[i] - y[j]

7.7.2.41. (idx-d1subd0 x1 y0 z1)
(lsh/libidx/idx-double.lsh)


Substracts ( y0 ) from elements of vector x1 . Results in vector z1 .

7.7.2.42. (idx-d1mulacc x1 y1 z1)
(lsh/libidx/idx-double.lsh)


z1[i] += x1[i] * y1[i]. not efficient. Could be improved a lot.

7.7.2.43. (idx-d1entropy m c)
(lsh/libidx/idx-double.lsh)


computes the entropy of a vector (- sum Pi log Pi ) this does a normalization and adds a constant c to all the elements (so it does not crash of they are 0)

7.7.2.44. (idx-d1subsample-fast in nlin)
(lsh/libidx/idx-double.lsh)


subsamples vector (considered as a signal) by integer factor nlin the returned output is a vector whose size is int(N/ nlin ) where N is the size of in . there is a idx-d1subsample defined in libconvol.sn, it is a little slower and takes 3 parameters.

7.7.2.45. (idx-f4dotd3 x y z)
(lsh/libidx/idx-double.lsh)


z[i] = sum_jkl x[i, j, k, l]*y[j, k, l]

7.7.2.46. (idx-d3extd1 x y z)
(lsh/libidx/idx-double.lsh)


External (or cross-) product of 3d x with 1d y to yield 4d z . z[i, j, k, l] = x[i, j, k]*y[l]

7.7.2.47. (idx-d1extd3 x y z)
(lsh/libidx/idx-double.lsh)


External (or cross-) product of 1d x with 3d y to yield 4d z . z[i, j, k, l] = x[i]*y[j, k, l]

7.7.2.48. (idx-d3dotd3 a b c)
(lsh/libidx/idx-double.lsh)


c is an idx0 which will contain the sum of all the products of elements from a and b .

7.7.2.49. (idx-d3dotd2 x y z)
(lsh/libidx/idx-double.lsh)


z[i] = sum_jk x[i, j, k]*y[j, k]

7.7.2.50. (idx-d4dotd1 x y z)
(lsh/libidx/idx-double.lsh)


z[j, k, l] = sum_i x[i, j, k, l]*y[i]

7.7.2.51. (idx-d4dotd1acc x y z)
(lsh/libidx/idx-double.lsh)


z[j, k, l] += sum_i x[i, j, k, l]*y[i]

7.7.2.52. (idx-d1extd2 x y z)
(lsh/libidx/idx-double.lsh)


External (or cross-) product of 1d x with 2d y to yield 3d z . z[i, j, k] = x[i]*y[j, k]

7.7.2.53. (idx-d3dotd1 x y z)
(lsh/libidx/idx-double.lsh)


z[j, k] = sum_i x[i, j, k]*y[i]

7.7.2.54. (idx-d3dotd1acc x y z)
(lsh/libidx/idx-double.lsh)


z[j, k] += sum_i x[i, j, k]*y[i]

7.7.2.55. (make-d2-place-target n)
(lsh/libidx/idx-double.lsh)


return an n x n matrix with 1s on the diagonal and -1s everywhere else.

7.7.2.56. (idx-d1range n1 n2 delta)
(lsh/libidx/idx-double.lsh)


Returns a vector of all the numbers between n1 and n2 , stepping by delta . Not compilable under current version.

7.7.2.57. (idx-d1squextd1 m1 m2 m3)
(lsh/libidx/idx-double.lsh)


square outer product of m1 and m2 . M3ij = M1i * M2j^2

7.7.2.58. (idx-d2squextd2 m1 m2 m3)
(lsh/libidx/idx-double.lsh)


square outer product of m1 and m2 . M3ijkl = M1ij * M2kl^2

7.7.2.59. (idx-d1squextd1acc m1 m2 m3)
(lsh/libidx/idx-double.lsh)


square outer product of m1 and m2 . M3ij += M1i * M2j^2

7.7.2.60. (idx-d2squextd2acc m1 m2 m3)
(lsh/libidx/idx-double.lsh)


square outer product of m1 and m2 . M3ijkl += M1ij * M2kl^2

7.7.2.61. (idx-d2squdotd1 m1 m2 m3)
(lsh/libidx/idx-double.lsh)


multiply vector m2 by matrix m1 using square of m1 elements M3i = sum_j M1ij^2 * M2j

7.7.2.62. (idx-d4squdotd2 m1 m2 m3)
(lsh/libidx/idx-double.lsh)


multiply matrix m2 by tensor m1 using square of m1 elements M3ij = sum_kl M1ijkl^2 * M2kl

7.7.2.63. (idx-d2squdotd1acc m1 m2 m3)
(lsh/libidx/idx-double.lsh)


multiply vector m2 by matrix m1 using square of m1 elements M3i += sum_j M1ij^2 * M2j

7.7.2.64. (idx-d4squdotd2acc m1 m2 m3)
(lsh/libidx/idx-double.lsh)


multiply matrix m2 by tensor m1 using square of m1 elements M3ij += sum_kl M1ijkl^2 * M2kl

7.7.2.65. (idx-d1squdotd1acc m1 m2 m3)
(lsh/libidx/idx-double.lsh)


dot product between m1 and m2 , except square of terms of m1 are used: M3 += sum_i M1i^2 * M2i

7.7.2.66. (idx-d2squdotd2acc m1 m2 m3)
(lsh/libidx/idx-double.lsh)


dot product between matrices m1 and m2 , except square of terms of m1 are used: M3 += sum_ij M1ij^2 * M2ij