#ifdef __cplusplus
extern "C" {
#endif


#ifndef MACRO_H

#define S_O_S(a) ((a)->ob_self)
#define S_O_K(a) ((a)->ob_kind)
#define C_O_K(a,b) ((a)->ob_kind = (OBJECTKIND)(b),OK)
#define C_O_S(a,b) ((a)->ob_self = (b),OK)
#define B_KS_O(a,b,c) (C_O_S(c,b), C_O_K(c,a)) /* build_kind_self_object */
#define CALLOCOBJECT()  (OP)calloc(1,sizeof(struct object))

#define EMPTYP(a) ((a)->ob_kind == (OBJECTKIND)0)
#define EQ(a,b) (comp(a,b) == (INT)0)
#define NEQ(a,b) (comp(a,b) != (INT)0)
#define GR(a,b) (comp(a,b) > (INT)0)
#define GT(a,b) (comp(a,b) > (INT)0)
#define GE(a,b) (comp(a,b) >= (INT)0)
#define LE(a,b) (comp(a,b) <= (INT)0)
#define LT(a,b) (comp(a,b) < (INT)0)

#define S_I_I(a) (((a)->ob_self).ob_INT)
#define C_I_I(a,b) (((a)->ob_self.ob_INT = (INT)(b)), OK )
#define M_I_I(a,b)  (\
			((b)->ob_self.ob_INT = (INT)(a)),\
 			((b)->ob_kind = INTEGER),\
			 OK \
		    )
/* #define M_I_I(a,b) ( C_I_I(b,a) , C_O_K(b,INTEGER)) */
#define DEC_INTEGER(a) (((a)->ob_self).ob_INT --, OK)
#define INC_INTEGER(a) (((a)->ob_self).ob_INT ++, OK)
#define EQ_INTEGER(a,b) (((a)->ob_self.ob_INT) == ((b)->ob_self.ob_INT) )
#define COPY_INTEGER(a,b) (C_O_K(b,INTEGER),C_I_I(b,(a->ob_self).ob_INT))
#define FREESELF_INTEGER(a) (C_O_K((a),(OBJECTKIND)0),OK)
#define NULLP_INTEGER(a) ((S_I_I((a)) == (INT)0)?TRUE:FALSE)
#define POSP_INTEGER(a) ((S_I_I((a)) > (INT)0)?TRUE:FALSE)
#define EINSP_INTEGER(a) ((S_I_I(a) == (INT)1)?TRUE:FALSE)
#define NEGEINSP_INTEGER(a) ((S_I_I((a)) == (INT)-1)?TRUE:FALSE)
#define COMP_INTEGER_INTEGER(a,b) ((S_I_I(a) == S_I_I(b))? 0L :\
	((S_I_I(a) > S_I_I(b))? 1L : -1L) )
#define INTEGERP(a) (S_O_K(a) == INTEGER)

#define S_V_S(a) ((((a)->ob_self).ob_vector)->v_self)
#define C_V_S(a,b) (((((a)->ob_self).ob_vector)->v_self) = ((OP) b))
#define S_V_L(a) ((((a)->ob_self).ob_vector)->v_length)
#define C_V_L(a,b) (((((a)->ob_self).ob_vector)->v_length) = (b))
#define S_V_I(a,i) (((((a)->ob_self).ob_vector)->v_self)+(i))
#define S_V_II(a,i) (((((((a)->ob_self).ob_vector)->v_self)+(i))\
			->ob_self).ob_INT)
#define S_V_LI(a) ((((((a)->ob_self).ob_vector)->v_length)->ob_self).ob_INT)

#define VECTORP(a) ((S_O_K(a) == VECTOR) \
			|| (S_O_K(a) == WORD) \
			|| (S_O_K(a) == INTEGERVECTOR) \
			|| (S_O_K(a) == COMP) \
			|| (S_O_K(a) == LAURENT) \
			|| (S_O_K(a) == KRANZ) \
			|| (S_O_K(a) == FF) \
		)

#define LISTP(a) ((S_O_K(a) == SYMLIST) \
			|| (S_O_K(a) == SCHUR) \
			|| (S_O_K(a) == GRAL) \
			|| (S_O_K(a) == POLYNOM) \
			|| (S_O_K(a) == SCHUBERT) \
			|| (S_O_K(a) == MONOPOLY) \
			|| (S_O_K(a) == ELM_SYM) \
			|| (S_O_K(a) == POW_SYM) \
			|| (S_O_K(a) == MONOMIAL) \
			|| (S_O_K(a) == HOM_SYM) \
		)

#define S_L_S(a) ((((a)->ob_self).ob_list)->l_self)
#define C_L_S(a,b) (((((a)->ob_self).ob_list)->l_self) = (OP)(b))
#define S_L_N(a) ((((a)->ob_self).ob_list)->l_next)
#define C_L_N(a,b) (((((a)->ob_self).ob_list)->l_next) = (OP)(b))

#define S_PA_C(a) ((unsigned char *)  (S_PA_S(a))) 
#define S_PA_K(a) ((a)->ob_self.ob_partition->pa_kind)
#define C_PA_K(a,b) (((((a)->ob_self).ob_partition)->pa_kind) = b)
#define S_PA_S(a) ((a)->ob_self.ob_partition->pa_self)
#define C_PA_S(a,b) ((a)->ob_self.ob_partition->pa_self = b)
#define S_PA_I(a,i) S_V_I((a)->ob_self.ob_partition->pa_self,i)
#define S_PA_II(a,i)  \
((S_O_K(a) == CHARPARTITION || S_O_K(a) == CHAR_AUG_PART) ?   \
		(INT)(S_PA_C(a)[i+1]) : \
		S_V_II((a)->ob_self.ob_partition->pa_self,i))
#define S_PA_CII(a,i) (S_PA_C(a)[i+1])
#define S_PA_CI(a,i) (S_PA_C(a)+i+1)
#define S_PA_CL(a) (S_PA_C(a)[0])
#define S_PA_L(a) S_V_L(S_PA_S(a))
#define S_PA_LI(a) \
((S_O_K(a) == CHARPARTITION || S_O_K(a) == CHAR_AUG_PART) ?  \
		(INT)(S_PA_C(a)[0]) : \
		S_V_LI(S_PA_S(a)))
#define INC_PARTITION(a) inc_vector(S_PA_S(a))
#define DEC_PARTITION(a) dec_vector(S_PA_S(a))

#define S_P_K(a) ((((a)->ob_self).ob_permutation)->p_kind)
#define C_P_K(a,b) (((((a)->ob_self).ob_permutation)->p_kind) = b)
#define S_P_S(a) ((((a)->ob_self).ob_permutation)->p_self)
#define C_P_S(a,b) (((((a)->ob_self).ob_permutation)->p_self) = b)
#define S_P_I(a,i) S_V_I(((((a)->ob_self).ob_permutation)->p_self),(i))
#define S_P_II(a,i) S_V_II(((((a)->ob_self).ob_permutation)->p_self),(i))
#define S_P_L(a) S_V_L(S_P_S(a))
#define S_P_LI(a) S_V_LI(S_P_S(a))

#define S_M_L(a) ((((a)->ob_self).ob_matrix)->m_length)
#define C_M_L(a,b) (((((a)->ob_self).ob_matrix)->m_length)=(b))
#define S_M_LI(a) ((((((a)->ob_self).ob_matrix)->m_length)->ob_self).ob_INT)
#define S_M_H(a) ((((a)->ob_self).ob_matrix)->m_height)
#define C_M_H(a,b) (((((a)->ob_self).ob_matrix)->m_height)=(b))
#define S_M_HI(a) ((((((a)->ob_self).ob_matrix)->m_height)->ob_self).ob_INT)
#define S_M_S(a) ((((a)->ob_self).ob_matrix)->m_self)
#define C_M_S(a,b) (((((a)->ob_self).ob_matrix)->m_self)=(b))
#define S_M_IJ(a,i,j) ( ((((a)->ob_self).ob_matrix)->m_self)\
	 + ((((((a)->ob_self).ob_matrix)->m_length)->ob_self).ob_INT)\
	 * (i) + (j) )
#define S_M_IJI(a,i,j) S_I_I(S_M_IJ(a,i,j)) 
#define MATRIXP(a) ((S_O_K(a) == MATRIX) || (S_O_K(a) == KRANZTYPUS)\
	|| (S_O_K(a) == KOSTKA) || (S_O_K(a) == INTEGERMATRIX) )

#define S_MO_S(a) (((a->ob_self).ob_monom)->mo_self)
#define C_MO_S(a,b) ((((a->ob_self).ob_monom)->mo_self)=(b))
#define S_MO_K(a) (((a->ob_self).ob_monom)->mo_koeff)
#define C_MO_K(a,b) ((((a->ob_self).ob_monom)->mo_koeff)=(b))
#define S_MO_KI(a) ((((a->ob_self).ob_monom)->mo_koeff)->ob_self.ob_INT)
#define S_MO_SI(a,i) S_V_I(S_MO_S(a),(i))
#define S_MO_SII(a,i) S_V_II(S_MO_S(a),(i))
#define S_MO_SL(a) S_V_L(S_MO_S(a))
#define S_MO_SLI(a) S_V_LI(S_MO_S(a))
#define COPY_MONOM(a,b) M_SK_MO(S_MO_S(a),S_MO_K(a),b)

#define S_B_I(a) (INT)((((a)->ob_self).ob_bruch)->b_info)
#define S_B_O(a) (OP)((((a)->ob_self).ob_bruch)->b_oben)
#define S_B_OI(a) (INT)((((((a)->ob_self).ob_bruch)->b_oben)->ob_self).ob_INT)
#define S_B_U(a) (OP)((((a)->ob_self).ob_bruch)->b_unten)
#define S_B_UI(a) (INT)((((((a)->ob_self).ob_bruch)->b_unten)->ob_self).ob_INT)
#define FREESELF_BRUCH(a) (SYMfreeall(S_B_O(a)),SYMfreeall(S_B_U(a)),\
		free(S_O_S(a).ob_bruch),C_O_K(a,0),OK)
#define C_B_I(a,b) (((((a)->ob_self).ob_bruch)->b_info)=(INT)(b))
#define C_B_O(a,b) (((((a)->ob_self).ob_bruch)->b_oben)=(b))
#define C_B_U(a,b) (((((a)->ob_self).ob_bruch)->b_unten)=(b))
#define EINSP_BRUCH(a) (EQ(S_B_O((a)),S_B_U((a))))
#define NULLP_BRUCH(a) (nullp(S_B_O((a))))
#define BRUCHP(a) (S_O_K(a) == BRUCH)

#define S_S_S(a)  ((((((((a)->ob_self).ob_list)->l_self))\
		->ob_self).ob_monom)->mo_self)
#define S_S_SL(a) S_PA_L( ((((((((a)->ob_self).ob_list)->l_self))\
		->ob_self).ob_monom)->mo_self)\
			)
#define S_S_SLI(a) S_PA_LI( ((((((((a)->ob_self).ob_list)->l_self))\
		->ob_self).ob_monom)->mo_self)\
			)
#define S_S_SI(a,i) S_PA_I( ((((((((a)->ob_self).ob_list)->l_self))\
		->ob_self).ob_monom)->mo_self)\
		,(i))
#define S_S_SII(a,i) S_PA_II( ((((((((a)->ob_self).ob_list)->l_self))\
		->ob_self).ob_monom)->mo_self)\
		,(i))
#define S_S_K(a) (S_MO_K(((((a)->ob_self).ob_list)->l_self)))
#define C_S_K(a,b) (C_MO_K(((((a)->ob_self).ob_list)->l_self),(b)))
#define C_S_S(a,b) (C_MO_S(((((a)->ob_self).ob_list)->l_self),(b)))
#define S_S_KI(a) (S_MO_KI(((((a)->ob_self).ob_list)->l_self)))
#define S_S_N(a) (S_L_N(a))
#define C_S_N(a,b) (C_L_N((a),(b)))
#define nullp_schur(a) nullp_polynom(a)

#define S_SCH_S(a) (S_MO_S(S_L_S(a)))
#define S_SCH_SL(a) (S_P_L(S_MO_S(S_L_S(a))))
#define S_SCH_SLI(a) (S_P_LI(S_MO_S(S_L_S(a))))
#define S_SCH_SI(a,i) S_P_I(S_SCH_S(a),(i))
#define S_SCH_SII(a,i) S_P_II(S_SCH_S(a),(i))
#define S_SCH_K(a) (S_MO_K(S_L_S(a)))
#define C_SCH_K(a,b) (C_MO_K(S_L_S(a),(b)))
#define S_SCH_KI(a) (S_MO_KI(S_L_S(a)))
#define S_SCH_N(a) (S_L_N(a))
#define C_SCH_N(a,b) (C_L_N((a),(b)))


#define POLYNOMP(a) (S_O_K(a) == POLYNOM)
#define S_PO_S(a) (S_MO_S(S_L_S(a)))
#define S_PO_SI(a,i) (S_V_I(S_MO_S(S_L_S(a)),i))
#define S_PO_SIJ(a,i,j) (S_M_IJ(S_MO_S(S_L_S(a)),i,j))
#define S_PO_SIJI(a,i,j) (S_M_IJI(S_MO_S(S_L_S(a)),i,j))
#define S_PO_SII(a,i) (S_V_II(S_MO_S(S_L_S(a)),i))
#define S_PO_SL(a) (S_V_L(S_MO_S(S_L_S(a))))
#define S_PO_SLI(a) (S_V_LI(S_MO_S(S_L_S(a))))
#define S_PO_K(a) (S_MO_K(S_L_S(a)))
#define S_PO_KI(a) (S_MO_KI(S_L_S(a)))
#define S_PO_N(a) (S_L_N(a))
#define C_PO_N(a,b) (C_L_N((a),(b)))
#define C_PO_K(a,b) (C_MO_K(S_L_S(a),(b)))
#define COPY_POLYNOM(a,b) copy_list(a,b)
#define M_SK_MO(a,b,c) (b_sk_mo(callocobject(),callocobject(),c),\
			copy(b,S_MO_K(c)),\
			copy(a,S_MO_S(c)))

#define S_SPA_G(a) ((((a)->ob_self).ob_skewpartition)->spa_gross)
#define S_SPA_GL(a) S_PA_L((((a)->ob_self).ob_skewpartition)->spa_gross)
#define S_SPA_GLI(a) S_PA_LI((((a)->ob_self).ob_skewpartition)->spa_gross)
#define S_SPA_GI(a,i) S_PA_I(((((a)->ob_self).ob_skewpartition)->spa_gross),i)
#define S_SPA_GII(a,i) S_PA_II(((((a)->ob_self).ob_skewpartition)->spa_gross),i)
#define S_SPA_GS(a) S_PA_S((((a)->ob_self).ob_skewpartition)->spa_gross)
#define S_SPA_K(a) ((((a)->ob_self).ob_skewpartition)->spa_klein)
#define S_SPA_KL(a) S_PA_L((((a)->ob_self).ob_skewpartition)->spa_klein)
#define S_SPA_KLI(a) S_PA_LI((((a)->ob_self).ob_skewpartition)->spa_klein)
#define S_SPA_KI(a,i) S_PA_I(S_SPA_K(a),i)
#define S_SPA_KII(a,i) S_PA_II(S_SPA_K(a),i)
#define S_SPA_KS(a) S_PA_S((((a)->ob_self).ob_skewpartition)->spa_klein)

#define S_T_S(a) ((((a)->ob_self).ob_tableaux)->t_self)
#define S_T_U(a) ((((a)->ob_self).ob_tableaux)->t_umriss)
#define S_T_IJ(a,i,j) S_M_IJ(S_T_S(a),i,j)
#define S_T_H(a) S_M_H(S_T_S(a))
#define S_T_HI(a) S_M_HI(S_T_S(a))
#define S_T_L(a) S_M_L(S_T_S(a))
#define S_T_LI(a) S_M_LI(S_T_S(a))
#define S_T_IJI(a,i,j) S_M_IJI(S_T_S(a),i,j)
#define S_T_UG(a) S_SPA_G(S_T_U(a))
#define S_T_UGLI(a) S_SPA_GLI(S_T_U(a))
#define S_T_UGL(a) S_SPA_GL(S_T_U(a))
#define S_T_UGII(a,i) S_SPA_GII(S_T_U(a),i)
#define S_T_UGI(a,i) S_SPA_GI(S_T_U(a),i)
#define S_T_UK(a) S_SPA_K(S_T_U(a))
#define S_T_UKLI(a) S_SPA_KLI(S_T_U(a))
#define S_T_UKL(a) S_SPA_KL(S_T_U(a))
#define S_T_UKII(a,i) S_SPA_KII(S_T_U(a),i)
#define S_T_UKI(a,i) S_SPA_KI(S_T_U(a),i)
#define S_T_UL(a) S_PA_L(S_T_U(a))
#define S_T_ULI(a) S_PA_LI(S_T_U(a))
#define S_T_UII(a,i) S_PA_II(S_T_U(a),i)
#define S_T_UI(a,i) S_PA_I(S_T_U(a),i)
#define TABLEAUXP(a) (S_O_K(a) == TABLEAUX)

#define S_W_I(a,i) S_V_I(a,i)
#define S_W_II(a,i) S_V_II(a,i)
#define S_W_L(a) S_V_L(a)
#define S_W_LI(a) S_V_LI(a)
#define S_W_S(a) S_V_S(a)
#define S_LA_I(a,i) S_V_I(a,i)
#define S_LA_II(a,i) S_V_II(a,i)
#define S_LA_L(a) S_V_L(a)
#define S_LA_LI(a) S_V_LI(a)
#define S_LA_S(a) S_V_S(a)
#define COMP_WORD(a,b) comp_vector(a,b)
#define b_l_w(a,b) (b_l_v(a,b),C_O_K(b,WORD),OK)
#define m_l_w(a,b) (m_l_v(a,b),C_O_K(b,WORD),OK)
#define m_il_w(a,b) (m_il_v(a,b),C_O_K(b,WORD),OK)
#define m_il_nw(a,b) (m_il_nv(a,b),C_O_K(b,WORD),OK)
#define m_l_nw(a,b) (m_l_nv(a,b),C_O_K(b,WORD),OK)
#define b_l_la(a,b) (b_l_v(a,b),C_O_K(b,LAURENT),OK)
#define m_l_la(a,b) (m_l_v(a,b),C_O_K(b,LAURENT),OK)
#define m_il_la(a,b) (m_il_v(a,b),C_O_K(b,LAURENT),OK)
#define m_il_nla(a,b) (m_il_nv(a,b),C_O_K(b,LAURENT),OK)
#define m_l_nla(a,b) (m_l_nv(a,b),C_O_K(b,LAURENT),OK)

#define S_SC_D(a) ((((a)->ob_self).ob_symchar)->sy_dimension)
#define S_SC_DI(a) S_I_I((((a)->ob_self).ob_symchar)->sy_dimension)
#define S_SC_W(a) ((((a)->ob_self).ob_symchar)->sy_werte)
#define S_SC_WI(a,i) S_V_I(((((a)->ob_self).ob_symchar)->sy_werte),i)
#define S_SC_WII(a,i) S_V_II(((((a)->ob_self).ob_symchar)->sy_werte),i)
#define S_SC_P(a) ((((a)->ob_self).ob_symchar)->sy_parlist)
#define S_SC_PI(a,i) S_V_I(((((a)->ob_self).ob_symchar)->sy_parlist),i)
#define S_SC_PLI(a) S_V_LI(((((a)->ob_self).ob_symchar)->sy_parlist))
#define S_SC_WLI(a) S_V_LI(((((a)->ob_self).ob_symchar)->sy_werte))

/* MD */
#define S_N_S(a) ((((a)->ob_self).ob_number)->n_self)
#define C_N_S(a,b) (((((a)->ob_self).ob_number)->n_self) = (b))
#define S_N_D(a) (((((a)->ob_self).ob_number)->n_data).o_data)
#define C_N_D(a,b) ((((((a)->ob_self).ob_number)->n_data).o_data) = (b))
#define S_N_DC(a) (((((a)->ob_self).ob_number)->n_data).c_data)
#define S_N_DCI(a) ((((((a)->ob_self).ob_number)->n_data).c_data)->index)
#define S_N_DCD(a) ((((((a)->ob_self).ob_number)->n_data).c_data)->deg)
#define S_N_DCP(a) ((((((a)->ob_self).ob_number)->n_data).c_data)->poly)
#define	OBJECTREAD_CYCLO(f,a)	objectread_number((f),(a),CYCLOTOMIC)
#define	OBJECTREAD_SQRAD(f,a)	objectread_number((f),(a),SQ_RADICAL)
#define	EINSP_MONOPOLY(a)	eq_fieldobject_int(MONOPOLY,(a),1L)
#define	EINSP_CYCLO(a)		eq_fieldobject_int(CYCLOTOMIC,(a),1L)
#define	EINSP_SQRAD(a)		eq_fieldobject_int(SQ_RADICAL,(a),1L)
#define	NEGEINSP_MONOPOLY(a)	eq_fieldobject_int(MONOPOLY,(a),-1L)
#define	NEGEINSP_CYCLO(a)	eq_fieldobject_int(CYCLOTOMIC,(a),-1L)
#define	NEGEINSP_SQRAD(a)	eq_fieldobject_int(SQ_RADICAL,(a),-1L)



#define evenp(a) even(a)
#define oddp(a) odd(a)
#define first_ym(a,b) ym_min(a,b)

#define mult_scalar_schur(a,b,c) mult_scalar_polynom(a,b,c)
#define addinvers_schubert(a,b) addinvers_polynom(a,b)
#define addinvers_schur(a,b) addinvers_polynom(a,b)
#define add_apply_schur(a,b) add_apply_symfunc(a,b)
#define add_apply_schur_schur(a,b) add_apply_symfunc_symfunc(a,b)

/* for MONOMIAL */
#define m_pa_mon(a,b) (m_pa_s(a,b),C_O_K(b,MONOMIAL),OK)
#define m_v_mon(a,b) (m_v_s(a,b),C_O_K(b,MONOMIAL),OK)
#define b_skn_mon(a,b,c,d) (b_skn_s(a,b,c,d),C_O_K(d,MONOMIAL),OK)
#define m_skn_mon(a,b,c,d) (m_skn_s(a,b,c,d),C_O_K(d,MONOMIAL),OK)
#define mult_monomial(a,b,c) mult_symfunc(a,b,d)
#define mult_monomial_monomial(a,b,c) mult_symfunc_symfunc(a,b,d)
#define addinvers_monomial(a,b) addinvers_polynom(a,b)
#define add_apply_monomial(a,b) add_apply_symfunc(a,b)
#define add_apply_monomial_monomial(a,b) add_apply_symfunc_symfunc(a,b)

/* for ELM_SYM */
#define m_pa_e(a,b) (m_pa_s(a,b),C_O_K(b,ELM_SYM),OK)
#define m_v_e(a,b) (m_v_s(a,b),C_O_K(b,ELM_SYM),OK)
#define add_monom_elmsym(a,b,c) add_monom_schur(a,b,c)
#define addinvers_elmsym(a,b) addinvers_polynom(a,b)
#define addinvers_apply_elmsym(a) addinvers_apply_polynom(a)
#define mult_scalar_elmsym(a,b,v) mult_scalar_polynom(a,b,v)
#define b_skn_e(a,b,c,d) (b_skn_s(a,b,c,d),C_O_K(d,ELM_SYM),OK)
#define m_skn_e(a,b,c,d) (m_skn_s(a,b,c,d),C_O_K(d,ELM_SYM),OK)
#define mult_elmsym(a,b,c) mult_symfunc(a,b,d)
#define mult_elmsym_elmsym(a,b,c) mult_symfunc_symfunc(a,b,d)
#define add_apply_elmsym(a,b) add_apply_symfunc(a,b)
#define add_apply_elmsym_elmsym(a,b) add_apply_symfunc_symfunc(a,b)

/* for POW_SYM */
#define m_pa_ps(a,b) (m_pa_s(a,b),C_O_K(b,POW_SYM),OK)
#define m_v_ps(a,b) (m_v_s(a,b),C_O_K(b,POW_SYM),OK)
#define add_monom_powsym(a,b,c) add_monom_schur(a,b,c)
#define addinvers_powsym(a,b) addinvers_polynom(a,b)
#define addinvers_apply_powsym(a) addinvers_apply_schur(a)
#define mult_scalar_powsym(a,b,v) mult_scalar_polynom(a,b,v)
#define b_skn_ps(a,b,c,d) (b_skn_s(a,b,c,d),C_O_K(d,POW_SYM),OK)
#define m_skn_ps(a,b,c,d) (m_skn_s(a,b,c,d),C_O_K(d,POW_SYM),OK)
#define compute_powsym_with_alphabet(a,b,c) \
	compute_power_with_alphabet(a,b,c)
#define mult_powsym(a,b,c) mult_symfunc(a,b,d)
#define mult_powsym_powsym(a,b,c) mult_symfunc_symfunc(a,b,d)
#define add_apply_powsym(a,b) add_apply_symfunc(a,b)
#define add_apply_powsym_powsym(a,b) add_apply_symfunc_symfunc(a,b)

/* for HOM_SYM */
#define m_pa_h(a,b) (m_pa_s(a,b),C_O_K(b,HOM_SYM),OK)
#define m_v_h(a,b) (m_v_s(a,b),C_O_K(b,HOM_SYM),OK)
#define add_monom_homsym(a,b,c) add_monom_schur(a,b,c)
#define addinvers_homsym(a,b) addinvers_schur(a,b)
#define addinvers_apply_homsym(a) addinvers_apply_schur(a)
#define mult_scalar_homsym(a,b,v) mult_scalar_polynom(a,b,v)
#define b_skn_h(a,b,c,d) (b_skn_s(a,b,c,d),C_O_K(d,HOM_SYM),OK)
#define m_skn_h(a,b,c,d) (m_skn_s(a,b,c,d),C_O_K(d,HOM_SYM),OK)
#define compute_homsym_with_alphabet(a,b,c) \
	compute_complete_with_alphabet(a,b,c)
#define mult_homsym(a,b,c) mult_symfunc(a,b,d)
#define mult_homsym_homsym(a,b,c) mult_symfunc_symfunc(a,b,d)
#define add_apply_homsym(a,b) add_apply_symfunc(a,b)
#define add_apply_homsym_homsym(a,b) add_apply_symfunc_symfunc(a,b)

/* for nc */
#define S_NC_GL(a) S_V_I(a,0L)
#define S_NC_C(a) S_V_I(a,1L)
#define SYM_GL(a) (S_V_II(a,0L)==1L) /* true falls sym */
#define ALT_GL(a) (S_V_II(a,0L)==2L) /* true falls alt */
#define KRANZ_GL(a) (S_V_II(a,0L)==3L) /* true falls kranz */
#define CYCLIC_GL(a) (S_V_II(a,0L)==4L) /* true falls cyclic */
#define S_GL_SYM_A(a) S_V_I(a,1L)
#define S_GL_ALT_A(a) S_V_I(a,1L)
#define S_GL_CYCLIC_A(a) S_V_I(a,1L)
#define S_GL_KRANZ_A(a) S_GL_SYM_A(S_V_I(S_V_I(a,1L),0L))
#define S_GL_KRANZ_GLA(a) (S_V_I(S_V_I(a,1L),0L))
#define S_GL_KRANZ_B(a) S_GL_SYM_A(S_V_I(S_V_I(a,1L),1L))
#define S_GL_KRANZ_GLB(a) (S_V_I(S_V_I(a,1L),1L))


/* for ga.c */

#define m_skn_gral(a,b,c,d) ( m_skn_po(a,b,c,d), C_O_K(d,GRAL), OK )
#define b_skn_gral(a,b,c,d) ( b_skn_po(a,b,c,d), C_O_K(d,GRAL), OK )
#define hplus_hecke(a,b) hplus(a,b)
#define mult_scalar_gral(a,b,c) mult_scalar_polynom(a,b,c)

/* for ff.c */
#define S_FF_C(a) S_V_I(a,(INT)0)
#define S_FF_CI(a) S_V_II(a,(INT)0)
#define S_FF_IP(a) S_O_S(S_V_I(a,1L)).ob_INTpointer
#define S_FF_II(a,i) *((S_O_S(S_V_I(a,1L)).ob_INTpointer) + i)
#define S_FF_DI(a) S_FF_II(a,(INT)0)


#define t_INTEGER_LONGINT(a,b) m_i_longint(a,b)
#define CTO(type,text,object) \
		COP(text,object);\
		if(S_O_K(object) != type) {\
			erg += wrong_type_oneparameter(text,object);\
			goto endr_ende; }
#define CTTO(type,type2,text,object) \
		COP(text,object);\
		if((S_O_K(object) != type)&&(S_O_K(object) != type2)) {\
			erg += wrong_type_oneparameter(text,object);\
			goto endr_ende; }
#define C2R(a,b,t,c) if (check_result_2(a,b,t,c) != NORESULT) goto endr_ende
#define S2R(a,b,t,c) erg += store_result_2(a,b,t,c)
#define C1R(a,t,c) if (check_result_1(a,t,c) != NORESULT) goto endr_ende
#define S1R(a,t,c) erg += store_result_1(a,t,c)
#define WTO(a,b) erg += wrong_type_oneparameter(a,b)
#define WTT(a,b,c) erg += wrong_type_twoparameter(a,b,c)
#define EDC(b) error_during_computation(b)
#define ENDR(a) endr_ende: if (erg != OK) EDC(a); return erg;
#define ENDO(a) endr_ende: if (erg != OK) EDC(a); return (OP) NULL;
#define NYI(b) not_yet_implemented(b)
#define NOP(a) null_object(a)
#define COP(b,a) if ((a) == NULL)  { erg += null_object(b); goto endr_ende;}
#define FATALERROR(text) fatal_error(text)
#define CH2D(a,b) if ((a) == (b) ) { erg += equal_2_error(); goto endr_ende;}
#define CE2(a,b,f) if (check_equal_2(a,b,f,&erg) == EQUAL) goto endr_ende;
#define CE3(a,b,c,f) if (check_equal_3(a,b,c,f,&erg) == EQUAL) goto endr_ende;




#define GET_BIT_I(a,i) (((*a) >> (i))&1)
#define GET_BV_I(a,i) ((*(((unsigned char *)S_V_S(a) ) + (i>>3))  >> ((i)&7))&1)
#define GET_BV_B(a,i) (*(((unsigned char *)S_V_S(a) ) + (i)>>3)) 
#define UNSET_BV_I(a,i) (*((unsigned char *)S_V_S(a)  + ((i)>>3))  &= (~(1 << ((i)&7))))
#define UNSET_BIT_I(a,i) ((*(a))  &= (~(1 << (i))))
#define SET_BV_I(a,i) ( *((unsigned char *)S_V_S(a)  + ((i)>>3))  |= (1 << ((i)&7)))
#define SET_BIT_I(a,i) ( *(a)  |= (1 << (i)))
#define S_BV_LI(a) (((S_V_LI(a) &7)  == 0) ? (S_V_LI(a)>>3) : (S_V_LI(a)>>3) + 1)



#define ANFANG \
main()\
{\
OP a,b,c,d,e,f,g,h;\
INT i,j,k;\
OP z;\
anfang();\
a=callocobject();\
b=callocobject();\
c=callocobject();\
d=callocobject();\
e=callocobject();\
f=callocobject();\
g=callocobject();\
h=callocobject();

#define ENDE \
SYMfreeall(a);\
SYMfreeall(b);\
SYMfreeall(c);\
SYMfreeall(d);\
SYMfreeall(e);\
SYMfreeall(f);\
SYMfreeall(g);\
SYMfreeall(h);\
ende();\
return 0;\
}
#define BEGIN ANFANG
#define END ENDE
#define MACRO_H
#endif /* MACRO_H */


#ifdef __cplusplus
}
#endif
