asv/www/asv.js
/* For a given parameter matrix, generate all permutations. */
For a given parameter matrix, generate all permutations.
For a given parameter matrix generate all permutations .
function permutations(matrix) {
                if (obj_length(matrix) == 0) {
                    return [{}];
                }
                var matrix = obj_copy(matrix);
                var key = obj_get_first_key(matrix);
                var entry = matrix[key];
                delete matrix[key];
                var results = []
                $.each(permutations(matrix), function(i, result) {
                    result = obj_copy(result);
                    if (entry.length) {
                        $.each(entry, function(i, value) {
                            result[key] = value;
                            results.push(obj_copy(result));
                        });
                    } else {
                        result[key] = null;
                        results.push(obj_copy(result));
                    }
                });
                results.sort();
                return results;
            }
function permutations ( matrix ) { if ( obj_length ( matrix ) == 0 ) { return [ { } ] ; } var matrix = obj_copy ( matrix ) ; var key = obj_get_first_key ( matrix ) ; var entry = matrix [ key ] ; delete matrix [ key ] ; var results = [ ] $ . each ( permutations ( matrix ) , function ( i , result ) { result = obj_copy ( result ) ; if ( entry . length ) { $ . each ( entry , function ( i , value ) { result [ key ] = value ; results . push ( obj_copy ( result ) ) ; } ) ; } else { result [ key ] = null ; results . push ( obj_copy ( result ) ) ; } } ) ; results . sort ( ) ; return results ; }
For a given parameter matrix, generate all permutations.
For a given parameter matrix generate all permutations .