Cython: math.pyx

Generated by Cython 0.29.23

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: math.c

    +01: cimport cython

      __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     02:

     03: @cython.boundscheck(False)  # Deactivate bounds checking

     04: @cython.wraparound(False)   # Deactivate negative indexing.

    +05: cdef double mv_max(double [:] mv):

    static double __pyx_f_7develia_7cytools_4math_mv_max(__Pyx_memviewslice __pyx_v_mv) {
      double __pyx_v_output;
      double __pyx_v_tmp;
      unsigned int __pyx_v_i;
      double __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("mv_max", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +06:     cdef double output = mv[0]

      __pyx_t_1 = 0;
      __pyx_v_output = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_1 * __pyx_v_mv.strides[0]) )));

     07:     cdef double tmp

     08:     cdef unsigned int i

    +09:     for i in range(1,mv.shape[0]):

      __pyx_t_2 = (__pyx_v_mv.shape[0]);
      __pyx_t_3 = __pyx_t_2;
      for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
        __pyx_v_i = __pyx_t_4;

    +10:         tmp = mv[i]

        __pyx_t_5 = __pyx_v_i;
        __pyx_v_tmp = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_5 * __pyx_v_mv.strides[0]) )));

    +11:         if tmp > output:

        __pyx_t_6 = ((__pyx_v_tmp > __pyx_v_output) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }

    +12:             output = tmp

          __pyx_v_output = __pyx_v_tmp;

     13:

    +14:     return output

      __pyx_r = __pyx_v_output;
      goto __pyx_L0;

     15:

     16: @cython.boundscheck(False)  # Deactivate bounds checking

     17: @cython.wraparound(False)   # Deactivate negative indexing.

    +18: cdef double mv_min(double [:] mv):

    static double __pyx_f_7develia_7cytools_4math_mv_min(__Pyx_memviewslice __pyx_v_mv) {
      double __pyx_v_output;
      double __pyx_v_tmp;
      unsigned int __pyx_v_i;
      double __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("mv_min", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +19:     cdef double output = mv[0]

      __pyx_t_1 = 0;
      __pyx_v_output = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_1 * __pyx_v_mv.strides[0]) )));

     20:     cdef double tmp

     21:     cdef unsigned int i

    +22:     for i in range(1,mv.shape[0]):

      __pyx_t_2 = (__pyx_v_mv.shape[0]);
      __pyx_t_3 = __pyx_t_2;
      for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
        __pyx_v_i = __pyx_t_4;

    +23:         tmp = mv[i]

        __pyx_t_5 = __pyx_v_i;
        __pyx_v_tmp = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_5 * __pyx_v_mv.strides[0]) )));

    +24:         if tmp < output:

        __pyx_t_6 = ((__pyx_v_tmp < __pyx_v_output) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }

    +25:             output = tmp

          __pyx_v_output = __pyx_v_tmp;

     26:

    +27:     return output

      __pyx_r = __pyx_v_output;
      goto __pyx_L0;

     28:

     29:

     30:

     31: @cython.boundscheck(False)  # Deactivate bounds checking

     32: @cython.wraparound(False)   # Deactivate negative indexing.

    +33: cdef double mv_max2d(double [:,:] mv):

    static double __pyx_f_7develia_7cytools_4math_mv_max2d(__Pyx_memviewslice __pyx_v_mv) {
      double __pyx_v_output;
      double __pyx_v_tmp;
      unsigned int __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      double __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("mv_max2d", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +34:     cdef double output = mv[0,0]

      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_v_output = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_1 * __pyx_v_mv.strides[0]) ) + __pyx_t_2 * __pyx_v_mv.strides[1]) )));

     35:     cdef double tmp

     36:     cdef unsigned int i

    +37:     for i in range(0,mv.shape[0]):

      __pyx_t_3 = (__pyx_v_mv.shape[0]);
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

    +38:         for j in range(0, mv.shape[1]):

        __pyx_t_6 = (__pyx_v_mv.shape[1]);
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_j = __pyx_t_8;

    +39:             tmp = mv[i,j]

          __pyx_t_9 = __pyx_v_i;
          __pyx_t_2 = __pyx_v_j;
          __pyx_v_tmp = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_9 * __pyx_v_mv.strides[0]) ) + __pyx_t_2 * __pyx_v_mv.strides[1]) )));

    +40:             if tmp > output:

          __pyx_t_10 = ((__pyx_v_tmp > __pyx_v_output) != 0);
          if (__pyx_t_10) {
    /* … */
          }
        }
      }

    +41:                 output = tmp

            __pyx_v_output = __pyx_v_tmp;

     42:

    +43:     return output

      __pyx_r = __pyx_v_output;
      goto __pyx_L0;

     44:

     45: @cython.boundscheck(False)  # Deactivate bounds checking

     46: @cython.wraparound(False)   # Deactivate negative indexing.

    +47: cdef double mv_min2d(double [:,:] mv):

    static double __pyx_f_7develia_7cytools_4math_mv_min2d(__Pyx_memviewslice __pyx_v_mv) {
      double __pyx_v_output;
      double __pyx_v_tmp;
      unsigned int __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      double __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("mv_min2d", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +48:     cdef double output = mv[0,0]

      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_v_output = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_1 * __pyx_v_mv.strides[0]) ) + __pyx_t_2 * __pyx_v_mv.strides[1]) )));

     49:     cdef double tmp

     50:     cdef unsigned int i

    +51:     for i in range(0,mv.shape[0]):

      __pyx_t_3 = (__pyx_v_mv.shape[0]);
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

    +52:         for j in range(0, mv.shape[1]):

        __pyx_t_6 = (__pyx_v_mv.shape[1]);
        __pyx_t_7 = __pyx_t_6;
        for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
          __pyx_v_j = __pyx_t_8;

    +53:             tmp = mv[i,j]

          __pyx_t_9 = __pyx_v_i;
          __pyx_t_2 = __pyx_v_j;
          __pyx_v_tmp = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_9 * __pyx_v_mv.strides[0]) ) + __pyx_t_2 * __pyx_v_mv.strides[1]) )));

    +54:             if tmp < output:

          __pyx_t_10 = ((__pyx_v_tmp < __pyx_v_output) != 0);
          if (__pyx_t_10) {
    /* … */
          }
        }
      }

    +55:                 output = tmp

            __pyx_v_output = __pyx_v_tmp;

     56:

    +57:     return output

      __pyx_r = __pyx_v_output;
      goto __pyx_L0;

     58:

     59: @cython.boundscheck(False)  # Deactivate bounds checking

     60: @cython.wraparound(False)   # Deactivate negative indexing.

    +61: cdef double mv_argmax(double [:] mv):

    static double __pyx_f_7develia_7cytools_4math_mv_argmax(__Pyx_memviewslice __pyx_v_mv) {
      double __pyx_v_output;
      double __pyx_v_tmp;
      unsigned int __pyx_v_index;
      unsigned int __pyx_v_i;
      double __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("mv_argmax", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +62:     cdef double output = mv[0]

      __pyx_t_1 = 0;
      __pyx_v_output = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_1 * __pyx_v_mv.strides[0]) )));

     63:     cdef double tmp

    +64:     cdef unsigned int index = 0

      __pyx_v_index = 0;

     65:     cdef unsigned int i

    +66:     for i in range(1,mv.shape[0]):

      __pyx_t_2 = (__pyx_v_mv.shape[0]);
      __pyx_t_3 = __pyx_t_2;
      for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
        __pyx_v_i = __pyx_t_4;

    +67:         tmp = mv[i]

        __pyx_t_5 = __pyx_v_i;
        __pyx_v_tmp = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_5 * __pyx_v_mv.strides[0]) )));

    +68:         if tmp > output:

        __pyx_t_6 = ((__pyx_v_tmp > __pyx_v_output) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }

    +69:             output = tmp

          __pyx_v_output = __pyx_v_tmp;

    +70:             index = i

          __pyx_v_index = __pyx_v_i;

     71:

     72:

    +73:     return index

      __pyx_r = __pyx_v_index;
      goto __pyx_L0;

     74:

     75: @cython.boundscheck(False)  # Deactivate bounds checking

     76: @cython.wraparound(False)   # Deactivate negative indexing.

    +77: cdef double mv_argmin(double [:] mv):

    static double __pyx_f_7develia_7cytools_4math_mv_argmin(__Pyx_memviewslice __pyx_v_mv) {
      double __pyx_v_output;
      double __pyx_v_tmp;
      unsigned int __pyx_v_index;
      unsigned int __pyx_v_i;
      double __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("mv_argmin", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +78:     cdef double output = mv[0]

      __pyx_t_1 = 0;
      __pyx_v_output = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_1 * __pyx_v_mv.strides[0]) )));

     79:     cdef double tmp

    +80:     cdef unsigned int index = 0

      __pyx_v_index = 0;

     81:     cdef unsigned int i

    +82:     for i in range(1,mv.shape[0]):

      __pyx_t_2 = (__pyx_v_mv.shape[0]);
      __pyx_t_3 = __pyx_t_2;
      for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
        __pyx_v_i = __pyx_t_4;

    +83:         tmp = mv[i]

        __pyx_t_5 = __pyx_v_i;
        __pyx_v_tmp = (*((double *) ( /* dim=0 */ (__pyx_v_mv.data + __pyx_t_5 * __pyx_v_mv.strides[0]) )));

    +84:         if tmp < output:

        __pyx_t_6 = ((__pyx_v_tmp < __pyx_v_output) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }

    +85:             output = tmp

          __pyx_v_output = __pyx_v_tmp;

    +86:             index = i

          __pyx_v_index = __pyx_v_i;

     87:

    +88:     return index

      __pyx_r = __pyx_v_index;
      goto __pyx_L0;