libidx
/home/rex/ebltrunk/core/libidx/include/idxops.h
00001 /***************************************************************************
00002  *   Copyright (C) 2012 by Yann LeCun and Pierre Sermanet *
00003  *   yann@cs.nyu.edu, pierre.sermanet@gmail.com *
00004  *   All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Redistribution under a license not approved by the Open Source
00014  *       Initiative (http://www.opensource.org) must display the
00015  *       following acknowledgement in all advertising material:
00016  *        This product includes software developed at the Courant
00017  *        Institute of Mathematical Sciences (http://cims.nyu.edu).
00018  *     * The names of the authors may not be used to endorse or promote products
00019  *       derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00023  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00024  * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY
00025  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00027  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00028  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  ***************************************************************************/
00032 
00033 #ifndef IDXOPS_H
00034 #define IDXOPS_H
00035 
00036 #include "config.h"
00037 #include "numerics.h"
00038 #include "idx.h"
00039 
00040 namespace ebl {
00041 
00042   // idx_copy //////////////////////////////////////////////////////////////////
00043 
00045   // TODO-0: using slow idx_copy version, others are bugged, debug
00046   template <class T1, class T2> void idx_copy(const idx<T1> &src, idx<T2> &dst);
00048   template <> void idx_copy(const idx<float32> &src, idx<float32> &dst);
00050   template <> void idx_copy(const idx<float64> &src, idx<float64> &dst);
00052   template <class T1, class T2> idx<T1> idx_copy(const idx<T2> &src);
00054   template <class T> idx<T> idx_copy(const idx<T> &src);
00055 
00056   //template <typename T> void idx_copy(idx<T> &src, idx<T> &dst);
00057 
00061   template <class T1, class T2>
00062     void idx_copy_clip(const idx<T1> &src, idx<T2> &dst);
00063 
00064   // idx_clear /////////////////////////////////////////////////////////////////
00065 
00067   template <typename T> void idx_clear(idx<T> &inp);
00068 
00069   // idx_fill //////////////////////////////////////////////////////////////////
00070 
00072   template<class T, class T2> inline void idx_fill(idx<T> & inp, T2 v);
00074   template <typename T> void idx_fill(idx<T> &inp, T v);
00076   template <typename T> void idx_fill_index(idx<T> &inp);
00077 
00078   // idx_shuffle_* /////////////////////////////////////////////////////////////
00079 
00086   template <typename T>
00087     void idx_shuffle(idx<T> &in, intg d = 0, idx<T> *out = NULL);
00096   template <class T1, class T2>
00097     void idx_shuffle_together(idx<T1> &in1, idx<T2> &in2, intg d,
00098                               idx<T1> *out1 = NULL, idx<T2> *out2 = NULL);
00108   template <class T1, class T2, class T3>
00109     void idx_shuffle_together(idx<T1> &in1, idx<T2> &in2, idx<T3> &in3,
00110                               intg d,
00111                               idx<T1> *out1 = NULL, idx<T2> *out2 = NULL,
00112                               idx<T3> *out3 = NULL);
00113 
00114   // idx_add (not-in-place) ////////////////////////////////////////////////////
00115 
00117   template<typename T> void idx_add(idx<T> &i1, idx<T> &i2, idx<T> &out);
00118 
00119   // idx_add (in-place) ////////////////////////////////////////////////////////
00120 
00122   template <typename T> void idx_add(idx<T> &in, idx<T> &out);
00123 
00125   //template<> EXPORT void idx_add(idx<float32> &in, idx<float32> &out);
00126 
00127   // idx_addc //////////////////////////////////////////////////////////////////
00128   // TODO: add inplace addc, which can be used for speed up in
00129   // bias modules for example where output is the input
00130 
00133   template<class T, class T2>
00134     inline void idx_addc(idx<T> &inp, T2 c, idx<T> &out);
00136   template<class T> void idx_addc(idx<T> &inp, T c, idx<T> &out);
00138   template<class T> void idx_addc(idx<T> &in, T c);
00139 
00140   // idx_addc_bounded //////////////////////////////////////////////////////////
00141 
00149   template<class T, class T2>
00150   inline void idx_addc_bounded(idx<T> &inp, T2 c, idx<T> &out);
00157   template <typename T> void idx_addc_bounded(idx<T> &inp, T c, idx<T> &out);
00158 
00159   // idx_addcacc ///////////////////////////////////////////////////////////////
00160 
00164   template<class T, class T2>
00165   inline void idx_addcacc(idx<T> &inp, T2 c, idx<T> &out);
00168   template<class T> void idx_addcacc(idx<T> &inp, T c, idx<T> &out);
00169 
00170   // idx_sub ///////////////////////////////////////////////////////////////////
00171 
00173   template<class T> void idx_sub(idx<T> &i1, idx<T> &i2);
00175   template<class T> void idx_sub(idx<T> &i1, idx<T> &i2, idx<T> &out);
00177   template<class T> void idx_subacc(idx<T> &i1, idx<T> &i2, idx<T> &out);
00178 
00179   // idx_spherical_sub (not-in-place) //////////////////////////////////////////
00180 
00183   template<class T> void idx_spherical_sub(idx<T> &i1, idx<T> &i2, idx<T> &out);
00184 
00185   // idx_spherical_add (not-in-place) //////////////////////////////////////////
00186 
00189   template<class T> void idx_spherical_add(idx<T> &i1, idx<T> &i2, idx<T> &out);
00190 
00191   // idx_subc_bounded //////////////////////////////////////////////////////////
00192 
00200   template<class T, class T2>
00201   inline void idx_subc_bounded(idx<T> &inp, T2 c, idx<T> &out);
00208   template<class T> void idx_subc_bounded(idx<T> &inp, T c, idx<T> &out);
00209 
00210   // idx_minus /////////////////////////////////////////////////////////////////
00211 
00213   template<class T> void idx_minus(idx<T> &in, idx<T> &out);
00214 
00215   // idx_minus_acc /////////////////////////////////////////////////////////////
00216 
00218   template<class T> void idx_minus_acc(idx<T> &in, idx<T> &out);
00219 
00220   // idx_mul (not-in-place) ////////////////////////////////////////////////////
00221 
00223   template<class T> void idx_mul(idx<T> &i1, idx<T> &i2, idx<T> &out);
00224 
00226   template<class T> void idx_mulacc(idx<T> &i1, idx<T> &i2, idx<T> &out);
00227 
00229   // idx_dotc
00230 
00233   template<class T, class T2> void idx_dotc(idx<T> &inp, T2 c, idx<T> &out);
00234 
00236   // idx_dotc_bounded
00237 
00245   template<class T, class T2>
00246   void idx_dotc_bounded(idx<T> &inp, T2 c, idx<T> &out);
00247 
00248   // idx_dotcacc ///////////////////////////////////////////////////////////////
00249 
00253   template<class T, class T2> void idx_dotcacc(idx<T> &inp, T2 c, idx<T> &out);
00254 
00256   // idx_signdotc
00257 
00261   template<class T, class T2>
00262   inline void idx_signdotc(idx<T> &inp, T2 c, idx<T> &out);
00265   template<class T> void idx_signdotc(idx<T> &inp, T c, idx<T> &out);
00266 
00267   // idx_div ///////////////////////////////////////////////////////////////////
00268 
00270   template<class T> void idx_div(idx<T> &i1, idx<T> &i2, idx<T> &out);
00271 
00272   // idx_inv ///////////////////////////////////////////////////////////////////
00273 
00275   template<class T> void idx_inv(idx<T> &inp, idx<T> &out);
00276 
00277   // idx_signdotcacc ///////////////////////////////////////////////////////////
00278 
00282   template<class T, class T2>
00283   inline void idx_signdotcacc(idx<T> &inp, T2 c, idx<T> &out);
00286   template<class T> void idx_signdotcacc(idx<T> &inp, T c, idx<T> &out);
00287 
00288   // idx_subsquare /////////////////////////////////////////////////////////////
00289 
00291   template <typename T> void idx_subsquare(idx<T> &i1, idx<T> &i2, idx<T> &out);
00293   template <typename T>
00294     void idx_subsquareacc(idx<T> &i1, idx<T> &i2, idx<T> &out);
00295 
00296   // idx_lincomb ///////////////////////////////////////////////////////////////
00297 
00299   template <typename T>
00300   void idx_lincomb(idx<T> &i1, T k1, idx<T> &i2, T k2, idx<T> &out);
00301 
00302   // idx_tanh, idx_dtanh, idx_stdsigmoid, idx_dstddigmoid //////////////////////
00303 
00305   template <typename T> void idx_tanh(idx<T> &inp, idx<T> &out);
00307   template <typename T> void idx_dtanh(idx<T> &inp, idx<T> &out);
00309   template <typename T> void idx_stdsigmoid(idx<T> &inp, idx<T> &out);
00311   template <typename T> void idx_dstdsigmoid(idx<T> &inp, idx<T> &out);
00312 
00313   // idx_abs ///////////////////////////////////////////////////////////////////
00314 
00316   template <typename T> void idx_abs(idx<T>& inp, idx<T>& out);
00317 
00318   // idx_thresdotc_acc /////////////////////////////////////////////////////////
00319 
00323   template<class T, class T2, class T3>
00324   inline void idx_thresdotc_acc(idx<T>& in, T2 c, T3 th, idx<T>& out);
00327   template<class T> void idx_thresdotc_acc(idx<T>& in, T c, T th, idx<T>& out);
00328 
00329   // idx_threshold (in-place) //////////////////////////////////////////////////
00330 
00333   template<class T, class T2>
00334   inline void idx_threshold(idx<T>& in, T2 th);
00336   template<class T> void idx_threshold(idx<T>& in, T th);
00338   template<class T> void idx_threshold2(idx<T>& in, T th);
00339 
00340   // idx_threshold (not-in-place) //////////////////////////////////////////////
00341 
00344   template<class T, class T2>
00345   inline void idx_threshold(idx<T>& in, T2 th, idx<T>& out);
00347   template <typename T>
00348     void idx_threshold(idx<T>& in, T th, idx<T>& out);
00349 
00350   // idx_threshold (with value, in-place) //////////////////////////////////////
00351 
00354   template<class T, class T2, class T3>
00355   void idx_threshold(idx<T>& in, T2 th, T3 value);
00357   template<class T> void idx_threshold(idx<T>& in, T th, T value);
00358 
00359   // idx_threshold (with value, not-in-place) //////////////////////////////////
00360 
00363   template<class T, class T2, class T3>
00364   void idx_threshold(idx<T>& in, T2 th, T3 value, idx<T>& out);
00366   template <typename T>
00367     void idx_threshold(idx<T>& in, T th, T value, idx<T>& out);
00368 
00369   // idx_threshold (with below and above) //////////////////////////////////////
00370 
00372   template <class T, class T2>
00373   void idx_threshold(idx<T>& in, T th, T2 below, T2 above, idx<T2>& out);
00374 
00375   // idx_sqrt //////////////////////////////////////////////////////////////////
00376 
00378   template <typename T> void idx_sqrt(idx<T>& in, idx<T>& out);
00379 
00380   // idx_exp ///////////////////////////////////////////////////////////////////
00381 
00383   template<class T> EXPORT void idx_exp(idx<T>& inp);
00385   template <> EXPORT void idx_exp(idx<float>& inp);
00387   template <> EXPORT void idx_exp(idx<float64>& inp);
00388 
00389   // idx_power /////////////////////////////////////////////////////////////////
00390 
00393   template<class T, class T2>
00394   inline void idx_power(idx<T>& in, T2 p, idx<T>& out);
00395 
00397   template<class T> inline void idx_power(idx<T>& in, T p, idx<T>& out);
00398 
00399 #ifndef __TH__
00400 
00401   template <> EXPORT void idx_power(idx<float>& in, float p, idx<float>& out);
00402 
00404   template <>
00405     EXPORT void idx_power(idx<float64>& in, float64 p, idx<float64>& out);
00406 #endif
00407   // idx_sum ///////////////////////////////////////////////////////////////////
00408 
00411   template <typename Tout, typename T> Tout idx_sum(idx<T> &inp);
00414   template <typename T> T idx_sum(idx<T> &inp);
00415   template <typename T> T idx_sum(idx<T> &inp, T *out);
00416   //template <> EXPORT double idx_sum(idx<double> &inp, double *out);
00417   //template <> EXPORT float idx_sum(idx<float> &inp, float *out);
00418 
00419 #if 0 //TODO
00420 
00421 /*
00422 #if defined(__OPENMP__) and defined(__USE_SSE__)
00424   template<> float32 idx_sum(idx<float32> &inp, float32 *out);
00425 #endif
00426 */
00427 
00428 #endif
00429 
00430   // idx_sumacc ////////////////////////////////////////////////////////////////
00431 
00433   template<class T> float64 idx_sumacc(idx<T> &inp, idx<T> &acc);
00434 
00435   // idx_sumabs ////////////////////////////////////////////////////////////////
00436 
00439   template<class T> float64 idx_sumabs(idx<T> &inp, T *out = NULL);
00440 
00441   // idx_sumabs (with accumulator) /////////////////////////////////////////////
00442 
00444   template<class T> float64 idx_sumabs(idx<T> &inp, idx<T> &acc);
00445 
00446   // idx_sumsqr ////////////////////////////////////////////////////////////////
00447 
00449   template<class T> float64 idx_sumsqr(idx<T> &in);
00450 
00451   // idx_l1 ////////////////////////////////////////////////////////////////////
00452 
00454   template <class T> float64 idx_l1(idx<T> &m1, idx<T> &m2);
00455 
00456   // idx_l2norm ////////////////////////////////////////////////////////////////
00457 
00460   template<class T> float64 idx_l2norm(idx<T> &in);
00463   template<class T> float64 idx_l2(idx<T> &in);
00465   template<class T> float64 idx_l2(idx<T> &m1, idx<T> &m2);
00467   template<class T> float64 idx_l2(midx<T> &m1, midx<T> &m2);
00470   template<class T> float64 idx_l2common(midx<T> &m1, midx<T> &m2);
00471 
00472   // idx_mean //////////////////////////////////////////////////////////////////
00473 
00476   template <typename T> T idx_mean(idx<T> &inp, T *out = NULL);
00477 
00478   // idx_std_normalize /////////////////////////////////////////////////////////
00479 
00482   template <typename T>
00483   EXPORT void idx_std_normalize(idx<T> &in, idx<T> &out, T *mean = (T*)NULL);
00485   template <>
00486   EXPORT void idx_std_normalize(idx<ubyte> &in, idx<ubyte> &out, ubyte *mean);
00488   template <>
00489   EXPORT void idx_std_normalize(idx<uint16> &, idx<uint16> &out, uint16 *mean);
00491   template <>
00492   EXPORT void idx_std_normalize(idx<uint32> &in, idx<uint32> &o, uint32 *mean);
00493 
00494   // idx_dot ///////////////////////////////////////////////////////////////////
00495 
00498   template <class T> T idx_dot(idx<T> &i1, idx<T> &i2);
00499   // TODO: this doesn't compiile on newest gcc
00500   /* //! dot product of two idx. This generic version is not efficient. */
00501   /* //! Returns sum of product of all elements. */
00502   /* template <class T> float64 idx_dot(idx<T> &i1, idx<T> &i2); */
00503 #if defined(__CBLAS__) || (defined(__IPP__) && defined(__IPP_DOT__))
00504 
00505   EXPORT float64 idx_dot(idx<float32> &i1, idx<float32> &i2);
00506 #endif
00507 
00508   // idx_dotacc ////////////////////////////////////////////////////////////////
00509 
00511   template <typename T> void idx_dotacc(idx<T>& i1, idx<T>& i2, idx<T>& o);
00512 
00513   // m2dotm1 ///////////////////////////////////////////////////////////////////
00514 
00516   template <typename T> void idx_m2dotm1(idx<T> &a, idx<T> &x, idx<T> &y);
00518   template <typename T> void idx_m2dotm1acc(idx<T> &a, idx<T> &x, idx<T> &y);
00519 
00520   // m2dotm2 ///////////////////////////////////////////////////////////////////
00521 
00523   template <typename T> void idx_m2dotm2(idx<T> &a, idx<T> &x, idx<T> &y);
00525   template <typename T> void idx_m2dotm3(idx<T> &a, idx<T> &x, idx<T> &y);
00526 
00527   // m4dotm2 ///////////////////////////////////////////////////////////////////
00528 
00530   template <typename T> void idx_m4dotm2(idx<T> &i1, idx<T> &i2, idx<T> &o1);
00531 
00534   template <typename T> void idx_m4dotm2acc(idx<T> &i1, idx<T> &i2, idx<T> &o1);
00535 
00538   template <typename T>
00539     void idx_m4squdotm2acc(idx<T> &i1, idx<T> &i2, idx<T> &o1);
00540 
00542   template <typename T> void idx_m2extm2(idx<T> &i1, idx<T> &i2, idx<T> &o1);
00545   template <typename T> void idx_m2extm2acc(idx<T> &i1, idx<T> &i2, idx<T> &o1);
00546 
00548   template <typename T>
00549     void idx_m2squextm2acc(idx<T> &i1, idx<T> &i2, idx<T> &o1);
00550 
00552   template <typename T> void idx_m2squdotm2(idx<T>& i1, idx<T>& i2, idx<T>& o);
00553 
00555   template <typename T>
00556     void idx_m2squdotm2acc(idx<T>& i1, idx<T>& i2, idx<T>& o);
00557 
00559   template <typename T> void idx_m1extm1(idx<T> &x, idx<T> &y, idx<T> &o);
00561   template <typename T> void idx_m1extm1acc(idx<T> &a, idx<T> &x, idx<T> &y);
00562 
00564   template <typename T>
00565     void idx_m2squdotm1(idx<T> &a, idx<T> &x, idx<T> &y);
00567   template <typename T>
00568     void idx_m2squdotm1acc(idx<T> &a, idx<T> &x, idx<T> &y);
00570   EXPORT void idx_m2squdotm1(idx<double> &a, idx<double> &x, idx<double> &y);
00572   EXPORT void idx_m2squdotm1(idx<float> &a, idx<float> &x, idx<float> &y);
00574   EXPORT void idx_m2squdotm1acc(idx<double> &a, idx<double> &x, idx<double> &y);
00576   EXPORT void idx_m2squdotm1acc(idx<float> &a, idx<float> &x, idx<float> &y);
00577 
00579   template <typename T>
00580     void idx_m1squextm1(idx<T> &a, idx<T> &x, idx<T> &y);
00582   template <typename T>
00583     void idx_m1squextm1acc(idx<T> &a, idx<T> &x, idx<T> &y);
00585   EXPORT void idx_m1squextm1(idx<double> &a, idx<double> &x, idx<double> &y);
00587   EXPORT void idx_m1squextm1(idx<float> &a, idx<float> &x, idx<float> &y);
00589   EXPORT void idx_m1squextm1acc(idx<double> &a, idx<double> &x, idx<double> &y);
00591   EXPORT void idx_m1squextm1acc(idx<float> &a, idx<float> &x, idx<float> &y);
00592 
00593   // idx_2dconvol //////////////////////////////////////////////////////////////
00594 
00597   // TODO: specialize a float version that uses IPP
00598   template<class T> void idx_2dconvol(idx<T> &in, idx<T> &kernel, idx<T> &out);
00601   template<class T> void idx_3dconvol(idx<T> &in, idx<T> &kernel, idx<T> &out);
00602 
00603   // flip functions ////////////////////////////////////////////////////////////
00604 
00607   template <typename T> idx<T> idx_flip(idx<T> &m, uint n, idx<T> *m2 = NULL);
00610   template <typename T> midx<T> idx_flip(midx<T> &m, uint n, midx<T> *m2 =NULL);
00611 
00613   template <typename T> void rev_idx2 (idx<T> &m);
00614 
00616   template <typename T> void rev_idx2_tr (idx<T> &m, idx<T> &n);
00617 
00618   // idx_max ///////////////////////////////////////////////////////////////////
00619 
00621   template <typename T> T idx_max(idx<T> &m);
00622 
00623   // idx_max between two idx's (in-place) //////////////////////////////////////
00624 
00626   template<class T> void idx_max(idx<T> &in1, idx<T> &in2);
00627 
00628   // idx_max between two idx's (not-in-place) //////////////////////////////////
00629 
00631   template <typename T> void idx_max(idx<T> &in1, idx<T> &in2, idx<T> &out);
00632 
00633   // idx_min ///////////////////////////////////////////////////////////////////
00634 
00636   template <typename T> T idx_min(idx<T> &m);
00637 
00639   template<class T> void idx_min(idx<T> &in1, idx<T> &in2);
00640 
00641   // idx_indexmax //////////////////////////////////////////////////////////////
00642 
00644   template <typename T> intg idx_indexmax(idx<T> &m);
00645 
00646   // idx_indexmin //////////////////////////////////////////////////////////////
00647 
00649   template <typename T> intg idx_indexmin(idx<T> &m);
00650 
00651   // sort functions ////////////////////////////////////////////////////////////
00652 
00656   template <class T1, class T2> void idx_sortdown(idx<T1> &m, idx<T2> &p);
00659   template<class T> void idx_sortup(idx<T> &m);
00662   template<class T1, class T2> void idx_sortup(idx<T1> &m, idx<T2> &m2);
00665   template<class T1, class T2, class T3>
00666     void idx_sortup(idx<T1> &m, idx<T2> &m2, idx<T3> &m3);
00669   template<class T> void idx_sortdown(idx<T> &m);
00670 
00671   // idx_sqrdist ///////////////////////////////////////////////////////////////
00672 
00677   template <typename T> float64 idx_sqrdist(idx<T> &i1, idx<T> &i2);
00678 
00679   // idx_sqrdist (with idx out) ////////////////////////////////////////////////
00680 
00685   template <typename T> void idx_sqrdist(idx<T> &i1, idx<T> &i2, idx<T> &out);
00686 
00687   // idx_spherical_sqrdist /////////////////////////////////////////////////////
00688 
00692   template <typename T> float64 idx_spherical_sqrdist(idx<T> &i1, idx<T> &i2);
00693 
00694   // idx_gaussian //////////////////////////////////////////////////////////////
00695 
00698   template <typename T>
00699     void idx_gaussian(idx<T> &in, double m, double sigma, idx<T> &out);
00700 
00701   // idx_modulo ////////////////////////////////////////////////////////////////
00702 
00704   template <typename T> void idx_modulo(idx<T> &m, T mod);
00706   template <> void idx_modulo(idx<double> &m, double mod);
00708   template <> void idx_modulo(idx<long double> &m, long double mod);
00710   template <> void idx_modulo(idx<float> &m, float mod);
00711 
00712   // idx_m2oversample //////////////////////////////////////////////////////////
00713 
00715   template <typename T>
00716     void idx_m2oversample(idx<T>& small, intg nlin, intg ncol, idx<T>& big);
00718   template <typename T>
00719     void idx_m2oversampleacc(idx<T>& small, intg nlin, intg ncol, idx<T>& big);
00720 
00721   // idx_clip //////////////////////////////////////////////////////////////////
00722 
00724   template <typename T> void idx_clip(idx<T> &i1, T m, idx<T> &o1);
00725 
00726   // strings_to_idx ////////////////////////////////////////////////////////////
00727 
00731   EXPORT idx<ubyte> strings_to_idx(idx<const char *> &strings);
00734   template <typename T> EXPORT T idx_trace(idx<T> &m2);
00735 
00736   // concatenation /////////////////////////////////////////////////////////////
00737 
00742   template <typename T>
00743     idx<T> idx_concat(idx<T> &m1, idx<T> &m2, intg dim = 0);
00744 
00745   // randomization ////////////////////////////////////////////////////////////
00746 
00748   template <typename T> void idx_random(idx<T> &m, double v0, double v1);
00750   template <typename T> void idx_random(idx<T> &m, double v);
00751 
00752 } // end namespace ebl
00753 
00754 #include "idxops.hpp"
00755 #include "ipp.h"
00756 #include "th.h"
00757 #include "blasops.h"
00758 
00759 #endif