BOSL2/tests
RonaldoCMP bbe4ad1467 Sort debugging and optimizing
There were bugs in the previous sorting functions. They didn't check the homogeneity of the input list before calling _sort_scalars and _sort_vectors. The bug might result in wrong order and missing list elements in the output.
Besides correcting the bug a recode of all sorting functions result in better performance and a enlargement of their scope. With the new functions, list of vectors of any dimension may be sorted, even with idx given, with the native comparison operators. The scope of indexed sorting is also extended.

The file test_arrays has been extended to check the new funcionality.

New functions:

is_homogeneous - checks if a list has elements of the same type (although not distinguing booleans from numbers) up to a given depth
_sort_vectors - internal function to sort homgeneous lists of vectors using native comparison operators; extends the scope of the previous _sort_vectors# functions with better performance
_lexical_sort - internal function to sort non-homogeneous lists; uses compare_vals
_indexed_sort - internal function to perform indexed sorting of non-homogeneous lists; uses compar_vals

Changed/reviewed functions:
_valid_idx - doesn't requires the input of imin and imax args
sort - explores the internal functions to get better performance and an enlarged scope
sortidx - explores the internal functions to get better performance and an enlarged scope
_sort_general - just for sortings of non-homogeneous lists using compare_vals
_array_dim_recurse - changed for bit better performance

Functions eliminated:
 _sort_vectors1
 _sort_vectors2
 _sort_vectors3
 _sort_vectors4
2020-08-30 12:12:36 +01:00
..
hull.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
polyhedra.scad A broad review of input data check and code format 2020-07-24 22:54:34 +01:00
test_affine.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_arrays.scad Sort debugging and optimizing 2020-08-30 12:12:36 +01:00
test_common.scad Overall review, input data check, format, new function definitions 2020-07-29 22:41:02 +01:00
test_coords.scad Added tests for path3d() and path4d() with fille= 2020-08-18 19:25:05 -07:00
test_cubetruss.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_debug.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_edges.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_geometry.scad Fixed broken line-plane intersections. Attachment enhanced vnf_polyhedron(). 2020-08-28 19:07:10 -07:00
test_hull.scad change hull to use find_noncollinear_points, add some error checks, 2020-07-28 17:54:57 -04:00
test_linear_bearings.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_math.scad Add is_zero(), is_positive(), is_negative(), is_nonpositive(), is_nonnegative(). 2020-08-26 18:02:16 -07:00
test_mutators.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_primitives.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_quaternions.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_queues.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_shapes.scad Fix list_remove() for null index list. 2020-07-29 22:39:17 -07:00
test_shapes2d.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_skin.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_stacks.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_strings.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_structs.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_transforms.scad fixed missing ; bug in test_transforms.scad 2020-08-27 19:48:13 -04:00
test_vectors.scad A broad review of input data check and code format 2020-07-24 22:54:34 +01:00
test_version.scad Changed to relative include names 2020-07-21 20:05:21 -04:00
test_vnf.scad Changed to relative include names 2020-07-21 20:05:21 -04:00