Commits

CarloWood committed 2a1345b

Fix constness of trsm* functions.

Comments (0)

Files changed (4)

src/brilliantrussian.c

 
 /* TRSM */
 
-void _mzd_trsm_upper_left_even_submatrix(mzd_t *U, mzd_t *B, rci_t const start_row, int const k, word const mask_begin, word const mask_end) {
+void _mzd_trsm_upper_left_even_submatrix(mzd_t const *U, mzd_t *B, rci_t const start_row, int const k, word const mask_begin, word const mask_end) {
   for (int i = 0; i < k; ++i) {
     for (int j = 0; j < i; ++j) {
       if (mzd_read_bit(U, start_row+(k-i-1), start_row+(k-i)+j)) {
 
 //#undef __M4RI_M4RM_GRAY8
 
-void _mzd_trsm_upper_left_even_m4r(mzd_t *U, mzd_t *B, int k) {
+void _mzd_trsm_upper_left_even_m4r(mzd_t const *U, mzd_t *B, int k) {
   wi_t const wide = B->width;
   int const blocksize = __M4RI_MUL_BLOCKSIZE;
 

src/brilliantrussian.h

 
 #define __M4RI_M4RM_GRAY8
 
-void _mzd_trsm_upper_left_even_m4r(mzd_t *U, mzd_t *B, int k);
+void _mzd_trsm_upper_left_even_m4r(mzd_t const *U, mzd_t *B, int k);
 
 #endif // M4RI_BRILLIANTRUSSIAN_H
  * the m4ri_radix grid and that their dimension is a multiple of m4ri_radix.
  */
 
-void _mzd_trsm_upper_right_even(mzd_t *U, mzd_t *B, const int cutoff);
+void _mzd_trsm_upper_right_even(mzd_t const *U, mzd_t *B, const int cutoff);
 
 /*
  * Variant where U and B start at an odd bit position. Assumes that
  * U->ncols < 64
  */
 
-void _mzd_trsm_upper_right_weird(mzd_t *U, mzd_t *B);
+void _mzd_trsm_upper_right_weird(mzd_t const *U, mzd_t *B);
 
-void _mzd_trsm_upper_right_base(mzd_t *U, mzd_t *B);
+void _mzd_trsm_upper_right_base(mzd_t const *U, mzd_t *B);
 
-void mzd_trsm_upper_right(mzd_t *U, mzd_t *B, const int cutoff) {
+void mzd_trsm_upper_right(mzd_t const *U, mzd_t *B, const int cutoff) {
   if(U->nrows != B->ncols)
     m4ri_die("mzd_trsm_upper_right: U nrows (%d) need to match B ncols (%d).\n", U->nrows, B->ncols);
   if(U->nrows != U->ncols)
   _mzd_trsm_upper_right(U, B, cutoff);
 }
 
-void _mzd_trsm_upper_right(mzd_t *U, mzd_t *B, const int cutoff) {
+void _mzd_trsm_upper_right(mzd_t const *U, mzd_t *B, const int cutoff) {
   rci_t const nb = B->ncols;
   rci_t const mb = B->nrows;
   int const n1 = m4ri_radix-B->offset;
   mzd_free_window(U11);
 }
 
-void _mzd_trsm_upper_right_weird(mzd_t *U, mzd_t *B) {
+void _mzd_trsm_upper_right_weird(mzd_t const *U, mzd_t *B) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   int const offset = B->offset;
   }
 }
 
-void _mzd_trsm_upper_right_even(mzd_t *U, mzd_t *B, const int cutoff) {
+void _mzd_trsm_upper_right_even(mzd_t const *U, mzd_t *B, const int cutoff) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
 
   mzd_free_window(U11);
 }
 
-void _mzd_trsm_upper_right_base(mzd_t *U, mzd_t *B) {
+void _mzd_trsm_upper_right_base(mzd_t const *U, mzd_t *B) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
 
  * Variant where L and B start at an odd bit position Assumes that
  * L->ncols < 64
  */
-void _mzd_trsm_lower_right_weird(mzd_t *L, mzd_t *B);
+void _mzd_trsm_lower_right_weird(mzd_t const *L, mzd_t *B);
 
 /*
  * Variant where L and B start at an even bit position Assumes that
  * L->ncols < 64
  */
 
-void _mzd_trsm_lower_right_even(mzd_t *L, mzd_t *B, const int cutoff);
+void _mzd_trsm_lower_right_even(mzd_t const *L, mzd_t *B, const int cutoff);
 
-void _mzd_trsm_lower_right_base(mzd_t *L, mzd_t *B);
+void _mzd_trsm_lower_right_base(mzd_t const *L, mzd_t *B);
 
-void mzd_trsm_lower_right(mzd_t *L, mzd_t *B, const int cutoff) {
+void mzd_trsm_lower_right(mzd_t const *L, mzd_t *B, const int cutoff) {
   if(L->nrows != B->ncols)
     m4ri_die("mzd_trsm_lower_right: L nrows (%d) need to match B ncols (%d).\n", L->nrows, B->ncols);
   if(L->nrows != L->ncols)
   _mzd_trsm_lower_right (L, B, cutoff);
 }
 
-void _mzd_trsm_lower_right(mzd_t *L, mzd_t *B, const int cutoff) {
+void _mzd_trsm_lower_right(mzd_t const *L, mzd_t *B, const int cutoff) {
   rci_t const nb = B->ncols;
   rci_t const mb = B->nrows;
   int const n1 = m4ri_radix-B->offset;
   }
 }
 
-void _mzd_trsm_lower_right_weird(mzd_t *L, mzd_t *B) {
+void _mzd_trsm_lower_right_weird(mzd_t const *L, mzd_t *B) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   int const offset = B->offset;
   }
 }
 
-void _mzd_trsm_lower_right_even(mzd_t *L, mzd_t *B, const int cutoff) {
+void _mzd_trsm_lower_right_even(mzd_t const *L, mzd_t *B, const int cutoff) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   
   }
 }
 
-void _mzd_trsm_lower_right_base(mzd_t *L, mzd_t *B) {
+void _mzd_trsm_lower_right_base(mzd_t const *L, mzd_t *B) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
 
  * L->ncols < 64
  */
 
-void _mzd_trsm_lower_left_weird(mzd_t *L, mzd_t *B);
+void _mzd_trsm_lower_left_weird(mzd_t const *L, mzd_t *B);
 
 /* 
  * This version assumes that the matrices are at an even position on
  * the m4ri_radix grid and that their dimension is a multiple of m4ri_radix.
  */
 
-void _mzd_trsm_lower_left_even(mzd_t *L, mzd_t *B, const int cutoff);
+void _mzd_trsm_lower_left_even(mzd_t const *L, mzd_t *B, const int cutoff);
 
-void mzd_trsm_lower_left(mzd_t *L, mzd_t *B, const int cutoff) {
+void mzd_trsm_lower_left(mzd_t const *L, mzd_t *B, const int cutoff) {
   if(L->ncols != B->nrows)
     m4ri_die("mzd_trsm_lower_left: L ncols (%d) need to match B nrows (%d).\n", L->ncols, B->nrows);
   if(L->nrows != L->ncols)
   _mzd_trsm_lower_left (L, B, cutoff);
 }
 
-void _mzd_trsm_lower_left(mzd_t *L, mzd_t *B, const int cutoff) {
+void _mzd_trsm_lower_left(mzd_t const *L, mzd_t *B, const int cutoff) {
   if(!L->offset)
     _mzd_trsm_lower_left_even(L, B, cutoff);
   else{
   }
 }
 
-void _mzd_trsm_lower_left_weird(mzd_t *L, mzd_t *B) {
+void _mzd_trsm_lower_left_weird(mzd_t const *L, mzd_t *B) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   int const Boffset = B->offset;
   }
 }
 
-void _mzd_trsm_lower_left_even(mzd_t *L, mzd_t *B, const int cutoff) {
+void _mzd_trsm_lower_left_even(mzd_t const *L, mzd_t *B, const int cutoff) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   int const Boffset = B->offset;
  * Variant where U and B start at an odd bit position
  * Assumes that U->ncols < 64
  */
-void _mzd_trsm_upper_left_weird (mzd_t *U, mzd_t *B);
+void _mzd_trsm_upper_left_weird (mzd_t const *U, mzd_t *B);
 
-void _mzd_trsm_upper_left_even(mzd_t *U, mzd_t *B, const int cutoff);
+void _mzd_trsm_upper_left_even(mzd_t const *U, mzd_t *B, const int cutoff);
 
-void mzd_trsm_upper_left(mzd_t *U, mzd_t *B, const int cutoff) {
+void mzd_trsm_upper_left(mzd_t const *U, mzd_t *B, const int cutoff) {
   if(U->ncols != B->nrows)
     m4ri_die("mzd_trsm_upper_left: U ncols (%d) need to match B nrows (%d).\n", U->ncols, B->nrows);
   if(U->nrows != U->ncols)
   _mzd_trsm_upper_left (U, B, cutoff);
 }
 
-void _mzd_trsm_upper_left(mzd_t *U, mzd_t *B, const int cutoff) {
+void _mzd_trsm_upper_left(mzd_t const *U, mzd_t *B, const int cutoff) {
   if(!U->offset)
     _mzd_trsm_upper_left_even (U, B, cutoff);
   else{
   }
 }
 
-void _mzd_trsm_upper_left_weird (mzd_t *U, mzd_t *B) {
+void _mzd_trsm_upper_left_weird (mzd_t const *U, mzd_t *B) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   int const Boffset = B->offset;
   }
 }
 
-void _mzd_trsm_upper_left_even(mzd_t *U, mzd_t *B, const int cutoff) {
+void _mzd_trsm_upper_left_even(mzd_t const *U, mzd_t *B, const int cutoff) {
   rci_t const mb = B->nrows;
   rci_t const nb = B->ncols;
   int const Boffset = B->offset;
  * \param cutoff Minimal dimension for Strassen recursion.
  */
 
-void mzd_trsm_upper_right(mzd_t *U, mzd_t *B, const int cutoff);
+void mzd_trsm_upper_right(mzd_t const *U, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves X U = B with X and B matrices and U upper triangular.
  * \param B Input matrix, being overwritten by the solution matrix X
  * \param cutoff Minimal dimension for Strassen recursion.
  */
-void _mzd_trsm_upper_right(mzd_t *U, mzd_t *B, const int cutoff);
+void _mzd_trsm_upper_right(mzd_t const *U, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves X L = B with X and B matrices and L lower triangular.
  * \param cutoff Minimal dimension for Strassen recursion.
  */
 
-void mzd_trsm_lower_right(mzd_t *L, mzd_t *B, const int cutoff);
+void mzd_trsm_lower_right(mzd_t const *L, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves X L = B with X and B with matrices and L lower
  * \param cutoff Minimal dimension for Strassen recursion.
  *
  */
-void _mzd_trsm_lower_right(mzd_t *L, mzd_t *B, const int cutoff);
+void _mzd_trsm_lower_right(mzd_t const *L, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves L X = B with X and B matrices and L lower triangular.
  * \param cutoff Minimal dimension for Strassen recursion.
  */
 
-void mzd_trsm_lower_left(mzd_t *L, mzd_t *B, const int cutoff);
+void mzd_trsm_lower_left(mzd_t const *L, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves L X = B with X and B matrices and L lower triangular.
  * \param cutoff Minimal dimension for Strassen recursion.
  */
 
-void _mzd_trsm_lower_left(mzd_t *L, mzd_t *B, const int cutoff);
+void _mzd_trsm_lower_left(mzd_t const *L, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves U X = B with X and B matrices and U upper triangular.
  * \param cutoff Minimal dimension for Strassen recursion.
  */
 
-void mzd_trsm_upper_left(mzd_t *U, mzd_t *B, const int cutoff);
+void mzd_trsm_upper_left(mzd_t const *U, mzd_t *B, const int cutoff);
 
 /**
  * \brief Solves U X = B with X and B matrices and U upper triangular.
  * \param B Input matrix, being overwritten by the solution matrix X
  * \param cutoff Minimal dimension for Strassen recursion.
  */
-void _mzd_trsm_upper_left (mzd_t *U, mzd_t *B, const int cutoff);
+void _mzd_trsm_upper_left (mzd_t const *U, mzd_t *B, const int cutoff);
 
 #endif // M4RI_TRSM_H