Skip to content

Commit 1fe399f

Browse files
committed
reformatted according to contributing guidelines
1 parent b044767 commit 1fe399f

File tree

3 files changed

+26
-28
lines changed

3 files changed

+26
-28
lines changed

resolve/hykkt/PermClass.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <resolve/hykkt/PermClass.hpp>
22
#include <resolve/hykkt/cpuHykktPermutationKernels.hpp>
3-
// #include <resolve/vector/Vector.hpp>
4-
// #include <resolve/matrix/Csr.hpp>
53
#include <cstdio>
64
#include "amd.h"
75

@@ -11,7 +9,7 @@ PermClass::PermClass(int n_h, int nnz_h, int nnz_j)
119
nnz_h_(nnz_h),
1210
nnz_j_(nnz_j)
1311
{
14-
allocate_workspace();
12+
allocateWorkspace();
1513
}
1614

1715
PermClass::~PermClass()
@@ -25,34 +23,34 @@ PermClass::PermClass(int n_h, int nnz_h, int nnz_j)
2523
delete [] perm_map_jt_;
2624
}
2725

28-
void PermClass::add_h_info(int* h_i, int* h_j)
26+
void PermClass::addHInfo(int* h_i, int* h_j)
2927
{
3028
h_i_ = h_i;
3129
h_j_ = h_j;
3230
}
3331

34-
void PermClass::add_j_info(int* j_i, int* j_j, int n_j, int m_j)
32+
void PermClass::addJInfo(int* j_i, int* j_j, int n_j, int m_j)
3533
{
3634
j_i_ = j_i;
3735
j_j_ = j_j;
3836
n_j_ = n_j;
3937
m_j_ = m_j;
4038
}
4139

42-
void PermClass::add_jt_info(int* jt_i, int* jt_j)
40+
void PermClass::addJtInfo(int* jt_i, int* jt_j)
4341
{
4442
jt_i_ = jt_i;
4543
jt_j_ = jt_j;
4644
}
4745

48-
void PermClass::add_perm(int* custom_perm)
46+
void PermClass::addPerm(int* custom_perm)
4947
{
5048
perm_is_default_ = false;
5149
perm_ = custom_perm;
5250
}
5351

54-
// Symamd permutation of $H_\gamma$ in (6)
55-
void PermClass::symamd()
52+
// symAmd permutation of $H_\gamma$ in (6)
53+
void PermClass::symAmd()
5654
{
5755
double Control[AMD_CONTROL], Info[AMD_INFO];
5856

@@ -68,27 +66,27 @@ PermClass::PermClass(int n_h, int nnz_h, int nnz_j)
6866
}
6967
}
7068

71-
void PermClass::invert_perm()
69+
void PermClass::invertPerm()
7270
{
7371
reverse_perm(n_h_, perm_, rev_perm_);
7472
}
7573

76-
void PermClass::vec_map_rc(int* b_i, int* b_j)
74+
void PermClass::vecMapRC(int* b_i, int* b_j)
7775
{
78-
make_vec_map_rc(n_h_, h_i_, h_j_, perm_, rev_perm_, b_i, b_j, perm_map_h_);
76+
make_vecMapRC(n_h_, h_i_, h_j_, perm_, rev_perm_, b_i, b_j, perm_map_h_);
7977
}
8078

81-
void PermClass::vec_map_c(int* b_j)
79+
void PermClass::vecMapC(int* b_j)
8280
{
83-
make_vec_map_c(n_j_, j_i_, j_j_, rev_perm_, b_j, perm_map_j_);
81+
make_vecMapC(n_j_, j_i_, j_j_, rev_perm_, b_j, perm_map_j_);
8482
}
8583

86-
void PermClass::vec_map_r(int* b_i, int* b_j)
84+
void PermClass::vecMapR(int* b_i, int* b_j)
8785
{
88-
make_vec_map_r(m_j_, jt_i_, jt_j_, perm_, b_i, b_j, perm_map_jt_);
86+
make_vecMapR(m_j_, jt_i_, jt_j_, perm_, b_i, b_j, perm_map_jt_);
8987
}
9088

91-
void PermClass::map_index(Permutation_Type permutation,
89+
void PermClass::map_index(PermutationType permutation,
9290
double* old_val,
9391
double* new_val)
9492
{
@@ -114,7 +112,7 @@ PermClass::PermClass(int n_h, int nnz_h, int nnz_j)
114112
}
115113
}
116114

117-
void PermClass::allocate_workspace()
115+
void PermClass::allocateWorkspace()
118116
{
119117
perm_ = new int[n_h_];
120118
rev_perm_ = new int[n_h_];

resolve/hykkt/PermClass.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33

4-
enum Permutation_Type { perm_v, rev_perm_v, perm_h_v, perm_j_v, perm_jt_v };
4+
enum PermutationType { perm_v, rev_perm_v, perm_h_v, perm_j_v, perm_jt_v };
55

66
class PermClass
77
{
@@ -146,7 +146,7 @@ class PermClass
146146
*
147147
* @post new_val contains the permuted old_val
148148
*/
149-
void map_index(Permutation_Type permutation,
149+
void map_index(PermutationType permutation,
150150
double* old_val,
151151
double* new_val);
152152

tests/unit/hykkt/HykktPerm.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class HykktPerm : public TestBase
3737
bool flagc = false;
3838

3939
PermClass pc(n, nnz, nnz);
40-
pc.add_h_info(a_i, a_j);
41-
pc.add_j_info(a_i, a_j, n, m);
42-
pc.add_jt_info(a_i, a_j);
43-
pc.add_perm(perm);
44-
pc.invert_perm();
40+
pc.addHInfo(a_i, a_j);
41+
pc.addJInfo(a_i, a_j, n, m);
42+
pc.addJtInfo(a_i, a_j);
43+
pc.addPerm(perm);
44+
pc.invertPerm();
4545

4646
// Test RC permutation
47-
pc.vec_map_rc(b_i, b_j);
47+
pc.vecMapRC(b_i, b_j);
4848
printf("Comparing RC permutation\n");
4949
for (int i = 0; i < n + 1; i++) // Loop over row pointers (n+1)
5050
{
@@ -65,7 +65,7 @@ class HykktPerm : public TestBase
6565
printf(flagrc ? "RC permutation failed\n" : "RC permutation passed\n");
6666

6767
// Test R permutation
68-
pc.vec_map_r(b_i, b_j);
68+
pc.vecMapR(b_i, b_j);
6969
printf("Comparing R permutation\n");
7070
for (int i = 0; i < n + 1; i++)
7171
{
@@ -86,7 +86,7 @@ class HykktPerm : public TestBase
8686
printf(flagr ? "R permutation failed\n" : "R permutation passed\n");
8787

8888
// Test C permutation
89-
pc.vec_map_c(b_j);
89+
pc.vecMapC(b_j);
9090
printf("Comparing C permutation\n");
9191
for (int i = 0; i < n + 1; i++)
9292
{

0 commit comments

Comments
 (0)