diff --git a/ReleaseNotes/09_11_2023.txt b/ReleaseNotes/09_11_2023.txt new file mode 100644 index 000000000000..40a51ce1dba6 --- /dev/null +++ b/ReleaseNotes/09_11_2023.txt @@ -0,0 +1,34 @@ + +Features: + +Bug Fixes/Re-organization: + + - Spaces Big Sub-matrix Set Extractor - Lean Max Composite (1, 2) + - Spaces Big Sub-string Set Extractor (3, 4, 5) + - Spaces Big Sub-string Set Extractor - Receding Permutation Scan #1 (6, 7, 8) + - Spaces Big Sub-string Set Extractor - Receding Permutation Scan #2 (9, 10, 11) + - Spaces Big Sub-string Set Extractor - Receding Permutation Scan #3 (12, 13, 14) + - Spaces Big Sub-string Set Extractor - Exhaustive Permutation Scan #1 (15, 16, 17) + - Spaces Big Sub-string Set Extractor - Exhaustive Permutation Scan #2 (18, 19, 20) + - Spaces Big Sub-string Set Extractor - Exhaustive Permutation Scan #3 (21, 22, 23) + - Spaces Big Sub-string Set Extractor - Contiguous #1 (24, 25, 26) + - Spaces Big Sub-string Set Extractor - Contiguous #2 (27, 28) + - Spaces Big Zombie Matrix (29, 30, 31) + - Spaces Big Zombie Matrix - Row Count (32, 33) + - Spaces Big Zombie Matrix - Column Count (34, 35) + - Spaces Big Zombie Matrix - Uninfected Cell Set (36, 37) + - Spaces Big Zombie Matrix - Infectable #1 (38, 39) + - Spaces Big Zombie Matrix - Infectable #2 (40, 41, 42) + - Spaces Big Zombie Matrix - Infectable #3 (43, 44, 45) + - Spaces Big Zombie Matrix - Constructor #1 (46, 47, 48) + - Spaces Big Zombie Matrix - Constructor #2 (49, 50) + - Spaces Big Zombie Matrix - Infection Period #1 (51, 52) + - Spaces Big Zombie Matrix - Infection Period #2 (53, 54) + - Spaces Cover Carl Stephanie Normed Bounds (55, 56, 57) + - Spaces Cover Carl Stephanie Normed Bounds - Entropy Bound Normed A (58, 59) + - Spaces Cover Carl Stephanie Normed Bounds - Entropy Bound Normed B (60) + + +Samples: + +IdeaDRIP: diff --git a/ScheduleSheet.xlsx b/ScheduleSheet.xlsx index 4a4f7cecd8df..f8bd0cf27a9d 100644 Binary files a/ScheduleSheet.xlsx and b/ScheduleSheet.xlsx differ diff --git a/src/main/java/org/drip/spaces/big/SubStringSetExtractor.java b/src/main/java/org/drip/spaces/big/SubStringSetExtractor.java index e6c0cca715ea..a3cec565b187 100644 --- a/src/main/java/org/drip/spaces/big/SubStringSetExtractor.java +++ b/src/main/java/org/drip/spaces/big/SubStringSetExtractor.java @@ -1,11 +1,20 @@ package org.drip.spaces.big; +import java.util.ArrayList; +import java.util.List; + +import org.drip.spaces.iterator.IterationHelper; +import org.drip.spaces.iterator.RdExhaustiveStateSpaceScan; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -82,128 +91,147 @@ /** * SubStringSetExtractor contains the Functionality to extract the Full Suite of the Sub-strings - * contained inside of the given String. - * - *

+ * contained inside of the given String. It provides the following Functionality: + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Computational Core Module
Library Statistical Learning Library
Project R1 and Rd Vector/Tensor Spaces (Validated and/or Normed), and Function Classes
Package Big-data In-place Manipulator
* * @author Lakshmi Krishnamurthy */ -public class SubStringSetExtractor { +public class SubStringSetExtractor +{ /** - * Locate the String Set of the Target Size using a Receeding Permutation Scan + * Locate the String Set of the Target Size using a Receding Permutation Scan * - * @param strMaster The Master String - * @param iTargetStringSize The Target String Size + * @param master The Master String + * @param targetStringSize The Target String Size * * @return The List of the Target String */ - public static final java.util.List ReceedingPermutationScan ( - final java.lang.String strMaster, - final int iTargetStringSize) + public static final List ReceedingPermutationScan ( + final String master, + final int targetStringSize) { - int[] aiMax = new int[iTargetStringSize]; - org.drip.spaces.iterator.RdExhaustiveStateSpaceScan mdIter = null; + int[] maxSizeArray = new int[targetStringSize]; + RdExhaustiveStateSpaceScan rdExhaustiveStateSpaceScanIterator = null; - int iMasterStringSize = strMaster.length(); + int masterStringSize = master.length(); - for (int i = 0; i < iTargetStringSize; ++i) - aiMax[i] = iMasterStringSize; + for (int i = 0; i < targetStringSize; ++i) { + maxSizeArray[i] = masterStringSize; + } try { - mdIter = new org.drip.spaces.iterator.RdExhaustiveStateSpaceScan (aiMax, false); - } catch (java.lang.Exception e) { + rdExhaustiveStateSpaceScanIterator = new RdExhaustiveStateSpaceScan (maxSizeArray, false); + } catch (Exception e) { e.printStackTrace(); } - java.util.List lsTarget = new java.util.ArrayList(); + List targetList = new ArrayList(); - int[] aiIndex = mdIter.stateIndexCursor(); + int[] indexCursorArray = rdExhaustiveStateSpaceScanIterator.stateIndexCursor(); - while (null != aiIndex) { - lsTarget.add (org.drip.spaces.iterator.IterationHelper.ComposeFromIndex (strMaster, aiIndex)); + while (null != indexCursorArray) { + targetList.add (IterationHelper.ComposeFromIndex (master, indexCursorArray)); - aiIndex = mdIter.nextStateIndexCursor(); + indexCursorArray = rdExhaustiveStateSpaceScanIterator.nextStateIndexCursor(); } - return lsTarget; + return targetList; } /** * Locate the String Set of the Target Size using an Exhaustive Permutation Scan * - * @param strMaster The Master String - * @param iTargetStringSize The Target String Size + * @param master The Master String + * @param targetStringSize The Target String Size * * @return The List of the Target String */ - public static final java.util.List ExhaustivePermutationScan ( - final java.lang.String strMaster, - final int iTargetStringSize) + public static final List ExhaustivePermutationScan ( + final String master, + final int targetStringSize) { - int[] aiMax = new int[iTargetStringSize]; - org.drip.spaces.iterator.RdExhaustiveStateSpaceScan mdIter = null; + int[] maxSizeArray = new int[targetStringSize]; + RdExhaustiveStateSpaceScan rdExhaustiveStateSpaceScanIterator = null; - int iMasterStringSize = strMaster.length(); + int masterStringSize = master.length(); - for (int i = 0; i < iTargetStringSize; ++i) - aiMax[i] = iMasterStringSize; + for (int i = 0; i < targetStringSize; ++i) { + maxSizeArray[i] = masterStringSize; + } try { - mdIter = new org.drip.spaces.iterator.RdExhaustiveStateSpaceScan (aiMax, false); - } catch (java.lang.Exception e) { + rdExhaustiveStateSpaceScanIterator = new RdExhaustiveStateSpaceScan (maxSizeArray, false); + } catch (Exception e) { e.printStackTrace(); } - java.util.List lsTarget = new java.util.ArrayList(); + List targetList = new ArrayList(); - int[] aiIndex = mdIter.stateIndexCursor(); + int[] indexCursorArray = rdExhaustiveStateSpaceScanIterator.stateIndexCursor(); - while (null != aiIndex) { - if (!org.drip.spaces.iterator.IterationHelper.CheckForRepeatingIndex (aiIndex)) - lsTarget.add (org.drip.spaces.iterator.IterationHelper.ComposeFromIndex (strMaster, - aiIndex)); + while (null != indexCursorArray) { + if (!IterationHelper.CheckForRepeatingIndex (indexCursorArray)) { + targetList.add (IterationHelper.ComposeFromIndex (master, indexCursorArray)); + } - aiIndex = mdIter.nextStateIndexCursor(); + indexCursorArray = rdExhaustiveStateSpaceScanIterator.nextStateIndexCursor(); } - return lsTarget; + return targetList; } /** * Extract all the Contiguous Strings available inside the specified Master String * - * @param strMaster The Master String + * @param master The Master String * - * @return The Full Set of Contiguous Strings + * @return The Full List of Contiguous Strings */ - public static final java.util.List Contiguous ( - final java.lang.String strMaster) + public static final List Contiguous ( + final String master) { - if (null == strMaster) return null; + if (null == master) { + return null; + } - int iMasterStringLength = strMaster.length(); + int masterStringLength = master.length(); - java.util.List lsTarget = new java.util.ArrayList(); + List targetList = new ArrayList(); - if (0 == iMasterStringLength) return lsTarget; + if (0 == masterStringLength) { + return targetList; + } - for (int iStartIndex = 0; iStartIndex < iMasterStringLength; ++iStartIndex) { - for (int iFinishIndex = iStartIndex + 1; iFinishIndex <= iMasterStringLength; ++iFinishIndex) - lsTarget.add (strMaster.substring (iStartIndex, iFinishIndex)); + for (int startIndex = 0; startIndex < masterStringLength; ++startIndex) { + for (int finishIndex = startIndex + 1; finishIndex <= masterStringLength; ++finishIndex) { + targetList.add (master.substring (startIndex, finishIndex)); + } } - return lsTarget; + return targetList; } } diff --git a/src/main/java/org/drip/spaces/big/ZombieMatrix.java b/src/main/java/org/drip/spaces/big/ZombieMatrix.java index bb0a95bbfcfa..fd31230261e7 100644 --- a/src/main/java/org/drip/spaces/big/ZombieMatrix.java +++ b/src/main/java/org/drip/spaces/big/ZombieMatrix.java @@ -1,11 +1,17 @@ package org.drip.spaces.big; +import java.util.Set; +import java.util.TreeSet; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -76,16 +82,29 @@ */ /** - * ZombieMatrix implements a Zombie Adjacency Migration. - * - *

+ * ZombieMatrix implements a Zombie Adjacency Migration. It provides the following Functionality: + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Computational Core Module
Library Statistical Learning Library
Project R1 and Rd Vector/Tensor Spaces (Validated and/or Normed), and Function Classes
Package Big-data In-place Manipulator
* * @author Lakshmi Krishnamurthy */ @@ -95,7 +114,7 @@ public class ZombieMatrix private int _rowCount = -1; private int _columnCount = -1; - private java.util.Set _uninfectedCellSet = new java.util.TreeSet(); + private Set _uninfectedCellSet = new TreeSet(); private boolean infectable ( final int cell) @@ -105,31 +124,19 @@ private boolean infectable ( int up = cell - _rowCount; int down = cell + _rowCount; - if (0 < up && !_uninfectedCellSet.contains ( - up - )) - { + if (0 < up && !_uninfectedCellSet.contains (up)) { return true; } - if (_rowCount * _columnCount > down && !_uninfectedCellSet.contains ( - down - )) - { + if (_rowCount * _columnCount > down && !_uninfectedCellSet.contains (down)) { return true; } - if (0 < left && !_uninfectedCellSet.contains ( - left - )) - { + if (0 < left && !_uninfectedCellSet.contains (left)) { return true; } - if (_rowCount * _columnCount > right && !_uninfectedCellSet.contains ( - right - )) - { + if (_rowCount * _columnCount > right && !_uninfectedCellSet.contains (right)) { return true; } @@ -137,65 +144,39 @@ private boolean infectable ( } /** - * ZombieMatrix Constructor + * ZombieMatrix Constructor * - * @param a Zombie Matrix Grid + * @param matrix Zombie Matrix Grid * - * @throws java.lang.Exception Thrown if the Inputs are Invalid + * @throws Exception Thrown if the Inputs are Invalid */ public ZombieMatrix ( - final boolean[][] a) - throws java.lang.Exception + final boolean[][] matrix) + throws Exception { - if (null == a) - { - throw new java.lang.Exception ( - "ZombieMatrix Constructor => Invalid Inputs" - ); + if (null == matrix) { + throw new Exception ("ZombieMatrix Constructor => Invalid Inputs"); } - if (0 == (_rowCount = a.length)) - { - throw new java.lang.Exception ( - "ZombieMatrix Constructor => Invalid Inputs" - ); + if (0 == (_rowCount = matrix.length)) { + throw new Exception ("ZombieMatrix Constructor => Invalid Inputs"); } - for (int rowIndex = 0; - rowIndex < _rowCount; - ++rowIndex) - { - if (-1 == _columnCount) - { - if (0 == (_columnCount = a[rowIndex].length)) - { - throw new java.lang.Exception ( - "ZombieMatrix Constructor => Invalid Inputs" - ); + for (int rowIndex = 0; rowIndex < _rowCount; ++rowIndex) { + if (-1 == _columnCount) { + if (0 == (_columnCount = matrix[rowIndex].length)) { + throw new Exception ("ZombieMatrix Constructor => Invalid Inputs"); } - } - else if (_columnCount != a[rowIndex].length) - { - throw new java.lang.Exception ( - "ZombieMatrix Constructor => Invalid Inputs" - ); + } else if (_columnCount != matrix[rowIndex].length) { + throw new Exception ("ZombieMatrix Constructor => Invalid Inputs"); } } - for (int rowIndex = 0; - rowIndex < _rowCount; - ++rowIndex) - { - for (int columnIndex = 0; - columnIndex < _columnCount; - ++columnIndex) - { - if (a[rowIndex][columnIndex]) - { - _uninfectedCellSet.add ( - rowIndex * _rowCount + columnIndex - ); + for (int rowIndex = 0; rowIndex < _rowCount; ++rowIndex) { + for (int columnIndex = 0; columnIndex < _columnCount; ++columnIndex) { + if (matrix[rowIndex][columnIndex]) { + _uninfectedCellSet.add (rowIndex * _rowCount + columnIndex); } } } @@ -207,7 +188,7 @@ else if (_columnCount != a[rowIndex].length) * @return The Uninfected Cell Set */ - public java.util.Set uninfectedCellSet() + public Set uninfectedCellSet() { return _uninfectedCellSet; } @@ -244,20 +225,12 @@ public int infectionPeriod() { int infectionPeriod = 0; - while (!_uninfectedCellSet.isEmpty()) - { - java.util.Set uninfectedCellSetUpdate = - new java.util.TreeSet(); + while (!_uninfectedCellSet.isEmpty()) { + Set uninfectedCellSetUpdate = new TreeSet(); - for (int cell : _uninfectedCellSet) - { - if (!infectable ( - cell - )) - { - uninfectedCellSetUpdate.add ( - cell - ); + for (int cell : _uninfectedCellSet) { + if (!infectable (cell)) { + uninfectedCellSetUpdate.add (cell); } } diff --git a/src/main/java/org/drip/spaces/cover/CarlStephaniNormedBounds.java b/src/main/java/org/drip/spaces/cover/CarlStephaniNormedBounds.java index cd0877e8fe50..eecab48758ac 100644 --- a/src/main/java/org/drip/spaces/cover/CarlStephaniNormedBounds.java +++ b/src/main/java/org/drip/spaces/cover/CarlStephaniNormedBounds.java @@ -1,11 +1,16 @@ package org.drip.spaces.cover; +import org.drip.numerical.common.NumberUtil; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -82,7 +87,7 @@ /** * CarlStephaniNormedBounds contains the Normed Bounds that result from the Convolution Product of 2 - * Normed Rx To Normed Rx Function Spaces. The References are: + * Normed Rx To Normed Rx Function Spaces. The References are: * *

*
    @@ -101,39 +106,57 @@ * *
* - *

+ * It provides the following Functionality: + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Computational Core Module
Library Statistical Learning Library
Project R1 and Rd Vector/Tensor Spaces (Validated and/or Normed), and Function Classes
Package Vector Spaces Covering Number Estimator
* * @author Lakshmi Krishnamurthy */ -public class CarlStephaniNormedBounds { - private double _dblEntropyBoundNormA = java.lang.Double.NaN; - private double _dblEntropyBoundNormB = java.lang.Double.NaN; +public class CarlStephaniNormedBounds +{ + private double _entropyBoundNormA = Double.NaN; + private double _entropyBoundNormB = java.lang.Double.NaN; /** * CarlStephaniNormedBounds Constructor * - * @param dblEntropyBoundNormA The Entropy Bound using the Function Class Norm A - * @param dblEntropyBoundNormB The Entropy Bound using the Function Class Norm B + * @param entropyBoundNormA The Entropy Bound using the Function Class Norm A + * @param entropyBoundNormB The Entropy Bound using the Function Class Norm B * - * @throws java.lang.Exception Thrown if the Inputs are Invalid + * @throws Exception Thrown if the Inputs are Invalid */ public CarlStephaniNormedBounds ( - final double dblEntropyBoundNormA, - final double dblEntropyBoundNormB) - throws java.lang.Exception + final double entropyBoundNormA, + final double entropyBoundNormB) + throws Exception { - if (!org.drip.numerical.common.NumberUtil.IsValid (_dblEntropyBoundNormA = dblEntropyBoundNormA) || - !org.drip.numerical.common.NumberUtil.IsValid (_dblEntropyBoundNormB = dblEntropyBoundNormB)) - throw new java.lang.Exception ("CarlStephaniNormedBounds Constructor => Invalid Inputs"); + if (!NumberUtil.IsValid (_entropyBoundNormA = entropyBoundNormA) || + !NumberUtil.IsValid (_entropyBoundNormB = entropyBoundNormB)) + { + throw new Exception ("CarlStephaniNormedBounds Constructor => Invalid Inputs"); + } } /** @@ -144,7 +167,7 @@ public CarlStephaniNormedBounds ( public double entropyBoundNormA() { - return _dblEntropyBoundNormA; + return _entropyBoundNormA; } /** @@ -155,7 +178,7 @@ public double entropyBoundNormA() public double entropyBoundNormB() { - return _dblEntropyBoundNormB; + return _entropyBoundNormB; } /** @@ -166,6 +189,6 @@ public double entropyBoundNormB() public double minimumUpperBound() { - return _dblEntropyBoundNormA < _dblEntropyBoundNormB ? _dblEntropyBoundNormA : _dblEntropyBoundNormB; + return _entropyBoundNormA < _entropyBoundNormB ? _entropyBoundNormA : _entropyBoundNormB; } }