#ifndef __X10_ARRAY_RECTLAYOUT_H
#define __X10_ARRAY_RECTLAYOUT_H

#include <x10rt.h>


#define X10_LANG_ANY_H_NODEPS
#include <x10/lang/Any.h>
#undef X10_LANG_ANY_H_NODEPS
#define X10_LANG_ANY_H_NODEPS
#include <x10/lang/Any.h>
#undef X10_LANG_ANY_H_NODEPS
#define X10_LANG_INT_H_NODEPS
#include <x10/lang/Int.h>
#undef X10_LANG_INT_H_NODEPS
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace array { 
class Region;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(Z1), class TPMGL(U)> class Fun_0_1;
} } 
namespace x10 { namespace compiler { 
class Inline;
} } 
namespace x10 { namespace array { 
class Point;
} } 
namespace x10 { namespace compiler { 
class Header;
} } 
namespace x10 { namespace lang { 
class String;
} } 
namespace x10 { namespace compiler { 
class Native;
} } 
namespace x10 { namespace compiler { 
class NonEscaping;
} } 
namespace x10 { namespace lang { 
class Object;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace array { 

class RectLayout   {
    public:
    RTT_H_DECLS_STRUCT
    
    x10::array::RectLayout* operator->() { return this; }
    
    x10_int FMGL(rank);
    
    static x10aux::itable_entry _itables[2];
    
    x10aux::itable_entry* _getITables() { return _itables; }
    
    static x10::lang::Any::itable<x10::array::RectLayout > _itable_0;
    
    static x10aux::itable_entry _iboxitables[2];
    
    x10aux::itable_entry* _getIBoxITables() { return _iboxitables; }
    
    static x10::array::RectLayout _alloc(){x10::array::RectLayout t; return t; }
    
    x10_int FMGL(size);
    
    x10aux::ref<x10::array::Array<x10_int> > FMGL(min);
    
    x10_int FMGL(min0);
    
    x10_int FMGL(min1);
    
    x10_int FMGL(min2);
    
    x10_int FMGL(min3);
    
    x10aux::ref<x10::array::Array<x10_int> > FMGL(delta);
    
    x10_int FMGL(delta0);
    
    x10_int FMGL(delta1);
    
    x10_int FMGL(delta2);
    
    x10_int FMGL(delta3);
    
    void _constructor(x10aux::ref<x10::array::Region> reg);
    
    static x10::array::RectLayout _make(x10aux::ref<x10::array::Region> reg);
    
    void _constructor(x10_int _min0, x10_int _max0) {
        
        //#line 97 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": polyglot.ast.Empty_c
        ;
        
        //#line 98 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.AssignPropertyCall_c
        FMGL(rank) = ((x10_int)1);
        
        //#line 99 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(min0) = _min0;
        
        //#line 100 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(delta0) = ((x10_int) ((((x10_int) ((_max0) - (_min0)))) + (((x10_int)1))));
        
        //#line 101 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(size) = (((*this)->FMGL(delta0)) > (((x10_int)0))) ? ((*this)->
                                                                              FMGL(delta0))
          : (((x10_int)0));
        
        //#line 103 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(min1) = ((x10_int)0);
        
        //#line 103 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(delta1) = ((x10_int)0);
        
        //#line 104 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(min2) = ((x10_int)0);
        
        //#line 104 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(delta2) = ((x10_int)0);
        
        //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(min3) = ((x10_int)0);
        
        //#line 105 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(delta3) = ((x10_int)0);
        
        //#line 106 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(min) = X10_NULL;
        
        //#line 106 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10FieldAssign_c
        (*this)->FMGL(delta) = X10_NULL;
    }
    static x10::array::RectLayout _make(x10_int _min0, x10_int _max0)
    {
        x10::array::RectLayout this_; 
        this_->_constructor(_min0, _max0);
        return this_;
    }
    
    x10_int size() {
        
        //#line 111 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return (*this)->FMGL(size);
        
    }
    x10_int offset(x10aux::ref<x10::array::Point> pt);
    x10_int offset(x10_int i0) {
        
        //#line 130 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10LocalDecl_c
        x10_int offset = ((x10_int) ((i0) - ((*this)->FMGL(min0))));
        
        //#line 131 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return offset;
        
    }
    x10_int offset(x10_int i0, x10_int i1) {
        
        //#line 135 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10LocalDecl_c
        x10_int offset = ((x10_int) ((i0) - ((*this)->FMGL(min0))));
        
        //#line 136 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10LocalAssign_c
        offset = ((x10_int) ((((x10_int) ((((x10_int) ((offset) * ((*this)->
                                                                     FMGL(delta1))))) + (i1)))) - ((*this)->
                                                                                                     FMGL(min1))));
        
        //#line 137 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return offset;
        
    }
    x10_int offset(x10_int i0, x10_int i1, x10_int i2) {
        
        //#line 141 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10LocalDecl_c
        x10_int offset = ((x10_int) ((i0) - ((*this)->FMGL(min0))));
        
        //#line 142 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10LocalAssign_c
        offset = ((x10_int) ((((x10_int) ((((x10_int) ((offset) * ((*this)->
                                                                     FMGL(delta1))))) + (i1)))) - ((*this)->
                                                                                                     FMGL(min1))));
        
        //#line 143 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10LocalAssign_c
        offset = ((x10_int) ((((x10_int) ((((x10_int) ((offset) * ((*this)->
                                                                     FMGL(delta2))))) + (i2)))) - ((*this)->
                                                                                                     FMGL(min2))));
        
        //#line 144 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return offset;
        
    }
    x10_int offset(x10_int i0, x10_int i1, x10_int i2, x10_int i3) {
        
        //#line 148 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10LocalDecl_c
        x10_int offset = ((x10_int) ((i0) - ((*this)->FMGL(min0))));
        
        //#line 149 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10LocalAssign_c
        offset = ((x10_int) ((((x10_int) ((((x10_int) ((offset) * ((*this)->
                                                                     FMGL(delta1))))) + (i1)))) - ((*this)->
                                                                                                     FMGL(min1))));
        
        //#line 150 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10LocalAssign_c
        offset = ((x10_int) ((((x10_int) ((((x10_int) ((offset) * ((*this)->
                                                                     FMGL(delta2))))) + (i2)))) - ((*this)->
                                                                                                     FMGL(min2))));
        
        //#line 151 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": Eval of x10.ast.X10LocalAssign_c
        offset = ((x10_int) ((((x10_int) ((((x10_int) ((offset) * ((*this)->
                                                                     FMGL(delta3))))) + (i3)))) - ((*this)->
                                                                                                     FMGL(min3))));
        
        //#line 152 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return offset;
        
    }
    x10aux::ref<x10::lang::String> toString();
    x10aux::ref<x10::lang::String> typeName();
    x10_int hashCode();
    x10_boolean equals(x10aux::ref<x10::lang::Any> other);
    x10_boolean equals(x10::array::RectLayout other) {
        
        //#line 22 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return (x10aux::struct_equals((*this)->FMGL(rank),
                                      other->FMGL(rank))) &&
        (x10aux::struct_equals((*this)->FMGL(size), other->
                                                      FMGL(size))) &&
        (x10aux::struct_equals((*this)->FMGL(min), other->
                                                     FMGL(min))) &&
        (x10aux::struct_equals((*this)->FMGL(min0), other->
                                                      FMGL(min0))) &&
        (x10aux::struct_equals((*this)->FMGL(min1), other->
                                                      FMGL(min1))) &&
        (x10aux::struct_equals((*this)->FMGL(min2), other->
                                                      FMGL(min2))) &&
        (x10aux::struct_equals((*this)->FMGL(min3), other->
                                                      FMGL(min3))) &&
        (x10aux::struct_equals((*this)->FMGL(delta), other->
                                                       FMGL(delta))) &&
        (x10aux::struct_equals((*this)->FMGL(delta0), other->
                                                        FMGL(delta0))) &&
        (x10aux::struct_equals((*this)->FMGL(delta1), other->
                                                        FMGL(delta1))) &&
        (x10aux::struct_equals((*this)->FMGL(delta2), other->
                                                        FMGL(delta2))) &&
        (x10aux::struct_equals((*this)->FMGL(delta3), other->
                                                        FMGL(delta3)));
        
    }
    x10_boolean _struct_equals(x10aux::ref<x10::lang::Any> other);
    x10_boolean _struct_equals(x10::array::RectLayout other) {
        
        //#line 22 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return (x10aux::struct_equals((*this)->FMGL(rank),
                                      other->FMGL(rank))) &&
        (x10aux::struct_equals((*this)->FMGL(size), other->
                                                      FMGL(size))) &&
        (x10aux::struct_equals((*this)->FMGL(min), other->
                                                     FMGL(min))) &&
        (x10aux::struct_equals((*this)->FMGL(min0), other->
                                                      FMGL(min0))) &&
        (x10aux::struct_equals((*this)->FMGL(min1), other->
                                                      FMGL(min1))) &&
        (x10aux::struct_equals((*this)->FMGL(min2), other->
                                                      FMGL(min2))) &&
        (x10aux::struct_equals((*this)->FMGL(min3), other->
                                                      FMGL(min3))) &&
        (x10aux::struct_equals((*this)->FMGL(delta), other->
                                                       FMGL(delta))) &&
        (x10aux::struct_equals((*this)->FMGL(delta0), other->
                                                        FMGL(delta0))) &&
        (x10aux::struct_equals((*this)->FMGL(delta1), other->
                                                        FMGL(delta1))) &&
        (x10aux::struct_equals((*this)->FMGL(delta2), other->
                                                        FMGL(delta2))) &&
        (x10aux::struct_equals((*this)->FMGL(delta3), other->
                                                        FMGL(delta3)));
        
    }
    x10::array::RectLayout x10__array__RectLayout____x10__array__RectLayout__this(
      ) {
        
        //#line 22 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/RectLayout.x10": x10.ast.X10Return_c
        return (*this);
        
    }
    
    static void _serialize(x10::array::RectLayout this_, x10aux::serialization_buffer& buf);
    
    static x10::array::RectLayout _deserialize(x10aux::deserialization_buffer& buf) {
        x10::array::RectLayout this_;
        this_->_deserialize_body(buf);
        return this_;
    }
    
    void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};

} } 
#endif // X10_ARRAY_RECTLAYOUT_H

namespace x10 { namespace array { 
class RectLayout;
} } 

#ifndef X10_ARRAY_RECTLAYOUT_H_NODEPS
#define X10_ARRAY_RECTLAYOUT_H_NODEPS
#include <x10/lang/Any.h>
#include <x10/lang/Int.h>
#include <x10/array/Array.h>
#include <x10/array/Region.h>
#include <x10/lang/Fun_0_1.h>
#include <x10/compiler/Inline.h>
#include <x10/array/Point.h>
#include <x10/compiler/Header.h>
#include <x10/lang/String.h>
#include <x10/compiler/Native.h>
#include <x10/compiler/NonEscaping.h>
#include <x10/lang/Object.h>
#include <x10/lang/Boolean.h>
#ifndef X10_ARRAY_RECTLAYOUT_H_GENERICS
#define X10_ARRAY_RECTLAYOUT_H_GENERICS
#endif // X10_ARRAY_RECTLAYOUT_H_GENERICS
#endif // __X10_ARRAY_RECTLAYOUT_H_NODEPS
