math.h (2014-04-30 15:38:09 -0400, (build fd32605))
Go to the documentation of this file.
1 //-----------------------------------------------------------------------//
2 // Copyright (c) AccelerEyes LLC. All rights reserved. //
3 // See http://www.accelereyes.com/eula for details. //
4 // This software is distributed WITHOUT ANY WARRANTY; without even //
5 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
6 // PURPOSE. See the above copyright notices for more information. //
7 //-----------------------------------------------------------------------//
8 
9 #pragma once
10 #include "defines.h"
11 
12 namespace af {
13 
14 class array;
205  AFAPI array diff1(const array& in, int dim=-1);
206 
212  AFAPI array diff2(const array& in, int dim=-1);
213 
231  AFAPI void grad(array& dcols, array& drows, const array& in);
232 
237 } // namespace af
238 
239 #ifdef __cplusplus
240 extern "C" {
241 #endif
242 
264  AFAPI afError af_diff_S(float *d_out,
266  unsigned ndims_in , const unsigned *dims_in ,
267  const float *d_in,
268  int order, int dim);
270  AFAPI afError af_diff_D(double *d_out,
271  unsigned ndims_in , const unsigned *dims_in ,
272  const double *d_in,
273  int order, int dim);
274 
296  AFAPI afError af_grad_B(bool *d_dx, bool *d_dy,
298  unsigned nx, unsigned ny, const bool *d_in,
299  unsigned batch);
301  AFAPI afError af_grad_U(unsigned *d_dx, unsigned *d_dy,
302  unsigned nx, unsigned ny, const unsigned *d_in,
303  unsigned batch);
305  AFAPI afError af_grad_I(int *d_dx, int *d_dy,
306  unsigned nx, unsigned ny, const int *d_in,
307  unsigned batch);
309  AFAPI afError af_grad_S(float *d_dx, float *d_dy,
310  unsigned nx, unsigned ny, const float *d_in,
311  unsigned batch);
313  AFAPI afError af_grad_D(double *d_dx, double *d_dy,
314  unsigned nx, unsigned ny, const double *d_in,
315  unsigned batch);
343  AFAPI afError af_kronProd_SS(float *d_C,
344  unsigned mA, unsigned nA,
345  const float *d_A, unsigned batch_A,
346  unsigned mB, unsigned nB,
347  const float *d_B, unsigned batch_B);
348 
351  unsigned mA, unsigned nA,
352  const float *d_A, unsigned batch_A,
353  unsigned mB, unsigned nB,
354  const cfloat *d_B,
355  unsigned batch_B);
356 
359  unsigned mA, unsigned nA,
360  const cfloat *d_A, unsigned batch_A,
361  unsigned mB, unsigned nB,
362  const float *d_B, unsigned batch_B);
363 
366  unsigned mA, unsigned nA,
367  const cfloat *d_A, unsigned batch_A,
368  unsigned mB, unsigned nB,
369  const cfloat *d_B,
370  unsigned batch_B);
371 
373  AFAPI afError af_kronProd_SD(float *d_C,
374  unsigned mA, unsigned nA,
375  const float *d_A, unsigned batch_A,
376  unsigned mB, unsigned nB,
377  const double *d_B, unsigned batch_B);
378 
381  unsigned mA, unsigned nA,
382  const float *d_A, unsigned batch_A,
383  unsigned mB, unsigned nB,
384  const cdouble *d_B,
385  unsigned batch_B);
386 
389  unsigned mA, unsigned nA,
390  const cfloat *d_A,
391  unsigned batch_A,
392  unsigned mB, unsigned nB,
393  const double *d_B,
394  unsigned batch_B);
395 
398  unsigned mA, unsigned nA,
399  const cfloat *d_A,
400  unsigned batch_A,
401  unsigned mB, unsigned nB,
402  const cdouble *d_B,
403  unsigned batch_B);
404 
406  AFAPI afError af_kronProd_DS(float *d_C,
407  unsigned mA, unsigned nA,
408  const double *d_A, unsigned batch_A,
409  unsigned mB, unsigned nB,
410  const float *d_B, unsigned batch_B);
411 
414  unsigned mA, unsigned nA,
415  const double *d_A, unsigned batch_A,
416  unsigned mB, unsigned nB,
417  const cfloat *d_B,
418  unsigned batch_B);
419 
422  unsigned mA, unsigned nA,
423  const cdouble *d_A,
424  unsigned batch_A,
425  unsigned mB, unsigned nB,
426  const float *d_B, unsigned batch_B);
427 
430  unsigned mA, unsigned nA,
431  const cdouble *d_A,
432  unsigned batch_A,
433  unsigned mB, unsigned nB,
434  const cfloat *d_B,
435  unsigned batch_B);
436 
438  AFAPI afError af_kronProd_DD(double *d_C,
439  unsigned mA, unsigned nA,
440  const double *d_A, unsigned batch_A,
441  unsigned mB, unsigned nB,
442  const double *d_B, unsigned batch_B);
443 
446  unsigned mA, unsigned nA,
447  const double *d_A, unsigned batch_A,
448  unsigned mB, unsigned nB,
449  const cdouble *d_B,
450  unsigned batch_B);
451 
454  unsigned mA, unsigned nA,
455  const cdouble *d_A,
456  unsigned batch_A,
457  unsigned mB, unsigned nB,
458  const double *d_B, unsigned batch_B);
459 
462  unsigned mA, unsigned nA,
463  const cdouble *d_A,
464  unsigned batch_A,
465  unsigned mB, unsigned nB,
466  const cdouble *d_B,
467  unsigned batch_B);
480  // besselh
481  // k = {1,2}
482  // nu = [-50 .. 50]
483  AFAPI afError af_besselh_S(float *d_out, unsigned k, unsigned n, const float *d_in, float nu);
484  AFAPI afError af_besselh_C(float *d_out, unsigned k, unsigned n, const float *d_in, float nu);
485  AFAPI afError af_besselh_D(double *d_out, unsigned k, unsigned n, const double *d_in, double nu);
486  AFAPI afError af_besselh_Z(double *d_out, unsigned k, unsigned n, const double *d_in, double nu);
487 
488  // besseli
489  AFAPI afError af_besseli_S(float *d_out, unsigned n, const float *d_in, float nu);
490  AFAPI afError af_besseli_C(float *d_out, unsigned n, const float *d_in, float nu);
491  AFAPI afError af_besseli_D(double *d_out, unsigned n, const double *d_in, double nu);
492  AFAPI afError af_besseli_Z(double *d_out, unsigned n, const double *d_in, double nu);
493 
494  // besselj
495  AFAPI afError af_besselj_S(float *d_out, unsigned n, const float *d_in, float nu);
496  AFAPI afError af_besselj_C(cfloat *d_out, unsigned n, const cfloat *d_in, float nu);
497  AFAPI afError af_besselj_D(double *d_out, unsigned n, const double *d_in, double nu);
498  AFAPI afError af_besselj_Z(cdouble *d_out, unsigned n, const cdouble *d_in, double nu);
499 
500  // besselk
501  AFAPI afError af_besselk_S(float *d_out, unsigned n, const float *d_in, float nu);
502  AFAPI afError af_besselk_C(float *d_out, unsigned n, const float *d_in, float nu);
503  AFAPI afError af_besselk_D(double *d_out, unsigned n, const double *d_in, double nu);
504  AFAPI afError af_besselk_Z(double *d_out, unsigned n, const double *d_in, double nu);
505 
506  // bessely
507  AFAPI afError af_bessely_S(float *d_out, unsigned n, const float *d_in, float nu);
508  AFAPI afError af_bessely_C(float *d_out, unsigned n, const float *d_in, float nu);
509  AFAPI afError af_bessely_D(double *d_out, unsigned n, const double *d_in, double nu);
510  AFAPI afError af_bessely_Z(double *d_out, unsigned n, const double *d_in, double nu);
511 
515 #ifdef __cplusplus
516 }
517 #endif
afError af_besseli_C(float *d_out, unsigned n, const float *d_in, float nu)
afError af_besselh_D(double *d_out, unsigned k, unsigned n, const double *d_in, double nu)
afError af_kronProd_CC(cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
Single Precision Kronecker Tensor Product - Complex x Complex.
afError af_kronProd_CS(cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
Single Precision Kronecker Tensor Product - Complex x Real.
afError af_bessely_Z(double *d_out, unsigned n, const double *d_in, double nu)
afError af_bessely_S(float *d_out, unsigned n, const float *d_in, float nu)
afError af_kronProd_DZ(cdouble *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
Double Precision Kronecker Tensor Product - Real x Complex.
afError af_besselh_C(float *d_out, unsigned k, unsigned n, const float *d_in, float nu)
afError af_besselk_Z(double *d_out, unsigned n, const double *d_in, double nu)
array diff1(const array &in, int dim=-1)
afError af_diff_D(double *d_out, unsigned ndims_in, const unsigned *dims_in, const double *d_in, int order, int dim)
Double precision difference function.
void grad(array &dcols, array &drows, const array &in)
afError af_grad_U(unsigned *d_dx, unsigned *d_dy, unsigned nx, unsigned ny, const unsigned *d_in, unsigned batch)
Unsigned integer gradient function.
afError af_besselk_S(float *d_out, unsigned n, const float *d_in, float nu)
afError af_kronProd_DD(double *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
Double Precision Kronecker Tensor Product - Real x Complex.
afError af_bessely_C(float *d_out, unsigned n, const float *d_in, float nu)
afError af_kronProd_ZD(cdouble *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
Double Precision Kronecker Tensor Product - Complex x Real.
afError af_besseli_S(float *d_out, unsigned n, const float *d_in, float nu)
afError af_besselk_D(double *d_out, unsigned n, const double *d_in, double nu)
afError
Definition: defines.h:10
afError af_kronProd_SC(cfloat *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
Single Precision Kronecker Tensor Product - Real x Complex.
cuDoubleComplex cdouble
Definition: defines.h:109
afError af_besselk_C(float *d_out, unsigned n, const float *d_in, float nu)
afError af_kronProd_CD(cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
Kronecker Tensor Product - Single-precision Complex x Double-precision Real.
afError af_kronProd_ZZ(cdouble *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
Double Precision Kronecker Tensor Product - Complex x Complex.
afError af_kronProd_ZS(cfloat *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
Kronecker Tensor Product - Double-precision Complex x Single-precision Real.
afError af_besselj_Z(cdouble *d_out, unsigned n, const cdouble *d_in, double nu)
afError af_bessely_D(double *d_out, unsigned n, const double *d_in, double nu)
afError af_kronProd_ZC(cfloat *d_C, unsigned mA, unsigned nA, const cdouble *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
Kronecker Tensor Product - Double-precision Complex x Single-precision Complex.
afError af_kronProd_SZ(cfloat *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
Kronecker Tensor Product - Single-precision Real x Double-precision Complex.
afError af_besseli_Z(double *d_out, unsigned n, const double *d_in, double nu)
afError af_grad_B(bool *d_dx, bool *d_dy, unsigned nx, unsigned ny, const bool *d_in, unsigned batch)
afError af_besselj_S(float *d_out, unsigned n, const float *d_in, float nu)
afError af_grad_D(double *d_dx, double *d_dy, unsigned nx, unsigned ny, const double *d_in, unsigned batch)
Double precision, floating point gradient function.
afError af_kronProd_DS(float *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
Kronecker Tensor Product - Double-precision Real x Single-precision Real.
afError af_besselj_C(cfloat *d_out, unsigned n, const cfloat *d_in, float nu)
#define AFAPI
Definition: defines.h:45
afError af_kronProd_SS(float *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const float *d_B, unsigned batch_B)
Single Precision Kronecker Tensor Product - Real x Real.
afError af_grad_S(float *d_dx, float *d_dy, unsigned nx, unsigned ny, const float *d_in, unsigned batch)
Single precision, floating point gradient function.
afError af_kronProd_DC(cfloat *d_C, unsigned mA, unsigned nA, const double *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cfloat *d_B, unsigned batch_B)
Kronecker Tensor Product - Double-precision Real x Single-precision Complex.
afError af_besselh_Z(double *d_out, unsigned k, unsigned n, const double *d_in, double nu)
afError af_kronProd_CZ(cfloat *d_C, unsigned mA, unsigned nA, const cfloat *d_A, unsigned batch_A, unsigned mB, unsigned nB, const cdouble *d_B, unsigned batch_B)
Kronecker Tensor Product - Single-precision Complex x Double-precision Complex.
afError af_kronProd_SD(float *d_C, unsigned mA, unsigned nA, const float *d_A, unsigned batch_A, unsigned mB, unsigned nB, const double *d_B, unsigned batch_B)
Kronecker Tensor Product - Single-precision Real x Double-precision Real.
afError af_besselj_D(double *d_out, unsigned n, const double *d_in, double nu)
afError af_besseli_D(double *d_out, unsigned n, const double *d_in, double nu)
afError af_besselh_S(float *d_out, unsigned k, unsigned n, const float *d_in, float nu)
cuFloatComplex cfloat
Definition: defines.h:108
afError af_diff_S(float *d_out, unsigned ndims_in, const unsigned *dims_in, const float *d_in, int order, int dim)
Single precision, difference function.
afError af_grad_I(int *d_dx, int *d_dy, unsigned nx, unsigned ny, const int *d_in, unsigned batch)
Integer gradient function.
array diff2(const array &in, int dim=-1)