Open recursion-ninja opened 7 years ago
Smoke test 3D DO using QuickCheck. If it doesn't SEGFAULT, we are good to go for now.
These are the steps I took to move code forward from Powell's original code here. This list also exists in ffi/external_direct_optimization/Changelog.md
Note: In all following, changes were made in both ukkCommon.c
and ukkCommon_for_python.c
, the latter of which is needed to do debugging using Python scripts. ukk_common.h
and ukk.checkp.c
are shared across both.
inline
directivelimits
library vs. values
makefile
test_powell
Astr
, Bstr
& Cstr
were globals, but I was unable to accept input strings due to allocation problems. So it forced me to make Astr
, Bstr
& Cstr
local variables, with allocation happening in powell_3D_align
. I put the three input characters into a struct, which I then passed around.traceback
. Not sure why the compiler wasnโt bitching about that, but it wasnโt.step()
exists in both GLIBC
and Powell's code. The FFI needs GLIBC
to work.#FIXED_NUM_PLANES
, which was always set to same value.dynamic_character_t
type from 3DO code, as it's no longer needed.test_interface
to use char
instead of dynamic_char
.ukk.checkp.c
to ukkCheckPoint.c
.test_interface
.MAX_STR
, but had to add it back in, as two array allocations (cost_vector
and state_vector
) rely on it, as well as the global MAX_COST
.test_interface
kept failing, either segfaulting or assertion errors. Step I took:
test_c_only.c
to run ukkCommon
without the C interface.align_io
, which has elem_t
, whereas Powellโs code has char
.int
to char
. That conversion in C only allows for ASCII characters, so 33โ126, inclusive. Can I just convert to int
?'-'
. That's now been changed to (1 << alphabetSize) - 1
.gap_char_g
global.1 << alphabetsize - 1
.characters_t*
since it has all the fields I need. I could use alignIO_t
, but this gives me the option to move to a smaller type, like unsigned short
later, to save space. At the same time, it would be cheaper computationally to use alignIO_t
. That should be an easy change in future.algn_get_cost_medians_3d
to accept characters_t*
.int
to elem_t
(unsigned int
). This was to make translation from align_io
to characters_t
easier.memcpy
rather than just changing pointers on that translation.void *
values in ukkCommon.h
to char *
to get rid of annoying warnings.
allocFinal
: flag
, top
and block
.getPtr
in return
statement.getPtr
: memset
Astr
, etc., Aidx
, etc. and Alen
, etc. to seq1
, lenSeq1
and idxSeq1
, respectively.elem_t
arrays.gcc
and clang
algn_3d_powell
to accept characters_t
as inputukkCheckPoint.c
-> traceBack()
.
int
that accepts up to 64 character states to unlimited by counting leading zeroes on input bit vectors.__builtin_clz
, which only works on unsignedcharacters_t
as input as well as output toalgn_3d_powell