
#line 638 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
/*
 * THIS FILE WAS GENERATED BY PDL::PP! Do not modify!
 */

#define PDL_COMMENT(comment)
PDL_COMMENT("This preprocessor symbol is used to add commentary in the PDL  ")
PDL_COMMENT("autogenerated code. Normally, one would use typical C-style    ")
PDL_COMMENT("multiline comments (i.e. /* comment */). However, because such ")
PDL_COMMENT("comments do not nest, it's not possible for PDL::PP users to   ")
PDL_COMMENT("comment-out sections of code using multiline comments, as is   ")
PDL_COMMENT("often the practice when debugging, for example. So, when you   ")
PDL_COMMENT("see something like this:                                       ")
PDL_COMMENT("                                                               ")
                PDL_COMMENT("Memory access")
PDL_COMMENT("                                                               ")
PDL_COMMENT("just think of it as a C multiline comment like:                ")
PDL_COMMENT("                                                               ")
PDL_COMMENT("   /* Memory access */                                         ")

#define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \
    if (destroy) { \
	comp_free_code \
    } \
    if ((trans)->dims_redone) { \
	ntpriv_free_code \
    }

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "pdl.h"
#include "pdlcore.h"
#define PDL PDL_NDBin_Utils_PP
extern Core* PDL; PDL_COMMENT("Structure hold core C functions")
static int __pdl_boundscheck = 0;
static SV* CoreSV;       PDL_COMMENT("Gets pointer to perl var holding core structure")

#if ! 1
# define PP_INDTERM(max, at) at
#else
# define PP_INDTERM(max, at) (__pdl_boundscheck? PDL->safe_indterm(max,at, __FILE__, __LINE__) : at)
#endif
#line 46 "pp-_validate_grid.c"

#line 1295 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
pdl_error pdl__validate_grid_readdata(pdl_trans *__privtrans) {
pdl_error PDL_err = {0, NULL, 0};


#line 154 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
PDL_COMMENT("threadloop declarations")
int __thrloopval;
register PDL_Indx __tind0,__tind1; PDL_COMMENT("counters along dim")
register PDL_Indx __tnpdls = __privtrans->pdlthread.npdls;
PDL_COMMENT("dims here are how many steps along those dims")
register PDL_Indx __tinc0_grid = PDL_THR_INC(__privtrans->pdlthread.incs,__tnpdls,0,0);
register PDL_Indx __tinc1_grid = PDL_THR_INC(__privtrans->pdlthread.incs,__tnpdls,0,1);

#line 193 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
#define PDL_STARTTHREADLOOP__validate_grid(funcName) \
__thrloopval = PDL->startthreadloop(&(__privtrans->pdlthread),__privtrans->vtable->funcName, __privtrans, &PDL_err); \
if (PDL_err.error) return PDL_err; \
if ( __thrloopval < 0 ) return PDL->make_error_simple(PDL_EFATAL, "Error starting threadloop"); \
if ( __thrloopval ) return PDL_err; \
       do { \
	    PDL_Indx *__tdims = PDL->get_threaddims(&__privtrans->pdlthread); \
	    if (!__tdims) return PDL->make_error_simple(PDL_EFATAL, "Error in get_threaddims"); \
	    register PDL_Indx __tdims1 = __tdims[1]; \
	    register PDL_Indx __tdims0 = __tdims[0]; \
	    register PDL_Indx *__offsp = PDL->get_threadoffsp(&__privtrans->pdlthread); \
	    if (!__offsp ) return PDL->make_error_simple(PDL_EFATAL, "Error in get_threadoffsp"); \
      PDL_COMMENT("incs are each pdl's stride, declared at func start") \
      PDL_COMMENT("offs are each pthread's starting offset into each pdl") \
grid_datap += __offsp[0]; \
      for( __tind1 = 0 ; \
	    __tind1 < __tdims1 ; \
	    __tind1++ \
	    PDL_COMMENT("step by tinc1, undoing inner-loop of tinc0*tdims0") \
		,grid_datap += __tinc1_grid - __tinc0_grid * __tdims0 \
	 ) \
      { \
	 for( __tind0 = 0 ; \
	      __tind0 < __tdims0 ; \
	      __tind0++ \
		,grid_datap += __tinc0_grid \
	   ) { \
      PDL_COMMENT("This is the tightest threadloop. Make sure inside is optimal.")
#line 191 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"


#line 229 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
#define PDL_ENDTHREADLOOP__validate_grid \
} \
} \
PDL_COMMENT("undo outer-loop of tinc1*tdims1, and original per-pthread offset") \
grid_datap -= __tinc1_grid * __tdims1 + __offsp[0]; \
__thrloopval = PDL->iterthreadloop(&__privtrans->pdlthread,2); \
if ( __thrloopval < 0 ) return PDL->make_error_simple(PDL_EFATAL, "Error in iterthreadloop"); \
} while(__thrloopval);
#line 203 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
#line 1350 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 179 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
#define PDL_DECLARE_PARAMS__validate_grid(PDL_PARAMTYPE_grid) \
  PDL_DECLARE_PARAMETER(PDL_PARAMTYPE_grid, (__privtrans->vtable->per_pdl_flags[0]), grid, (__privtrans->pdls[0]))
#line 1355 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
register PDL_Indx __inc_grid_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_grid_n;
PDL_COMMENT("Start generic loop")
	switch(__privtrans->__datatype) {

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_SB: {
#line 1362 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_SByte)
#line 1366 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1379 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1390 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1398 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1405 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_B: {
#line 1409 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Byte)
#line 1413 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1426 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1437 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1445 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1452 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_S: {
#line 1456 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Short)
#line 1460 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1473 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1484 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1492 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1499 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_US: {
#line 1503 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Ushort)
#line 1507 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1520 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1531 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1546 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_L: {
#line 1550 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Long)
#line 1554 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1567 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1578 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1586 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1593 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_UL: {
#line 1597 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_ULong)
#line 1601 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1614 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1625 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1633 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1640 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_IND: {
#line 1644 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Indx)
#line 1648 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1661 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1672 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1680 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1687 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_ULL: {
#line 1691 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_ULongLong)
#line 1695 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1708 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1719 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1727 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1734 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_LL: {
#line 1738 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_LongLong)
#line 1742 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1755 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1766 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1774 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1781 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_F: {
#line 1785 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Float)
#line 1789 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1802 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1813 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1821 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1828 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_D: {
#line 1832 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_Double)
#line 1836 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1849 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1860 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1868 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1875 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 532 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
case PDL_LD: {
#line 1879 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 528 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
		PDL_DECLARE_PARAMS__validate_grid(PDL_LDouble)
#line 1883 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_STARTTHREADLOOP__validate_grid(readdata){

	        PDL_Indx n = __privtrans->ind_sizes[0];
	        PDL_Indx nm1 = n - 1;
		PDL_Indx idx;
	        if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] < (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] >= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing\n")
#line 1896 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
	        else if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], 0))] > (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], nm1))] ) {
		  for ( idx = 0 ; idx < n - 1; idx++ ) {
		      PDL_Indx idx1 = idx + 1;
		      if ( (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx))] <= (grid_datap)[0+(__inc_grid_n*PP_INDTERM(__privtrans->ind_sizes[0], idx1))] )
		        
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically decreasing\n")
#line 1907 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		  }
		}
		else {
	          
#line 395 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL->make_error(PDL_EUSERERROR, "Error in _validate_grid:" "grid is not monotonically increasing or decreasing\n")
#line 1915 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
;
		}
	
}PDL_ENDTHREADLOOP__validate_grid
#line 539 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/PDLCode.pm"
} break;
#line 1922 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

	default:return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in _validate_grid: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);}
return PDL_err;}
#line 680 "pp-_validate_grid.c"



#line 2267 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
static pdl_datatypes pdl__validate_grid_vtable_gentypes[] = { PDL_SB, PDL_B, PDL_S, PDL_US, PDL_L, PDL_UL, PDL_IND, PDL_ULL, PDL_LL, PDL_F, PDL_D, PDL_LD, -1 };
static char pdl__validate_grid_vtable_flags[] = {
  PDL_TPDL_VAFFINE_OK
};
static PDL_Indx pdl__validate_grid_vtable_realdims[] = { 1 };
static char *pdl__validate_grid_vtable_parnames[] = { "grid" };
static short pdl__validate_grid_vtable_parflags[] = {
  0
};
static pdl_datatypes pdl__validate_grid_vtable_partypes[] = { -1 };
static PDL_Indx pdl__validate_grid_vtable_realdims_starts[] = { 0 };
static PDL_Indx pdl__validate_grid_vtable_realdims_ind_ids[] = { 0 };
static char *pdl__validate_grid_vtable_indnames[] = { "n" };
pdl_transvtable pdl__validate_grid_vtable = {
  PDL_TRANS_DO_THREAD, 0, pdl__validate_grid_vtable_gentypes, 1, 1, pdl__validate_grid_vtable_flags,
  pdl__validate_grid_vtable_realdims, pdl__validate_grid_vtable_parnames,
  pdl__validate_grid_vtable_parflags, pdl__validate_grid_vtable_partypes,
  pdl__validate_grid_vtable_realdims_starts, pdl__validate_grid_vtable_realdims_ind_ids, 1,
  1, pdl__validate_grid_vtable_indnames,
  NULL, pdl__validate_grid_readdata, NULL,
  NULL,
  0,"PDL::NDBin::Utils_PP::_validate_grid"
};
#line 708 "pp-_validate_grid.c"



#line 2188 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
pdl_error pdl__validate_grid_run(pdl  *grid) {
pdl_error PDL_err = {0, NULL, 0};

#line 2164 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
if (!PDL) croak("PDL core struct is NULL, can't continue");
pdl_trans *__privtrans = PDL->create_trans(&pdl__validate_grid_vtable);
#line 2194 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 2026 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
__privtrans->pdls[0] = grid;
#line 2198 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 2124 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_RETERROR(PDL_err, PDL->trans_check_pdls(__privtrans));
char 
#line 402 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
badflag_cache
#line 2128 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
 = PDL->trans_badflag_from_inputs(__privtrans);
#line 2207 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 2016 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
#line 2211 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 2034 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
grid = __privtrans->pdls[0];
#line 2215 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 160 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP/Signature.pm"
#line 2218 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 2040 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
#line 2222 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"

#line 2148 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
if (
#line 402 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
badflag_cache
#line 2151 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
) {
}
#line 2231 "/home/osboxes/.perlbrew/libs/perl-5.32.0@normal/lib/perl5/x86_64-linux/PDL/PP.pm"
return PDL_err;
}
#line 759 "pp-_validate_grid.c"
