Skip to content

Commit

Permalink
fixed straggling old names
Browse files Browse the repository at this point in the history
  • Loading branch information
shakedregev committed Jan 3, 2025
1 parent 1fe399f commit b6b1617
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
18 changes: 9 additions & 9 deletions resolve/hykkt/PermClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ PermClass::PermClass(int n_h, int nnz_h, int nnz_j)

void PermClass::invertPerm()
{
reverse_perm(n_h_, perm_, rev_perm_);
reversePerm(n_h_, perm_, rev_perm_);
}

void PermClass::vecMapRC(int* b_i, int* b_j)
{
make_vecMapRC(n_h_, h_i_, h_j_, perm_, rev_perm_, b_i, b_j, perm_map_h_);
makeVecMapRC(n_h_, h_i_, h_j_, perm_, rev_perm_, b_i, b_j, perm_map_h_);
}

void PermClass::vecMapC(int* b_j)
{
make_vecMapC(n_j_, j_i_, j_j_, rev_perm_, b_j, perm_map_j_);
makeVecMapC(n_j_, j_i_, j_j_, rev_perm_, b_j, perm_map_j_);
}

void PermClass::vecMapR(int* b_i, int* b_j)
{
make_vecMapR(m_j_, jt_i_, jt_j_, perm_, b_i, b_j, perm_map_jt_);
makeVecMapR(m_j_, jt_i_, jt_j_, perm_, b_i, b_j, perm_map_jt_);
}

void PermClass::map_index(PermutationType permutation,
Expand All @@ -93,19 +93,19 @@ PermClass::PermClass(int n_h, int nnz_h, int nnz_j)
switch(permutation)
{
case perm_v:
cpu_map_idx(n_h_, perm_, old_val, new_val);
cpuMapIdx(n_h_, perm_, old_val, new_val);
break;
case rev_perm_v:
cpu_map_idx(n_h_, rev_perm_, old_val, new_val);
cpuMapIdx(n_h_, rev_perm_, old_val, new_val);
break;
case perm_h_v:
cpu_map_idx(nnz_h_, perm_map_h_, old_val, new_val);
cpuMapIdx(nnz_h_, perm_map_h_, old_val, new_val);
break;
case perm_j_v:
cpu_map_idx(nnz_j_, perm_map_j_, old_val, new_val);
cpuMapIdx(nnz_j_, perm_map_j_, old_val, new_val);
break;
case perm_jt_v:
cpu_map_idx(nnz_j_, perm_map_jt_, old_val, new_val);
cpuMapIdx(nnz_j_, perm_map_jt_, old_val, new_val);
break;
default:
printf("Valid arguments are perm_v, rev_perm_v, perm_h_v, perm_j_v, perm_jt_v\n");
Expand Down
22 changes: 11 additions & 11 deletions resolve/hykkt/PermClass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PermClass
*
* @post h_i_ set to h_i, h_j_ set to h_j
*/
void add_h_info(int* h_i, int* h_j);
void addHInfo(int* h_i, int* h_j);

/*
* @brief loads CSR structure for matrix J
Expand All @@ -32,7 +32,7 @@ class PermClass
*
* @post j_i_ set to j_i, j_j_ set to j_j, n_j_ set to n_j, m_j_ set to m_j
*/
void add_j_info(int* j_i, int* j_j, int n_j, int m_j);
void addJInfo(int* j_i, int* j_j, int n_j, int m_j);

/*
* @brief loads CSR structure for matrix Jt
Expand All @@ -43,7 +43,7 @@ class PermClass
* @pre
* @post jt_i_ set to jt_i, jt_j_ set to jt_j
*/
void add_jt_info(int* jt_i, int* jt_j);
void addJtInfo(int* jt_i, int* jt_j);

/*
* @brief sets custom permutation of matrix
Expand All @@ -56,7 +56,7 @@ class PermClass
* set to false so that custom_perm not deleted twice in destructors,
* permutation vector copied onto device d_perm
*/
void add_perm(int* custom_perm);
void addPerm(int* custom_perm);

/*
* @brief Uses Symmetric Approximate Minimum Degree
Expand All @@ -66,10 +66,10 @@ class PermClass
* initialized to the dimensions of matrix H, the number
* of nonzeros it has, its row offsets, and column arrays
*
* @post perm is the perumation vector that implements symamd
* @post perm is the perumation vector that implements symAmd
* on the 2x2 system
*/
void symamd();
void symAmd();

/*
* @brief Creates reverse permutation of perm and copies onto device
Expand All @@ -80,7 +80,7 @@ class PermClass
* @post rev_perm is now the reverse permuation of perm and copied onto
* the device d_perm
*/
void invert_perm();
void invertPerm();

/*
* @brief Creates permutation of rows and columns of matrix
Expand All @@ -97,7 +97,7 @@ class PermClass
* @post perm_map_h is now permuted rows/columns of H and copied onto
* the device d_perm_map_h
*/
void vec_map_rc(int* b_i, int* b_j);
void vecMapRC(int* b_i, int* b_j);

/*
* @brief Creates the permutation of the columns of matrix J
Expand All @@ -112,7 +112,7 @@ class PermClass
* @post perm_map_j is now the column permutation and is copied onto
* the device d_perm_map_j
*/
void vec_map_c(int* b_j);
void vecMapC(int* b_j);

/*
* @brief Creates the permutation of the rows of matrix Jt
Expand All @@ -128,7 +128,7 @@ class PermClass
* @post perm_map_jt is now the permuations of the rows of J transpose
* and is copied onto the device d_perm_map_jt
*/
void vec_map_r(int* b_i, int* b_j);
void vecMapR(int* b_i, int* b_j);

/*
* @brief maps the permutated values of old_val to new_val
Expand Down Expand Up @@ -165,7 +165,7 @@ class PermClass
* is now a vector with size nnz_h_, perm_map_j and perm_map_jt
* are now vectors with size nnz_j_
*/
void allocate_workspace();
void allocateWorkspace();

// member variables
bool perm_is_default_ = true; // boolean if perm set custom
Expand Down
22 changes: 11 additions & 11 deletions resolve/hykkt/cpuHykktPermutationKernels.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "cpuHykktPermutationKernels.hpp"

void cpu_map_idx(int n, int* perm, double* old_val, double* new_val)
void cpuMapIdx(int n, int* perm, double* old_val, double* new_val)
{
for (int i = 0; i < n; i++) {
new_val[i] = old_val[perm[i]];
}
}

void selection_sort2(int len, int* arr1, int* arr2)
void SelectionSort2(int len, int* arr1, int* arr2)
{
int min_ind;
int temp;
Expand Down Expand Up @@ -64,7 +64,7 @@ void quickSort(int* arr1, int* arr2, int low, int high) {
}
}

void insertion_sort(int n, int* arr1, int* arr2)
void InsertionSort(int n, int* arr1, int* arr2)
{
int i, key1, key2, j;
for (i = 1; i < n; i++)
Expand All @@ -85,7 +85,7 @@ void insertion_sort(int n, int* arr1, int* arr2)
}
}

void make_vec_map_c(int n,
void makeVecMapC(int n,
int* rows,
int* cols,
int* rev_perm,
Expand All @@ -104,23 +104,23 @@ void make_vec_map_c(int n,
perm_cols[row_s + j] = rev_perm[cols[row_s + j]];
}
#if 0
selection_sort2(rowlen, &perm_cols[row_s], &perm_map[row_s]);
SelectionSort2(rowlen, &perm_cols[row_s], &perm_map[row_s]);
#else
//quickSort(&perm_cols[row_s], &perm_map[row_s], 0, rowlen-1);
insertion_sort(rowlen, &perm_cols[row_s], &perm_map[row_s]);
InsertionSort(rowlen, &perm_cols[row_s], &perm_map[row_s]);
#endif
}
}

void reverse_perm(int n, int* perm, int* rev_perm)
void reversePerm(int n, int* perm, int* rev_perm)
{
for(int i = 0; i < n; i++)
{
rev_perm[perm[i]] = i;
}
}

void make_vec_map_r(int n,
void makeVecMapR(int n,
int* rows,
int* cols,
int* perm,
Expand Down Expand Up @@ -148,7 +148,7 @@ void make_vec_map_r(int n,
}
}

void make_vec_map_rc(int n,
void makeVecMapRC(int n,
int* rows,
int* cols,
int* perm,
Expand All @@ -174,10 +174,10 @@ void make_vec_map_rc(int n,
perm_cols[count + j] = rev_perm[cols[row_s + j]];
}
#if 0
selection_sort2(rowlen, &perm_cols[count], &perm_map[count]);
SelectionSort2(rowlen, &perm_cols[count], &perm_map[count]);
#else
//quickSort(&perm_cols[count], &perm_map[count], 0, rowlen-1);
insertion_sort(rowlen, &perm_cols[count], &perm_map[count]);
InsertionSort(rowlen, &perm_cols[count], &perm_map[count]);
#endif
count += rowlen;
}
Expand Down
14 changes: 7 additions & 7 deletions resolve/hykkt/cpuHykktPermutationKernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @post: new_val contains the permuted old_val
*/
void cpu_map_idx(int n, int* perm, double* old_val, double* new_val);
void cpuMapIdx(int n, int* perm, double* old_val, double* new_val);
/*
* @brief: Selection sorts arr1 and arr2 w/indices
* based on increasing value in arr1
Expand All @@ -24,7 +24,7 @@ void cpu_map_idx(int n, int* perm, double* old_val, double* new_val);
*
* @post: arr1 and arr2 are sorted based on increasing values in arr1
*/
void selection_sort2(int len, int* arr1, int* arr2);
void SelectionSort2(int len, int* arr1, int* arr2);

inline void swap(int* arr1, int* arr2, int i, int j);
inline int partition(int* arr1, int* arr2, int low, int high);
Expand All @@ -42,7 +42,7 @@ void quickSort(int* arr1, int* arr2, int low, int high);
*
* @post: arr1 and arr2 are sorted based on increasing values in arr1
*/
void insertion_sort(int len, int* arr1, int* arr2);
void InsertionSort(int len, int* arr1, int* arr2);

/*
* @brief: Permutes the columns in a matrix represented by rows and cols
Expand All @@ -56,7 +56,7 @@ void insertion_sort(int len, int* arr1, int* arr2);
* @post: perm_cols is now the permuted column array and perm_map stores
* the corresponding indices to facilitate permuting the values
*/
void make_vec_map_c(int n,
void makeVecMapC(int n,
int* rows,
int* cols,
int* rev_perm,
Expand All @@ -72,7 +72,7 @@ void make_vec_map_c(int n,
*
* @post: rev_perm now contains the reverse permutation
*/
void reverse_perm(int n, int* perm, int* rev_perm);
void reversePerm(int n, int* perm, int* rev_perm);
/*
* @brief: Permutes the rows in a matrix represented by rows and cols
*
Expand All @@ -85,7 +85,7 @@ void reverse_perm(int n, int* perm, int* rev_perm);
* @post: perm_rows and perm_cols are now the permuted rows and column arrays,
* perm_map stores the corresponding indices to facilitate permuting the values
*/
void make_vec_map_r(int n,
void makeVecMapR(int n,
int* rows,
int* cols,
int* perm,
Expand All @@ -105,7 +105,7 @@ void make_vec_map_r(int n,
* @post: perm_rows and perm_cols are now the permuted rows and column arrays,
* perm_map stores the corresponding indices to facilitate permuting the values
*/
void make_vec_map_rc(int n,
void makeVecMapRC(int n,
int* rows,
int* cols,
int* perm,
Expand Down

0 comments on commit b6b1617

Please sign in to comment.