matroid function

matroid construction