stamp test, TODO fix permutation
#include "Memory.h"
#include "Encode.h"
-int main()
+void SDR_Test()
{
SDR_INIT();
SDR mySDR = Encode_Term("term1");
@@ -12,12 +12,34 @@ int main()
//not ready yet:
SDR sdr2 = SDR_PermuteByRotation(&mySDR, true);
SDR_PrintWhereTrue(&sdr2);
+ int perm[SDR_SIZE];
+ int perm_inv[SDR_SIZE];
+ SDR_GeneratePermutation(perm, perm_inv);
+ for(int i=0;i<SDR_SIZE; i++)
+ {
+ //printf("%d\n",perm[i]);
+ }
+ SDR sdr3 = SDR_Permute(&mySDR, perm);
+ SDR_PrintWhereTrue(&sdr3);
+}
+void Stamp_Test()
+{
Stamp stamp1 = (Stamp) { .evidentalBase = {1,2} };
+ Stamp_print(&stamp1);
Stamp stamp2 = (Stamp) { .evidentalBase = {2,3,4} };
+ Stamp_print(&stamp2);
Stamp stamp3 = Stamp_make(&stamp1, &stamp2);
+ printf("zipped:");
Stamp_print(&stamp3);
- printf("overlapped? %d\n",Stamp_checkOverlap(&stamp1,&stamp2));
+ printf("stamps overlapped? %d\n",Stamp_checkOverlap(&stamp1,&stamp2));
+}
+
+int main()
+{
+ SDR_Test();
+ Stamp_Test();
+
/*
// memory
Memory memory;
