This commit is contained in:
2025-05-07 23:20:02 -04:00
parent 073d1ce57c
commit 358b76254b
6 changed files with 34 additions and 5 deletions

View File

@ -356,5 +356,32 @@ const int& permutation::at(const int ind) const
return data[ind];
}
void permutation::print(int style)
{
int I;
if(style==0)
{
printf("{");
for(I=0;I<length-1;I++) printf("%d,",data[I]);
printf("%d}",data[length-1]);
}
else if(style==1)
{
printf("permutation:{");
for(I=0;I<length-1;I++) printf("%d,",data[I]);
printf("%d}",data[length-1]);
}
return;
}
void test_permutation1()
{
permutation a = permutation(5);
a.print(1);
return;
}
}; //end namespace perm
}; //end namespace ams

View File

@ -6,6 +6,7 @@ int main(int argc, char* argv[])
printf("ams c++ permutation library tests.\n");
//amsperm1_test_basicperm1();
//ams::perm::test_ipermutation1();
ams::perm::test_ipermutation2();
//ams::perm::test_ipermutation2();
ams::perm::test_permutation1();
return ret;
}