Files Classes Functions Hierarchy
#include <permutationfunc.h>
Public Member Functions | |
| permutationfunc (uintc *fop_, uintc N_, uintc dim_) | |
| Initialize the class with the matrix of functions, the number of functions and the permutations dimension. | |
| uintc * | fi (uintc i) const |
| Return the function. | |
| void | ik (uint *x, uintc i, uintc k) const |
| Apply binary functions i(k(0,1,. | |
| uintc | ik (bool &found, uintc i, uintc k) const |
| Apply binary functions i(k(0,1,. | |
| uintc | inverse (bool &found, uintc *x) const |
| Given a permutation find the index if it exists. | |
| void | writeBinaryOperator (bool &result, uint *mat) const |
| Write the operator to matrix mat which is assumed to be N by N in length. | |
Public Attributes | |
| uintc * | fop |
| A pointer to the matrix of size N by dim. | |
| uintc | N |
| The number of functions. | |
| uintc | dim |
| The dimension of the permutation. | |
General support for permutations so looking at the classes interface does not help much.
This class was written was to calculate the states given the operators as permutations.
cout << "Test if flipping a triange and rotating it form a group." << endl;
uint fop[] =
{
0,1,2,
1,2,0,
2,0,1,
0,2,1,
2,1,0,
1,0,2
};
permutationfunc pf(fop,6,3);
cout << "Generate the binary table" << endl;
uint mat[6*6];
bool result;
pf.writeBinaryOperator(result,mat);
if (result==false)
{
cout << "Failed to form a binary operator." << endl;
return;
}
binopproperties gt(mat,6);
cout << "isGroup()=" << gt.isGroup() << endl;
Definition at line 46 of file permutationfunc.h.
Initialize the class with the matrix of functions, the number of functions and the permutations dimension.
Definition at line 53 of file permutationfunc.h.
Given a permutation find the index if it exists.
Definition at line 8 of file permutationfunc.cpp.
Referenced by ik(), and binoppropertiestest::test03().
00009 { 00010 for (uint i=0; i<N; ++i) 00011 { 00012 found=true; 00013 for (uint k=0; k<dim; ++k) 00014 { 00015 if (x[k]!=fop[i*dim+k]) 00016 { 00017 found=false; 00018 k=dim; 00019 } 00020 } 00021 00022 if (found==false) 00023 continue; 00024 00025 return i; 00026 } 00027 00028 return 0; 00029 }
Write the operator to matrix mat which is assumed to be N by N in length.
Definition at line 50 of file permutationfunc.cpp.
Referenced by binoppropertiestest::test05().
00054 { 00055 result=true; 00056 bool found; 00057 for (uint i=0; i<N; ++i) 00058 for (uint k=0; k<N; ++k) 00059 { 00060 mat[i*N+k] = ik(found,i,k); 00061 result &= found; 00062 } 00063 }
1.5.8