///home/berryj/link/bin/genMethods "-g" "-t" "int" "-h" "Matrix" "-I" "LINK/basic/Matrix.h" "-d" "basic" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>

#include <LINK/basic/Matrix.h>

#include <LINK/stkWrapper/Wrapper.h>
#include <LINK/stkWrapper/Register.h>
#include <LINK/stkWrapper/MatrixWrapper.h>


typedef int _int;
typedef Matrix<int > _Matrix_int_;
static Matrix<int > s__Matrix_int_;

#define _Matrix_int_DATA(x) ((Matrix<int >*) (EXTDATA(x)))
#define _Matrix_int_IS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Matrix<int > >::type))
#define _Matrix_int_ISNT_DATA(x) (!_Matrix_int_IS_DATA(x))

#define _Matrix_int_CXX_DATA(x) (*(Matrix<int >*) (EXTDATA(VAL(x))))
#define _Matrix_int_CXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Matrix<int > >::type))
#define _Matrix_int_CXX_ISNT_DATA(x) (!_Matrix_int_CXX_IS_DATA(x))


PRIMITIVE STk_init__Matrix_int_()
{
	Wrapper<_Matrix_int_>::type = STk_new_CXXwrapper_id(
			Wrapper<_Matrix_int_>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			MatrixWrapper<_int>::displayTypedMatrix,
			(void (*)(SCM x))MatrixWrapper<_int>::markTypedMatrix,
			(void (*)(SCM x))MatrixWrapper<_int>::freeTypedMatrix);
	Tcl_InitHashTable(&Register<_Matrix_int_>::objTable, TCL_ONE_WORD_KEYS);
	return UNDEFINED;
}

void genExtra_Matrix_int_Methods(void);

PRIMITIVE STk_init_methods__Matrix_int_()
{
	STk_add_new_cpp_primitive("Matrix-int-make", tc_subr_2, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::makeLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-make2", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::makeFilledLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-matrix-ref", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::refLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int?", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::linkMatrixP);
	STk_add_new_cpp_primitive("matrix-int", tc_subr_2, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::makeLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-matrix-fill!", tc_subr_2, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::fillLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-matrix-copy", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::copyLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-matrix-set!", tc_lsubr, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::setLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-matrix-rows", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::numRowsLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-matrix-cols", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::numColsLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-eqv?", tc_subr_2, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::eqvLinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int-multiply", tc_subr_2, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::multiply);
	STk_add_new_cpp_primitive("Matrix-int-sum", tc_subr_2, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::sum);
	STk_add_new_cpp_primitive("Matrix-int-transpose", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::transpose);
	STk_add_new_cpp_primitive("Matrix-int-add-rows", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::addRows);
	STk_add_new_cpp_primitive("Matrix-int-add-cols", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::addCols);
	STk_add_new_cpp_primitive("Matrix-int-swap-rows", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::swapRows);
	STk_add_new_cpp_primitive("Matrix-int-swap-cols", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::swapCols);
	STk_add_new_cpp_primitive("Matrix-int-scalar-mult-row", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::scalarMultRow);
	STk_add_new_cpp_primitive("Matrix-int-scalar-mult-col", tc_subr_3, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::scalarMultCol);
	STk_add_new_cpp_primitive("list->Matrix-int", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::stkList2LinkMatrix);
	STk_add_new_cpp_primitive("Matrix-int->list", tc_subr_1, 
	(PRIMITIVE (*)(...))  MatrixWrapper<_int>::linkMatrix2STkList);

	/*addOneArgMethod("matrix-copy",
		Wrapper<_Matrix_int_ >::name, 
		"Matrix-int-matrix-copy", LINK_OVL);
	addOneArgMethod("matrix-rows",
		Wrapper<_Matrix_int_ >::name, 
		"Matrix-int-matrix-rows", LINK_OVL);
	addOneArgMethod("matrix-cols",
		Wrapper<_Matrix_int_ >::name, 
		"Matrix-int-matrix-cols", LINK_OVL);
	addOneArgMethod("transpose",
		Wrapper<_Matrix_int_ >::name, 
		"Matrix-int-transpose", LINK_OVL);
	addThreeArgMethod("matrix-ref",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<integer>",
		"Matrix-int-matrix-ref", LINK_OVL);
	addTwoArgMethod("matrix-fill!",
		Wrapper<_Matrix_int_ >::name, 
		"<number>",
		"Matrix-int-matrix-fill!", LINK_OVL);
	addFourArgMethod("matrix-set!",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<integer>",
		"<number>",
		"Matrix-int-matrix-set!", LINK_OVL);
	addTwoArgMethod("eqv?",
		Wrapper<_Matrix_int_ >::name, 
		Wrapper<_Matrix_int_ >::name, 
		"Matrix-int-eqv?", LINK_OVL);
	addThreeArgMethod("add-rows",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<integer>",
		"Matrix-int-add-rows", LINK_OVL);
	addThreeArgMethod("add-cols",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<integer>",
		"Matrix-int-add-cols", LINK_OVL);
	addThreeArgMethod("swap-rows",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<integer>",
		"Matrix-int-swap-rows", LINK_OVL);
	addThreeArgMethod("swap-cols",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<integer>",
		"Matrix-int-swap-cols", LINK_OVL);
	addThreeArgMethod("scalar-mult-row",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<number>",
		"Matrix-int-scalar-mult-row", LINK_OVL);
	addThreeArgMethod("scalar-mult-col",
		Wrapper<_Matrix_int_ >::name, 
		"<integer>",
		"<number>",
		"Matrix-int-scalar-mult-col", LINK_OVL);
	genExtra_Matrix_int_Methods();*/
	return UNDEFINED;
}
