#ifndef __X10_ARRAY_POLYMATBUILDER_H
#define __X10_ARRAY_POLYMATBUILDER_H

#include <x10rt.h>


#define X10_ARRAY_MATBUILDER_H_NODEPS
#include <x10/array/MatBuilder.h>
#undef X10_ARRAY_MATBUILDER_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 lang { 
class Boolean;
} } 
namespace x10 { namespace array { 
class PolyMat;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class ArrayList;
} } 
namespace x10 { namespace array { 
class Row;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(Z1), class TPMGL(Z2), class TPMGL(U)> class Fun_0_2;
} } 
namespace x10 { namespace array { 
class PolyRow;
} } 
namespace x10 { namespace compiler { 
class CompilerFlags;
} } 
namespace x10 { namespace lang { 
class FailedDynamicCheckException;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(Z1), class TPMGL(U)> class Fun_0_1;
} } 
namespace x10 { namespace array { 

class PolyMatBuilder : public x10::array::MatBuilder   {
    public:
    RTT_H_DECLS_CLASS
    
    x10_int FMGL(rank);
    
    using x10::array::MatBuilder::add;
    
    void _constructor(x10_int rank);
    
    static x10aux::ref<x10::array::PolyMatBuilder> _make(x10_int rank);
    
    virtual x10aux::ref<x10::array::PolyMat> toSortedPolyMat(x10_boolean isSimplified);
    static x10_int FMGL(ZERO);
    
    static x10_int FMGL(ZERO__get)();
    static x10_int FMGL(GE);
    
    static x10_int FMGL(GE__get)();
    static x10_int FMGL(LE);
    
    static x10_int FMGL(LE__get)();
    static x10_int X(x10_int axis);
    virtual void add(x10_int coeff, x10_int op, x10_int k);
    virtual x10aux::ref<x10::array::PolyMatBuilder> x10__array__PolyMatBuilder____x10__array__PolyMatBuilder__this(
      );
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: virtual x10aux::serialization_id_t _get_serialization_id() {
         return _serialization_id;
    }
    
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: static x10aux::ref<x10::lang::Reference> _deserializer(x10aux::deserialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};

} } 
#endif // X10_ARRAY_POLYMATBUILDER_H

namespace x10 { namespace array { 
class PolyMatBuilder;
} } 

#ifndef X10_ARRAY_POLYMATBUILDER_H_NODEPS
#define X10_ARRAY_POLYMATBUILDER_H_NODEPS
#ifndef X10_ARRAY_POLYMATBUILDER_H_GENERICS
#define X10_ARRAY_POLYMATBUILDER_H_GENERICS
inline x10_int x10::array::PolyMatBuilder::FMGL(ZERO__get)() {
    return x10::array::PolyMatBuilder::FMGL(ZERO);
}

inline x10_int x10::array::PolyMatBuilder::FMGL(GE__get)() {
    return x10::array::PolyMatBuilder::FMGL(GE);
}

inline x10_int x10::array::PolyMatBuilder::FMGL(LE__get)() {
    return x10::array::PolyMatBuilder::FMGL(LE);
}

#endif // X10_ARRAY_POLYMATBUILDER_H_GENERICS
#endif // __X10_ARRAY_POLYMATBUILDER_H_NODEPS
