M4RI 1.0.1
|
00001 00009 /****************************************************************************** 00010 * 00011 * M4RI: Linear Algebra over GF(2) 00012 * 00013 * Copyright (C) 2008 Martin Albrecht <malb@informatik.uni-bremen.de> 00014 * 00015 * Distributed under the terms of the GNU General Public License (GPL) 00016 * version 2 or higher. 00017 * 00018 * This code is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 * General Public License for more details. 00022 * 00023 * The full text of the GPL is available at: 00024 * 00025 * http://www.gnu.org/licenses/ 00026 ******************************************************************************/ 00027 #ifndef PERMUTATION_H 00028 #define PERMUTATION_H 00029 00030 #include "misc.h" 00031 #include "packedmatrix.h" 00032 00037 typedef struct { 00041 size_t *values; 00042 00047 size_t length; 00048 00049 } mzp_t; // note that this is NOT mpz_t 00050 00057 mzp_t *mzp_init(size_t length); 00058 00065 void mzp_free(mzp_t *P); 00066 00067 00079 mzp_t *mzp_init_window(mzp_t* P, size_t begin, size_t end); 00080 00088 void mzp_free_window(mzp_t* condemned); 00089 00101 void mzp_set_ui(mzp_t *P, unsigned int value); 00102 00103 00113 void mzd_apply_p_left(mzd_t *A, mzp_t *P); 00114 00124 void mzd_apply_p_left_trans(mzd_t *A, mzp_t *P); 00125 00135 void mzd_apply_p_right(mzd_t *A, mzp_t *P); 00136 00146 void mzd_apply_p_right_trans(mzd_t *A, mzp_t *P); 00147 00148 00162 void mzd_apply_p_right_even_capped(mzd_t *A, mzp_t *P, size_t start_row, size_t start_col); 00163 00177 void mzd_apply_p_right_trans_even_capped(mzd_t *A, mzp_t *P, size_t start_row, size_t start_col); 00178 00188 void mzd_apply_p_right_trans(mzd_t *A, mzp_t *P); 00189 00190 00200 void mzd_apply_p_right_trans_tri(mzd_t * A, mzp_t * Q); 00201 00202 /* /\** */ 00203 /* * Rotate zero columns to the end. */ 00204 /* * */ 00205 /* * Given a matrix M with zero columns from zs up to ze (exclusive) and */ 00206 /* * nonzero columns from ze to de (excluse) with zs < ze < de rotate */ 00207 /* * the zero columns to the end such that the the nonzero block comes */ 00208 /* * before the zero block. */ 00209 /* * */ 00210 /* * \param M Matrix. */ 00211 /* * \param zs Start index of the zero columns. */ 00212 /* * \param ze End index of the zero columns (exclusive). */ 00213 /* * \param de End index of the nonzero columns (exclusive). */ 00214 /* * */ 00215 /* *\/ */ 00216 00217 /* void mzd_col_block_rotate(mzd_t *M, size_t zs, size_t ze, size_t de) ; */ 00218 00225 void mzp_print(mzp_t *P); 00226 00227 #endif //PERMUTATION_H