From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 84D71385841A for ; Tue, 12 Dec 2023 12:37:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 84D71385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 84D71385841A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702384666; cv=none; b=lF0lI830c1QbVAFMwS9YnmW2sCTpzhuQBdJvPjfJQFOLVQK2tBiJE1RosVThygu4eQRdq3TRpceK3JzpvHAuH1GMonpGDwwZCOkGzPIUc6CML0Mt5vbTwwta4tI6PNU/ZxWbJGq70CwdEC78N9v3G1xYohZgoz9qW2HhzXKGbLQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702384666; c=relaxed/simple; bh=ZDOw6caZw3WdGQ63+W5EqmupK53h6LGAGPETB+yiLRg=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=FsKwM8PdBCcPJFyY4oKM/19UzUUO/G+s3d0ar06XMK0jM8cE9Qi4uoiXwqVvxLkAStqRxSnykWNoj3uM/dgTJ0j1Sn1V+un4chwcRDRcsVt84HUckZoYg0wwZlAmMvD/WxYglHOnkiIPBjPssIMbjY0QX0XpmbyaikN1boziDsM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3b86f3cdca0so4213295b6e.3 for ; Tue, 12 Dec 2023 04:37:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702384664; x=1702989464; darn=gcc.gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SZIuiBZosG0BKaH7BRZLKhCj9DN7FkPrq5MzJkhvJNw=; b=Mae2p/cqIoK0C7aAXO23hqT0Xaqe68gcpr6PsxDsiLXz6fR9bx+kIsO7piZSygwukq 2i8GUgWHFutcfGJkeRM8w+voQE3+q2JNcVY10TXjD4EZWBFjIQBpg0EvhlTJmYxO3Qq+ Vm2Gbrpi1etmsYJjo+mgFMXZrWnxI4ELNnTLGwcajR2LG82cNi3Win1A7FNeui/r59Qu cC3BJGuBWF37Z+EKVoLEKueXtYql/a27XuHm69+d/AjUayXCSaZc9QWkcwp782vWsLTm fZV2fuzQ7BVAsishmm4BtJ5lErdRnZd+XRSWJJxAJbZYrOpg4MY/RBgY/PfWUfTVWjbd /gOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702384664; x=1702989464; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SZIuiBZosG0BKaH7BRZLKhCj9DN7FkPrq5MzJkhvJNw=; b=KvGOWZgDav8n7ucVACGj6M6uEughN4/6alNunetW1K8R3gKeFHqmsFMa8wxs6+Yv2q 5bXiI5kzR1prKxtaBRyll4NWxR20ZIq/ki2a12OigATJikvqxFqt+kJ5fnprOi5G0n09 veCySOnETsJMBPUiZHJi7nOKuPYkPWe2N/qMbTPFNiz9siB74ETUuKSR5PLqKMfd/fVw m0+lTuIEi5gOFsgMdvLLO+97PHdI4r/JNKB5MoflCISbdMQCb5vYVQF7Nzy5ubz0O4Kj 1FESU73ivicg17l2TTpiEnqVnhmqf/7gofhYIzKJEG3Q9Rs+m5NwMKk56PL3MkOKunak GJrQ== X-Gm-Message-State: AOJu0Yy1i2LQLmbidievYKtTDtowg8GqqcGv0v34wcQ5BlE2YhPy7wtw Z65Wyf9ziLx1TzNe/sPZr+pnjKrPE+X1jZZnZ9c= X-Google-Smtp-Source: AGHT+IGKMUETnY1fRIc4wyRn3wkYQQ9FLFTk8kS4mhFN7FBlW4brheWa5cppFtk7Ca4RHUYZVl3qCWBkQcaryP1Nm2o= X-Received: by 2002:a05:6808:1385:b0:3b8:b063:8255 with SMTP id c5-20020a056808138500b003b8b0638255mr7858313oiw.87.1702384663602; Tue, 12 Dec 2023 04:37:43 -0800 (PST) MIME-Version: 1.0 From: Duke Abbaddon Date: Tue, 12 Dec 2023 12:37:32 +0000 Message-ID: Subject: High Order Compression Advantaged for codecs, Compression Zip systems & File Systems such as EFS, NTFS, ZFS, Available to Developers today over christmas, MILLIONS of Pound After ;-) Jesus, You know because Hay ZEUS & Odin rule big CASH :D DL https://is.gd/DictionarySortJS https://is.gd/CJS_DictionarySort To: amd.gcc@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Compression, Dictionary Sort & Same Size Copy Match & Unite Same with location in 2D Matrix #JS #C #Python RS 2023 https://is.gd/CJS_DictionarySort https://is.gd/DictionarySortJS The code appears complex; But there you go! In assembler it may be 15KB to 64KB; I am not entirely sure, However the objective is for ZSTD, GZIP, Brotli & Codecs such as DSC, The compression rate improves & the quality of the compression also! Depending on the encryption type; You may also improve the complexity by deviating from commons or by compressing better first. CPU + Cache, Task & Lists & Tables & Compressed Data, Task RAM & Storage: Ordering data sets In reference to : https://science.n-helix.com/2021/11/monticarlo-workload-selector.html Sorting memory load arrays so they align neatly into a block; Accounting Dates into Same ID & Order; Ordered identical ID; Taxing blocks, Accounting for block loads & saves so that blocks in the same locations & size are loaded & stored neatly.. Aligned minimal block formations save space on block systems such as NTFS & EFS & Advanced Format with Extended Directories such as on the Amiga & Mac.. The ordering of NTFS, EFS & ZFS directory tables & data caches & The ordering of all RAM load save cycles in contexts such as.. Storage access & writing; Boot partition ordering etcetera. These & many more uses depending on speed & parallel code ordering & identification Unification, Depending entirely on block size & efficiency of sort & collation grouping. * Data flows & parallel streams; Identical RAM & Storage workloads.. By ordering the data groups into dictionary content with minimal group identifiers the code then becomes a compression library or a group archiver or a shorthand writer with unified comment commits such as legal point 1, 2, N amendums & common informations, Sorting is relatively fast in 128x & 64x & 32X & 16x Cubes in SiMD Vector Matrix; Aligning information cubes & commons.. Seconds. Many uses exist for these functions & coding excellence is defined by you. * Machine Learning Additive D!=3DS + (D!=3DS)M illness ? Dictionary Sort can sort your X-rays before classification & after ML & classification distillation, good for robots & humans alike! But most humanity lack code compile, You can essentially use Python, JS, C code to collate & sort & identify the identical, You may know but image classifications of identical are reduced to commons like red blood or cell factors in python. * Modes of Conduct MS-HO=C2=B2C row.sort((a, b) =3D> a - b))= ; // Find the first occurrence of each value in each row const firstOccurrences =3D []; for (let i =3D 0; i < matrix.length; i++) { const row =3D matrix[i]; const firstOccurrencesRow =3D {}; for (let j =3D 0; j < row.length; j++) { const value =3D row[j]; if (!firstOccurrencesRow.hasOwnProperty(value)) { firstOccurrencesRow[value] =3D j; } } firstOccurrences.push(firstOccurrencesRow); } // Find the last occurrence of each value in each row const lastOccurrences =3D []; for (let i =3D 0; i < matrix.length; i++) { const row =3D matrix[i]; const lastOccurrencesRow =3D {}; for (let j =3D row.length - 1; j >=3D 0; j--) { const value =3D row[j]; if (!lastOccurrencesRow.hasOwnProperty(value)) { lastOccurrencesRow[value] =3D j; } } lastOccurrences.push(lastOccurrencesRow); } // Find the first and last occurrences of each value in the matrix const firstOccurrencesAll =3D {}; for (const row of firstOccurrences) { for (const value in row) { if (!firstOccurrencesAll.hasOwnProperty(value) || firstOccurrencesAll[value] > row[value]) { firstOccurrencesAll[value] =3D row[value]; } } } const lastOccurrencesAll =3D {}; for (const row of lastOccurrences) { for (const value in row) { if (!lastOccurrencesAll.hasOwnProperty(value) || lastOccurrencesAll[value] < row[value]) { lastOccurrencesAll[value] =3D row[value]; } } } // Find the rows that contain the same values const sameRows =3D []; for (let i =3D 0; i < matrix.length; i++) { const row =3D matrix[i]; let same =3D true; for (let j =3D 0; j < row.length; j++) { const value =3D row[j]; const firstOccurrence =3D firstOccurrencesAll[value]; const lastOccurrence =3D lastOccurrencesAll[value]; if (firstOccurrence !=3D=3D lastOccurrence || firstOccurrences[i][value] !=3D=3D firstOccurrence || lastOccurrences[i][value] !=3D=3D lastOccurrence) { same =3D false; break; } } if (same) { sameRows.push(i); } } // Combine the same rows into a single row const combinedMatrix =3D []; for (const row of sameRows) { combinedMatrix.push(matrix[row]); } // Sort the combined matrix const sortedCombinedMatrix =3D combinedMatrix.map((row) =3D> row.sort((a, b) =3D> a - b)); return { sortedCombinedMatrix, sameRows }; } const matrix =3D [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]; const result =3D sortAndMatch(matrix); console.log(result.sortedCombinedMatrix); console.log(result.sameRows); #C #include #include typedef struct { int value; int firstOccurrence; int lastOccurrence; } ValueInfo; void sortAndMatch(int matrix[][3], int rows, int cols, int** sortedCombinedMatrix, int* sameRows, int* sameRowsCount) { // Allocate memory for the first and last occurrences of each value in each row ValueInfo** firstOccurrences =3D (ValueInfo**)malloc(sizeof(ValueInfo*) *= rows); for (int i =3D 0; i < rows; i++) { firstOccurrences[i] =3D (ValueInfo*)malloc(sizeof(ValueInfo) * cols); } ValueInfo** lastOccurrences =3D (ValueInfo**)malloc(sizeof(ValueInfo*) * = rows); for (int i =3D 0; i < rows; i++) { lastOccurrences[i] =3D (ValueInfo*)malloc(sizeof(ValueInfo) * cols); } // Find the first and last occurrences of each value in each row for (int i =3D 0; i < rows; i++) { for (int j =3D 0; j < cols; j++) { int value =3D matrix[i][j]; bool foundFirst =3D false; bool foundLast =3D false; for (int k =3D 0; k < cols; k++) { if (matrix[i][k] =3D=3D value && !foundFirst) { firstOccurrences[i][j].value =3D value; firstOccurrences[i][j].firstOccurrence =3D k; foundFirst =3D true; } if (matrix[i][k] =3D=3D value && !foundLast) { lastOccurrences[i][j].value =3D value; lastOccurrences[i][j].lastOccurrence =3D k; foundLast =3D true; } } } } // Find the first and last occurrences of each value in the matrix ValueInfo* firstOccurrencesAll =3D (ValueInfo*)malloc(sizeof(ValueInfo) *= cols); for (int i =3D 0; i < cols; i++) { firstOccurrencesAll[i].value =3D -1; firstOccurrencesAll[i].firstOccurrence =3D -1; firstOccurrencesAll[i].lastOccurrence =3D -1; } ValueInfo* lastOccurrencesAll =3D (ValueInfo*)malloc(sizeof(ValueInfo) * = cols); for (int i =3D 0; i < cols; i++) { lastOccurrencesAll[i]. #Python import numpy as np def sort_and_match(matrix): # Sort each row of the matrix sorted_matrix =3D np.sort(matrix, axis=3D1) # Find the first occurrence of each value in each row first_occurrences =3D np.zeros_like(matrix) for i in range(matrix.shape[0]): for j in range(matrix.shape[1]): if matrix[i, j] not in first_occurrences[i, :j]: first_occurrences[i, j] =3D j # Find the last occurrence of each value in each row last_occurrences =3D np.zeros_like(matrix) for i in range(matrix.shape[0]): for j in range(matrix.shape[1]-1, -1, -1): if matrix[i, j] not in last_occurrences[i, j+1:]: last_occurrences[i, j] =3D j # Find the first and last occurrences of each value in the matrix first_occurrences_all =3D np.min(first_occurrences, axis=3D0) last_occurrences_all =3D np.max(last_occurrences, axis=3D0) # Find the rows that contain the same values same_rows =3D [] for i in range(matrix.shape[0]): if np.all(first_occurrences[i, :] =3D=3D last_occurrences[i, :]): same_rows.append(i) # Combine the same rows into a single row combined_matrix =3D np.zeros((len(same_rows), matrix.shape[1])) for i, row in enumerate(same_rows): combined_matrix[i, :] =3D matrix[row, :] # Sort the combined matrix sorted_combined_matrix =3D np.sort(combined_matrix, axis=3D1) return sorted_combined_matrix, same_rows matrix =3D np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) sorted_combined_matrix, same_rows =3D sort_and_match(matrix) print(sorted_combined_matrix) print(same_rows)