diff --git a/ReleaseNotes/02_08_2024.txt b/ReleaseNotes/02_08_2024.txt
new file mode 100644
index 000000000000..6016882d4dd1
--- /dev/null
+++ b/ReleaseNotes/02_08_2024.txt
@@ -0,0 +1,59 @@
+
+Features:
+
+ - Random Matrix Generator Atomic Lower Triangular (10, 11, 12)
+ - Random Matrix Generator Atomic Upper Triangular (46, 47, 48)
+ - Linear Algebra Tridiagonal Matrix Shell (81, 82)
+ - Linear Algebra Tridiagonal Matrix Constructor (83, 84)
+ - Non-Periodic Tridiagonal Matrix Shell (85, 86, 87)
+ - Non-Periodic Tridiagonal Matrix Constructor (88, 89, 90)
+ - Non-Periodic Tridiagonal Matrix Solver (91, 92, 93)
+ - Linear Algebra TridiagonalMatrix Shell (94, 95, 96)
+ - Non-Periodic Tridiagonal Matrix Shell (97, 98)
+ - Periodic Tridiagonal Matrix Shell (99, 100)
+ - Non-Periodic Tridiagonal Matrix #1 (101, 102, 103)
+ - Non-Periodic Tridiagonal Matrix #2 (104, 105)
+
+
+Bug Fixes/Re-organization:
+
+ - Atomic Lower Triangular Fix #1 (13, 14, 15)
+ - Atomic Lower Triangular Fix #2 (16, 17, 18)
+ - Atomic Lower Triangular Fix #3 (19, 20, 21)
+ - Atomic Lower Triangular Fix #4 (22, 23, 24)
+ - Atomic Lower Triangular Fix #5 (25, 26, 27)
+ - Atomic Lower Triangular Fix #6 (28, 29, 30)
+ - Atomic Lower Triangular Fix #7 (31, 32, 33)
+ - Atomic Lower Triangular Fix #8 (34, 35, 36)
+ - Solvers of Linear Systems of Equations (64, 65)
+ - Numerical Linear System Solver Migration (66, 67, 68)
+ - Numerical Ryabenkii Tsynkov System Solver (69, 70, 71)
+ - Numerical Tridiagonal System Solver Migration (72, 73, 74)
+ - Numerical Strictly Tridiagonal System Solver (75, 76, 77)
+ - Numerical Sherman Morrison System Solver (78, 79, 80)
+ - Non-Periodic Tridiagonal Matrix Revamp (106, 107, 108)
+ - Numerical Linear Solver Tridiagonal Revamp (109, 110, 111)
+ - Non-Periodic Tridiagonal Revamp (112)
+ - Linear Solver Ryabenkii Tsynkov #1 (113, 114, 115)
+ - Linear Solver Ryabenkii Tsynkov #2 (116, 117, 118)
+ - Linear Solver Ryabenkii Tsynkov #3 (119, 120)
+
+
+Samples:
+
+ - Upper Strictly Upper Triangular #1 (1, 2, 3)
+ - Upper Strictly Upper Triangular #2 (4, 5, 6)
+ - Upper Strictly Upper Triangular #3 (7, 8, 9)
+ - Atomic Lower Triangular Matrix #1 (37, 38, 39)
+ - Atomic Lower Triangular Matrix #2 (40, 41, 42)
+ - Atomic Lower Triangular Matrix #3 (43, 44, 45)
+ - Atomic Upper Triangular Matrix #1 (49, 50, 51)
+ - Atomic Upper Triangular Matrix #2 (52, 53, 54)
+ - Atomic Upper Triangular Matrix #3 (55, 56, 57)
+ - Atomic Upper Unitriangular Matrix Run (58, 59, 60)
+ - Atomic Lower Unitriangular Matrix Run (61, 62, 63)
+ - Non-periodic Tridiagonal Solver #1 (113, 114)
+ - Non-periodic Tridiagonal Solver #2 (115, 116)
+
+
+IdeaDRIP:
diff --git a/src/main/java/org/drip/fdm/cranknicolson/CNDiscretizedEvolver1D.java b/src/main/java/org/drip/fdm/cranknicolson/CNDiscretizedEvolver1D.java
index 81b111735db8..56b482754362 100644
--- a/src/main/java/org/drip/fdm/cranknicolson/CNDiscretizedEvolver1D.java
+++ b/src/main/java/org/drip/fdm/cranknicolson/CNDiscretizedEvolver1D.java
@@ -5,7 +5,7 @@
import org.drip.fdm.definition.R1EvolutionSnapshot;
import org.drip.function.definition.RdToR1;
import org.drip.numerical.common.NumberUtil;
-import org.drip.numerical.linearalgebra.StrictlyTridiagonalSolver;
+import org.drip.numerical.linearsolver.NonPeriodicTridiagonalScheme;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -379,7 +379,7 @@ public R1EvolutionSnapshot evolve (
try {
if (null == (
- stateResponseArray = new StrictlyTridiagonalSolver (
+ stateResponseArray = NonPeriodicTridiagonalScheme.Standard (
stateResponseTransitionMatrix,
rhsArray
).forwardSweepBackSubstitution()
diff --git a/src/main/java/org/drip/function/rdtor1solver/InteriorFixedPointFinder.java b/src/main/java/org/drip/function/rdtor1solver/InteriorFixedPointFinder.java
index e2d33f453a42..89eb92f79d4e 100644
--- a/src/main/java/org/drip/function/rdtor1solver/InteriorFixedPointFinder.java
+++ b/src/main/java/org/drip/function/rdtor1solver/InteriorFixedPointFinder.java
@@ -213,7 +213,7 @@ private org.drip.function.rdtor1solver.VariateInequalityConstraintMultiplier inc
}
org.drip.numerical.linearalgebra.LinearizationOutput linearizationOutput =
- org.drip.numerical.linearalgebra.LinearSystemSolver.SolveUsingMatrixInversion (
+ org.drip.numerical.linearsolver.LinearSystem.SolveUsingMatrixInversion (
constrainedObjectiveFunctionJacobianArray,
constrainedObjectiveFunctionRHSArray
);
diff --git a/src/main/java/org/drip/measure/crng/RandomMatrixGenerator.java b/src/main/java/org/drip/measure/crng/RandomMatrixGenerator.java
index 7bf37d269939..ae15416970e4 100644
--- a/src/main/java/org/drip/measure/crng/RandomMatrixGenerator.java
+++ b/src/main/java/org/drip/measure/crng/RandomMatrixGenerator.java
@@ -315,4 +315,92 @@ public static final TriangularMatrix StrictlyUpperTriangular (
return TriangularMatrix.Standard (r2Array);
}
+
+ /**
+ * Construct an Atomic Lower Triangular Matrix of Random Elements up to the Maximum Value
+ *
+ * @param elementCount Number of Elements in the Array
+ * @param maximumElement Maximum Element
+ * @param isEntryInteger TRUE - Entry is an Integer
+ *
+ * @return Atomic Lower Triangular Matrix of Random Elements up to the Maximum Value
+ */
+
+ public static final TriangularMatrix AtomicLowerTriangular (
+ final int elementCount,
+ final double maximumElement,
+ final boolean isEntryInteger)
+ {
+ double[][] r2Array = RdRandomSequence.TwoD (elementCount, maximumElement, isEntryInteger);
+
+ for (int i = 0; i < r2Array.length; ++i) {
+ for (int j = 0; j < r2Array.length; ++j) {
+ r2Array[i][j] = 0.;
+ }
+ }
+
+ for (int i = 0; i < r2Array.length; ++i) {
+ r2Array[i][i] = 1.;
+ }
+
+ int columnIndex = (int) (Math.random() * elementCount);
+
+ if (((int) maximumElement) - 1 == columnIndex) {
+ columnIndex = ((int) maximumElement) - 2;
+ } else if (0 == columnIndex) {
+ columnIndex = 1;
+ }
+
+ for (int i = 0; i < r2Array.length; ++i) {
+ if (columnIndex < i) {
+ r2Array[i][columnIndex] = 1.;
+ }
+ }
+
+ return TriangularMatrix.Standard (r2Array);
+ }
+
+ /**
+ * Construct an Atomic Upper Triangular Matrix of Random Elements up to the Maximum Value
+ *
+ * @param elementCount Number of Elements in the Array
+ * @param maximumElement Maximum Element
+ * @param isEntryInteger TRUE - Entry is an Integer
+ *
+ * @return Atomic Upper Triangular Matrix of Random Elements up to the Maximum Value
+ */
+
+ public static final TriangularMatrix AtomicUpperTriangular (
+ final int elementCount,
+ final double maximumElement,
+ final boolean isEntryInteger)
+ {
+ double[][] r2Array = RdRandomSequence.TwoD (elementCount, maximumElement, isEntryInteger);
+
+ for (int i = 0; i < r2Array.length; ++i) {
+ for (int j = 0; j < r2Array.length; ++j) {
+ r2Array[i][j] = 0.;
+ }
+ }
+
+ for (int i = 0; i < r2Array.length; ++i) {
+ r2Array[i][i] = 1.;
+ }
+
+ int columnIndex = (int) (Math.random() * elementCount);
+
+ if (((int) maximumElement) - 1 == columnIndex) {
+ columnIndex = ((int) maximumElement) - 2;
+ } else if (0 == columnIndex) {
+ columnIndex = 1;
+ }
+
+ for (int i = 0; i < r2Array.length; ++i) {
+ if (columnIndex > i) {
+ r2Array[i][columnIndex] = 1.;
+ }
+ }
+
+ return TriangularMatrix.Standard (r2Array);
+ }
}
diff --git a/src/main/java/org/drip/measure/lebesgue/R1PiecewiseDisplaced.java b/src/main/java/org/drip/measure/lebesgue/R1PiecewiseDisplaced.java
index 3e8b2955c58f..635e8a349841 100644
--- a/src/main/java/org/drip/measure/lebesgue/R1PiecewiseDisplaced.java
+++ b/src/main/java/org/drip/measure/lebesgue/R1PiecewiseDisplaced.java
@@ -162,7 +162,7 @@ public static final R1PiecewiseDisplaced Standard (
}
org.drip.numerical.linearalgebra.LinearizationOutput lo =
- org.drip.numerical.linearalgebra.LinearSystemSolver.SolveUsingMatrixInversion (aadblM, adblY);
+ org.drip.numerical.linearsolver.LinearSystem.SolveUsingMatrixInversion (aadblM, adblY);
if (null == lo) return null;
diff --git a/src/main/java/org/drip/numerical/linearalgebra/NonPeriodicTridiagonalMatrix.java b/src/main/java/org/drip/numerical/linearalgebra/NonPeriodicTridiagonalMatrix.java
new file mode 100644
index 000000000000..f60233b12b0a
--- /dev/null
+++ b/src/main/java/org/drip/numerical/linearalgebra/NonPeriodicTridiagonalMatrix.java
@@ -0,0 +1,138 @@
+
+package org.drip.numerical.linearalgebra;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * NonPeriodicTridiagonalMatrix implements a banded Non-periodic Tridiagonal Matrix. The References
+ * are:
+ *
+ *
+ *
+ * -
+ * Batista, M., and A. R. A. Ibrahim-Karawia (2009): The use of Sherman-Morrison-Woodbury formula
+ * to solve cyclic block tridiagonal and cyclic block penta-diagonal linear systems of equations
+ * Applied Mathematics of Computation 210 (2) 558-563
+ *
+ * -
+ * Datta, B. N. (2010): Numerical Linear Algebra and Applications 2nd Edition
+ * SIAM Philadelphia, PA
+ *
+ * -
+ * Gallopoulos, E., B. Phillippe, and A. H. Sameh (2016): Parallelism in Matrix Computations
+ * Spring Berlin, Germany
+ *
+ * -
+ * Niyogi, P. (2006): Introduction to Computational Fluid Dynamics Pearson London, UK
+ *
+ * -
+ * Wikipedia (2024): Tridiagonal Matrix Algorithm
+ * https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public class NonPeriodicTridiagonalMatrix extends TridiagonalMatrix
+{
+
+ /**
+ * Construct an Instance of Non-periodic Tridiagonal Matrix
+ *
+ * @param r2Array R2 Array
+ *
+ * @return Instance of Non-periodic Tridiagonal Matrix
+ */
+
+ public static NonPeriodicTridiagonalMatrix Standard (
+ final double[][] r2Array)
+ {
+ return MatrixUtil.IsTridiagonal (r2Array) ? new NonPeriodicTridiagonalMatrix (r2Array) : null;
+ }
+
+ protected NonPeriodicTridiagonalMatrix (
+ final double[][] r2Array)
+ {
+ super (r2Array);
+ }
+}
diff --git a/src/main/java/org/drip/numerical/linearalgebra/PeriodicTridiagonalMatrix.java b/src/main/java/org/drip/numerical/linearalgebra/PeriodicTridiagonalMatrix.java
new file mode 100644
index 000000000000..93e6953184e2
--- /dev/null
+++ b/src/main/java/org/drip/numerical/linearalgebra/PeriodicTridiagonalMatrix.java
@@ -0,0 +1,137 @@
+
+package org.drip.numerical.linearalgebra;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PeriodicTridiagonalMatrix implements a banded Periodic Tridiagonal Matrix. The References are:
+ *
+ *
+ *
+ * -
+ * Batista, M., and A. R. A. Ibrahim-Karawia (2009): The use of Sherman-Morrison-Woodbury formula
+ * to solve cyclic block tridiagonal and cyclic block penta-diagonal linear systems of equations
+ * Applied Mathematics of Computation 210 (2) 558-563
+ *
+ * -
+ * Datta, B. N. (2010): Numerical Linear Algebra and Applications 2nd Edition
+ * SIAM Philadelphia, PA
+ *
+ * -
+ * Gallopoulos, E., B. Phillippe, and A. H. Sameh (2016): Parallelism in Matrix Computations
+ * Spring Berlin, Germany
+ *
+ * -
+ * Niyogi, P. (2006): Introduction to Computational Fluid Dynamics Pearson London, UK
+ *
+ * -
+ * Wikipedia (2024): Tridiagonal Matrix Algorithm
+ * https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public class PeriodicTridiagonalMatrix extends TridiagonalMatrix
+{
+
+ /**
+ * Construct an Instance of Periodic Tridiagonal Matrix
+ *
+ * @param r2Array R2 Array
+ *
+ * @return Instance of Non-periodic Tridiagonal Matrix
+ */
+
+ public static final PeriodicTridiagonalMatrix Standard (
+ final double[][] r2Array)
+ {
+ return MatrixUtil.IsPeriodicTridiagonal (r2Array) ? new PeriodicTridiagonalMatrix (r2Array) : null;
+ }
+
+ protected PeriodicTridiagonalMatrix (
+ final double[][] r2Array)
+ {
+ super (r2Array);
+ }
+}
diff --git a/src/main/java/org/drip/numerical/linearalgebra/TridiagonalMatrix.java b/src/main/java/org/drip/numerical/linearalgebra/TridiagonalMatrix.java
new file mode 100644
index 000000000000..4a3ee24ce81e
--- /dev/null
+++ b/src/main/java/org/drip/numerical/linearalgebra/TridiagonalMatrix.java
@@ -0,0 +1,124 @@
+
+package org.drip.numerical.linearalgebra;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * abstracts the Tridiagonal Matrix based on Periodic/non-Periodic setup. The
+ * References are:
+ *
+ *
+ *
+ * -
+ * Batista, M., and A. R. A. Ibrahim-Karawia (2009): The use of Sherman-Morrison-Woodbury formula
+ * to solve cyclic block tridiagonal and cyclic block penta-diagonal linear systems of equations
+ * Applied Mathematics of Computation 210 (2) 558-563
+ *
+ * -
+ * Datta, B. N. (2010): Numerical Linear Algebra and Applications 2nd Edition
+ * SIAM Philadelphia, PA
+ *
+ * -
+ * Gallopoulos, E., B. Phillippe, and A. H. Sameh (2016): Parallelism in Matrix Computations
+ * Spring Berlin, Germany
+ *
+ * -
+ * Niyogi, P. (2006): Introduction to Computational Fluid Dynamics Pearson London, UK
+ *
+ * -
+ * Wikipedia (2024): Tridiagonal Matrix Algorithm
+ * https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public class TridiagonalMatrix extends SquareMatrix
+{
+
+ protected TridiagonalMatrix (
+ final double[][] r2Array)
+ {
+ super (r2Array);
+ }
+}
diff --git a/src/main/java/org/drip/numerical/linearalgebra/LinearSystemSolver.java b/src/main/java/org/drip/numerical/linearsolver/LinearSystem.java
similarity index 96%
rename from src/main/java/org/drip/numerical/linearalgebra/LinearSystemSolver.java
rename to src/main/java/org/drip/numerical/linearsolver/LinearSystem.java
index 31145615ddfe..b012ea8e9d99 100644
--- a/src/main/java/org/drip/numerical/linearalgebra/LinearSystemSolver.java
+++ b/src/main/java/org/drip/numerical/linearsolver/LinearSystem.java
@@ -1,5 +1,7 @@
-package org.drip.numerical.linearalgebra;
+package org.drip.numerical.linearsolver;
+
+import org.drip.numerical.linearalgebra.LinearizationOutput;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -83,7 +85,7 @@
*/
/**
- * LinearSystemSolver implements the solver for a system of linear equations given by
+ * LinearSystem implements the solver for a system of linear equations given by
*
* A * x = B
*
@@ -109,14 +111,14 @@
* Module = Computational Core Module
* Library = Numerical Analysis Library
* Project = Numerical Quadrature, Differentiation, Eigenization, Linear Algebra, and Utilities
- * Package = Linear Algebra Matrix Transform Library
+ * Package = Solvers of Linear Systems of Equations
*
*
*
* @author Lakshmi Krishnamurthy
*/
-public class LinearSystemSolver {
+public class LinearSystem {
/**
* Regularize (i.e., convert the diagonal entries of the given cell to non-zero using suitable linear
@@ -359,7 +361,7 @@ public static final org.drip.numerical.linearalgebra.LinearizationOutput SolveUs
double[] adblRHS = Pivot (aadblA, adblB);
if (null == adblRHS || iSize != adblRHS.length ||
- !org.drip.numerical.linearalgebra.LinearSystemSolver.IsDiagonallyDominant (aadblA, true))
+ !org.drip.numerical.linearsolver.LinearSystem.IsDiagonallyDominant (aadblA, true))
return null;
for (int i = 0; i < iSize; ++i)
diff --git a/src/main/java/org/drip/numerical/linearalgebra/StrictlyTridiagonalSolver.java b/src/main/java/org/drip/numerical/linearsolver/NonPeriodicTridiagonalScheme.java
similarity index 85%
rename from src/main/java/org/drip/numerical/linearalgebra/StrictlyTridiagonalSolver.java
rename to src/main/java/org/drip/numerical/linearsolver/NonPeriodicTridiagonalScheme.java
index d0ef48596550..3abcc6395d36 100644
--- a/src/main/java/org/drip/numerical/linearalgebra/StrictlyTridiagonalSolver.java
+++ b/src/main/java/org/drip/numerical/linearsolver/NonPeriodicTridiagonalScheme.java
@@ -1,7 +1,9 @@
-package org.drip.numerical.linearalgebra;
+package org.drip.numerical.linearsolver;
import org.drip.numerical.common.NumberUtil;
+import org.drip.numerical.linearalgebra.MatrixUtil;
+import org.drip.numerical.linearalgebra.NonPeriodicTridiagonalMatrix;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -76,8 +78,8 @@
*/
/**
- * StrictlyTridiagonalSolver implements the O(n) solver for a Strictly Tridiagonal Matrix. The
- * References are:
+ * NonPeriodicTridiagonalScheme implements the O(n) solver for a Non-Periodic Tridiagonal Matrix. The
+ * References are:
*
*
*
@@ -115,28 +117,40 @@
* @author Lakshmi Krishnamurthy
*/
-public class StrictlyTridiagonalSolver extends TridiagonalSolver
+public class NonPeriodicTridiagonalScheme extends TridiagonalScheme
{
/**
- * StrictlyTridiagonalSolver Constructor
+ * Make a Standard Instance of NonPeriodicTridiagonalScheme
*
* @param squareMatrix Square Matrix
* @param rhsArray RHS Array
*
- * @throws Exception Thrown if the Square Matrix is not Tridiagonal
+ * @return Standard Instance of NonPeriodicTridiagonalScheme
*/
- public StrictlyTridiagonalSolver (
- final double[][] squareMatrix,
+ public static NonPeriodicTridiagonalScheme Standard (
+ final double[][] r2Array,
final double[] rhsArray)
- throws Exception
{
- super (squareMatrix, rhsArray);
-
- if (!MatrixUtil.IsTridiagonal (squareMatrix)) {
- throw new Exception ("StrictlyTridiagonalSolver Constructor => Matrix not Tridiagonal");
+ try {
+ return MatrixUtil.IsTridiagonal (r2Array) ? new NonPeriodicTridiagonalScheme (
+ NonPeriodicTridiagonalMatrix.Standard (r2Array),
+ rhsArray
+ ): null;
+ } catch (Exception e) {
+ e.printStackTrace();
}
+
+ return null;
+ }
+
+ protected NonPeriodicTridiagonalScheme (
+ final NonPeriodicTridiagonalMatrix nonPeriodicTridiagonalMatrix,
+ final double[] rhsArray)
+ throws Exception
+ {
+ super (nonPeriodicTridiagonalMatrix, rhsArray);
}
/**
@@ -149,7 +163,7 @@ public double[] forwardSweepBackSubstitution()
{
double[] rhsArray = rhsArray();
- double[][] squareMatrix = squareMatrix();
+ double[][] squareMatrix = matrix().r2Array();
int matrixSize = squareMatrix.length;
double[] solutionArray = new double[matrixSize];
diff --git a/src/main/java/org/drip/numerical/linearsolver/PeriodicTridiagonalScheme.java b/src/main/java/org/drip/numerical/linearsolver/PeriodicTridiagonalScheme.java
new file mode 100644
index 000000000000..ce1f155ec9ac
--- /dev/null
+++ b/src/main/java/org/drip/numerical/linearsolver/PeriodicTridiagonalScheme.java
@@ -0,0 +1,128 @@
+
+package org.drip.numerical.linearsolver;
+
+import org.drip.numerical.linearalgebra.PeriodicTridiagonalMatrix;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PeriodicTridiagonalScheme implements the O(n) solver for a Periodic Tridiagonal Matrix. The
+ * References are:
+ *
+ *
+ *
+ * -
+ * Batista, M., and A. R. A. Ibrahim-Karawia (2009): The use of Sherman-Morrison-Woodbury formula
+ * to solve cyclic block tridiagonal and cyclic block penta-diagonal linear systems of equations
+ * Applied Mathematics of Computation 210 (2) 558-563
+ *
+ * -
+ * Datta, B. N. (2010): Numerical Linear Algebra and Applications 2nd Edition
+ * SIAM Philadelphia, PA
+ *
+ * -
+ * Gallopoulos, E., B. Phillippe, and A. H. Sameh (2016): Parallelism in Matrix Computations
+ * Spring Berlin, Germany
+ *
+ * -
+ * Niyogi, P. (2006): Introduction to Computational Fluid Dynamics Pearson London, UK
+ *
+ * -
+ * Wikipedia (2024): Tridiagonal Matrix Algorithm
+ * https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public abstract class PeriodicTridiagonalScheme extends TridiagonalScheme
+{
+
+ protected PeriodicTridiagonalScheme (
+ final PeriodicTridiagonalMatrix periodicTridiagonalMatrix,
+ final double[] rhsArray)
+ throws Exception
+ {
+ super (periodicTridiagonalMatrix, rhsArray);
+ }
+}
diff --git a/src/main/java/org/drip/numerical/linearalgebra/RyabenkiiTsynkovSolver.java b/src/main/java/org/drip/numerical/linearsolver/RyabenkiiTsynkovScheme.java
similarity index 73%
rename from src/main/java/org/drip/numerical/linearalgebra/RyabenkiiTsynkovSolver.java
rename to src/main/java/org/drip/numerical/linearsolver/RyabenkiiTsynkovScheme.java
index 194425800fff..aaf4169aa276 100644
--- a/src/main/java/org/drip/numerical/linearalgebra/RyabenkiiTsynkovSolver.java
+++ b/src/main/java/org/drip/numerical/linearsolver/RyabenkiiTsynkovScheme.java
@@ -1,7 +1,9 @@
-package org.drip.numerical.linearalgebra;
+package org.drip.numerical.linearsolver;
import org.drip.numerical.common.NumberUtil;
+import org.drip.numerical.linearalgebra.MatrixUtil;
+import org.drip.numerical.linearalgebra.PeriodicTridiagonalMatrix;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -76,7 +78,7 @@
*/
/**
- * RyabenkiiTsynkovSolver implements the O(n) solver for a Tridiagonal Matrix with Periodic Boundary
+ * RyabenkiiTsynkovScheme implements the O(n) solver for a Tridiagonal Matrix with Periodic Boundary
* Conditions. The References are:
*
*
@@ -116,28 +118,40 @@
* @author Lakshmi Krishnamurthy
*/
-public class RyabenkiiTsynkovSolver extends TridiagonalSolver
+public class RyabenkiiTsynkovScheme extends PeriodicTridiagonalScheme
{
/**
- * RyabenkiiTsynkovSolver Constructor
+ * Construct a Standard Instance of RyabenkiiTsynkovScheme
*
- * @param squareMatrix Square Matrix
+ * @param r2Array R2 Array
* @param rhsArray RHS Array
*
- * @throws Exception Thrown if the Square Matrix is not Periodic Tridiagonal
+ * @return Standard Instance of RyabenkiiTsynkovScheme
*/
- public RyabenkiiTsynkovSolver (
- final double[][] squareMatrix,
+ public static RyabenkiiTsynkovScheme Standard (
+ final double[][] r2Array,
final double[] rhsArray)
- throws Exception
{
- super (squareMatrix, rhsArray);
-
- if (!MatrixUtil.IsPeriodicTridiagonal (squareMatrix)) {
- throw new Exception ("RyabenkiiTsynkovSolver Constructor => Matrix not Periodic Tridiagonal");
+ try {
+ return MatrixUtil.IsPeriodicTridiagonal (r2Array) ? new RyabenkiiTsynkovScheme (
+ PeriodicTridiagonalMatrix.Standard (r2Array),
+ rhsArray
+ ) : null;
+ } catch (Exception e) {
+ e.printStackTrace();
}
+
+ return null;
+ }
+
+ protected RyabenkiiTsynkovScheme (
+ final PeriodicTridiagonalMatrix periodicTridiagonalMatrix,
+ final double[] rhsArray)
+ throws Exception
+ {
+ super (periodicTridiagonalMatrix, rhsArray);
}
/**
@@ -148,14 +162,14 @@ public RyabenkiiTsynkovSolver (
public double[][] tridiagonalMatrix()
{
- double[][] squareMatrix = squareMatrix();
+ double[][] r2Array = matrix().r2Array();
- int size = squareMatrix.length - 1;
+ int size = r2Array.length - 1;
double[][] uTridiagonalMatrix = new double[size][size];
for (int i = 1; i <= size; ++i) {
for (int j = 1; j <= size; ++j) {
- uTridiagonalMatrix[i - 1][j - 1] = squareMatrix[i][j];
+ uTridiagonalMatrix[i - 1][j - 1] = r2Array[i][j];
}
}
@@ -190,12 +204,12 @@ public double[] uRHSArray()
public double[] vRHSArray()
{
- double[][] squareMatrix = squareMatrix();
+ double[][] r2Array = matrix().r2Array();
- int size = squareMatrix.length - 1;
+ int size = r2Array.length - 1;
double[] vRHSArray = new double[size];
- vRHSArray[0] = -1. * squareMatrix[1][0];
- vRHSArray[size - 1] = -1. * squareMatrix[size][0];
+ vRHSArray[0] = -1. * r2Array[1][0];
+ vRHSArray[size - 1] = -1. * r2Array[size][0];
for (int i = 2; i <= size - 1; ++i) {
vRHSArray[i - 1] = 0.;
@@ -212,16 +226,13 @@ public double[] vRHSArray()
public double[] uSolutionArray()
{
- try {
- return new StrictlyTridiagonalSolver (
- tridiagonalMatrix(),
- uRHSArray()
- ).forwardSweepBackSubstitution();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ NonPeriodicTridiagonalScheme nonPeriodicTridiagonalScheme = NonPeriodicTridiagonalScheme.Standard (
+ tridiagonalMatrix(),
+ uRHSArray()
+ );
- return null;
+ return null == nonPeriodicTridiagonalScheme ? null :
+ nonPeriodicTridiagonalScheme.forwardSweepBackSubstitution();
}
/**
@@ -232,16 +243,13 @@ public double[] uSolutionArray()
public double[] vSolutionArray()
{
- try {
- return new StrictlyTridiagonalSolver (
- tridiagonalMatrix(),
- vRHSArray()
- ).forwardSweepBackSubstitution();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ NonPeriodicTridiagonalScheme nonPeriodicTridiagonalScheme = NonPeriodicTridiagonalScheme.Standard (
+ tridiagonalMatrix(),
+ vRHSArray()
+ );
- return null;
+ return null == nonPeriodicTridiagonalScheme ? null :
+ nonPeriodicTridiagonalScheme.forwardSweepBackSubstitution();
}
/**
@@ -254,10 +262,6 @@ public double[] uvSolver()
{
double[] rhsArray = rhsArray();
- double[][] squareMatrix = squareMatrix();
-
- double[] uSolutionArray = null;
- double[] vSolutionArray = null;
int size = rhsArray.length - 1;
double[] solutionArray = new double[size + 1];
@@ -267,29 +271,44 @@ public double[] uvSolver()
return null;
}
- try {
- uSolutionArray = new StrictlyTridiagonalSolver (
- tridiagonalMatrix,
- uRHSArray()
- ).forwardSweepBackSubstitution();
-
- vSolutionArray = new StrictlyTridiagonalSolver (
- tridiagonalMatrix,
- vRHSArray()
- ).forwardSweepBackSubstitution();
- } catch (Exception e) {
- e.printStackTrace();
+ NonPeriodicTridiagonalScheme uRHSTridiagonalScheme = NonPeriodicTridiagonalScheme.Standard (
+ tridiagonalMatrix,
+ uRHSArray()
+ );
+
+ if (null == uRHSTridiagonalScheme) {
+ return null;
+ }
+
+ double[] uSolutionArray = uRHSTridiagonalScheme.forwardSweepBackSubstitution();
+ if (null == uSolutionArray) {
return null;
}
+ NonPeriodicTridiagonalScheme vRHSTridiagonalScheme = NonPeriodicTridiagonalScheme.Standard (
+ tridiagonalMatrix,
+ vRHSArray()
+ );
+
+ if (null == vRHSTridiagonalScheme) {
+ return null;
+ }
+
+ double[] vSolutionArray = vRHSTridiagonalScheme.forwardSweepBackSubstitution();
+
+ if (null == vSolutionArray) {
+ return null;
+ }
+
+ double[][] r2Array = matrix().r2Array();
+
if (!NumberUtil.IsValid (
solutionArray[0] = (
- rhsArray[0] - squareMatrix[0][size] * uSolutionArray[size - 1] -
- squareMatrix[0][1] * uSolutionArray[0]
+ rhsArray[0] - r2Array[0][size] * uSolutionArray[size - 1] - r2Array[0][1] * uSolutionArray[0]
) / (
- squareMatrix[0][0] + squareMatrix[0][size] * vSolutionArray[size - 1] +
- squareMatrix[0][1] * vSolutionArray[0]
+ r2Array[0][0] + r2Array[0][size] * vSolutionArray[size - 1] +
+ r2Array[0][1] * vSolutionArray[0]
)
))
{
diff --git a/src/main/java/org/drip/numerical/linearalgebra/ShermanMorrisonSolver.java b/src/main/java/org/drip/numerical/linearsolver/ShermanMorrison.java
similarity index 72%
rename from src/main/java/org/drip/numerical/linearalgebra/ShermanMorrisonSolver.java
rename to src/main/java/org/drip/numerical/linearsolver/ShermanMorrison.java
index 5bbb3dd35b91..caa32bfe8dad 100644
--- a/src/main/java/org/drip/numerical/linearalgebra/ShermanMorrisonSolver.java
+++ b/src/main/java/org/drip/numerical/linearsolver/ShermanMorrison.java
@@ -1,7 +1,9 @@
-package org.drip.numerical.linearalgebra;
+package org.drip.numerical.linearsolver;
import org.drip.numerical.common.NumberUtil;
+import org.drip.numerical.linearalgebra.MatrixUtil;
+import org.drip.numerical.linearalgebra.PeriodicTridiagonalMatrix;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -76,7 +78,7 @@
*/
/**
- * ShermanMorrisonSolver implements the O(n) solver for a Tridiagonal Matrix with Periodic Boundary
+ * ShermanMorrison implements the O(n) solver for a Tridiagonal Matrix with Periodic Boundary
* Conditions. The References are:
*
*
@@ -116,7 +118,7 @@
* @author Lakshmi Krishnamurthy
*/
-public class ShermanMorrisonSolver extends TridiagonalSolver
+public class ShermanMorrison extends PeriodicTridiagonalScheme
{
/**
@@ -130,22 +132,22 @@ public class ShermanMorrisonSolver extends TridiagonalSolver
/**
* Construct a Standard Gamma Instance of Sherman Morrison Solver
*
- * @param squareMatrix Square Matrix
+ * @param r2Array R2 Array
* @param rhsArray RHS Array
*
* @return Standard Gamma Instance of Sherman Morrison Solver
*/
- public static final ShermanMorrisonSolver Standard (
- final double[][] squareMatrix,
+ public static final ShermanMorrison Standard (
+ final double[][] r2Array,
final double[] rhsArray)
{
try {
- return new ShermanMorrisonSolver (
- squareMatrix,
+ return MatrixUtil.IsPeriodicTridiagonal (r2Array) ? new ShermanMorrison (
+ PeriodicTridiagonalMatrix.Standard (r2Array),
rhsArray,
BATISTA_KARAWIA_DEFAULT_GAMMA
- );
+ ) : null;
} catch (Exception e) {
e.printStackTrace();
}
@@ -156,25 +158,25 @@ public static final ShermanMorrisonSolver Standard (
/**
* Construct a Standard Batista-Karawia Instance of Sherman Morrison Solver
*
- * @param squareMatrix Square Matrix
+ * @param r2Array R2 Array
* @param rhsArray RHS Array
*
* @return Standard Batista-Karawia Instance of Sherman Morrison Solver
*/
- public static final ShermanMorrisonSolver StandardBatistaKarawia (
- final double[][] squareMatrix,
+ public static final ShermanMorrison StandardBatistaKarawia (
+ final double[][] r2Array,
final double[] rhsArray)
{
- if (null == squareMatrix || 0 == squareMatrix.length) {
+ if (null == r2Array || 0 == r2Array.length) {
return null;
}
int index = 1;
- double gamma = -1. * squareMatrix[0][0];
+ double gamma = -1. * r2Array[0][0];
- while (0. == gamma && index < squareMatrix.length) {
- gamma = -1. * squareMatrix[index][index];
+ while (0. == gamma && index < r2Array.length) {
+ gamma = -1. * r2Array[index][index];
++index;
}
@@ -183,7 +185,11 @@ public static final ShermanMorrisonSolver StandardBatistaKarawia (
}
try {
- return new ShermanMorrisonSolver (squareMatrix, rhsArray, gamma);
+ return MatrixUtil.IsPeriodicTridiagonal (r2Array) ? new ShermanMorrison (
+ PeriodicTridiagonalMatrix.Standard (r2Array),
+ rhsArray,
+ gamma
+ ) : null;
} catch (Exception e) {
e.printStackTrace();
}
@@ -191,28 +197,16 @@ public static final ShermanMorrisonSolver StandardBatistaKarawia (
return null;
}
- /**
- * ShermanMorrisonSolver Constructor
- *
- * @param squareMatrix Square Matrix
- * @param rhsArray RHS Array
- * @param gamma Gamma
- *
- * @throws Exception Thrown if the Square Matrix is not Periodic Tridiagonal
- */
-
- public ShermanMorrisonSolver (
- final double[][] squareMatrix,
+ protected ShermanMorrison (
+ final PeriodicTridiagonalMatrix periodicTridiagonalMatrix,
final double[] rhsArray,
final double gamma)
throws Exception
{
- super (squareMatrix, rhsArray);
+ super (periodicTridiagonalMatrix, rhsArray);
- if (!MatrixUtil.IsPeriodicTridiagonal (squareMatrix) ||
- !NumberUtil.IsValid (_gamma = gamma) || 0. == _gamma)
- {
- throw new Exception ("ShermanMorrisonSolver Constructor => Matrix not Periodic Tridiagonal");
+ if (!NumberUtil.IsValid (_gamma = gamma) || 0. == _gamma) {
+ throw new Exception ("ShermanMorrison Constructor => Matrix not Periodic Tridiagonal");
}
}
@@ -237,20 +231,20 @@ public double[][] batistaKarawiaMatrix()
{
double[] rhsArray = rhsArray();
- double[][] squareMatrix = squareMatrix();
+ double[][] r2Array = matrix().r2Array();
double[][] batistaKarawiaMatrix = new double[rhsArray.length][rhsArray.length];
- for (int i = 0; i < squareMatrix.length; ++i) {
- for (int j = 0; j < squareMatrix.length; ++j) {
- batistaKarawiaMatrix[i][j] = j >= i - 1 && j <= i + 1 ? squareMatrix[i][j] : 0.;
+ for (int i = 0; i < r2Array.length; ++i) {
+ for (int j = 0; j < r2Array.length; ++j) {
+ batistaKarawiaMatrix[i][j] = j >= i - 1 && j <= i + 1 ? r2Array[i][j] : 0.;
}
}
int lastIndex = rhsArray.length - 1;
- batistaKarawiaMatrix[0][0] = squareMatrix[0][0] - _gamma;
- batistaKarawiaMatrix[lastIndex][lastIndex] = squareMatrix[lastIndex][lastIndex] - (
- squareMatrix[lastIndex][0] * squareMatrix[0][lastIndex] / _gamma
+ batistaKarawiaMatrix[0][0] = r2Array[0][0] - _gamma;
+ batistaKarawiaMatrix[lastIndex][lastIndex] = r2Array[lastIndex][lastIndex] - (
+ r2Array[lastIndex][0] * r2Array[0][lastIndex] / _gamma
);
return batistaKarawiaMatrix;
}
@@ -265,7 +259,7 @@ public double[] uRHSArray()
{
double[] rhsArray = rhsArray();
- double[][] squareMatrix = squareMatrix();
+ double[][] r2Array = matrix().r2Array();
double[] uRHSArray = new double[rhsArray.length];
@@ -275,7 +269,7 @@ public double[] uRHSArray()
uRHSArray[0] = _gamma;
int lastIndex = rhsArray.length - 1;
- uRHSArray[lastIndex] = squareMatrix[lastIndex][0];
+ uRHSArray[lastIndex] = r2Array[lastIndex][0];
return uRHSArray;
}
@@ -293,13 +287,11 @@ public double[] qSolutionArray()
return null;
}
- try {
- return new StrictlyTridiagonalSolver (batistaKarawiaMatrix, uRHSArray()).forwardSweepBackSubstitution();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ NonPeriodicTridiagonalScheme nonPeriodicTridiagonalScheme =
+ NonPeriodicTridiagonalScheme.Standard (batistaKarawiaMatrix, uRHSArray());
- return null;
+ return null == nonPeriodicTridiagonalScheme ? null :
+ nonPeriodicTridiagonalScheme.forwardSweepBackSubstitution();
}
/**
@@ -316,13 +308,11 @@ public double[] ySolutionArray()
return null;
}
- try {
- return new StrictlyTridiagonalSolver (batistaKarawiaMatrix, rhsArray()).forwardSweepBackSubstitution();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ NonPeriodicTridiagonalScheme nonPeriodicTridiagonalScheme =
+ NonPeriodicTridiagonalScheme.Standard (batistaKarawiaMatrix, rhsArray());
- return null;
+ return null == nonPeriodicTridiagonalScheme ? null :
+ nonPeriodicTridiagonalScheme.forwardSweepBackSubstitution();
}
/**
@@ -335,7 +325,7 @@ public double[] vArray()
{
double[] rhsArray = rhsArray();
- double[][] squareMatrix = squareMatrix();
+ double[][] r2Array = matrix().r2Array();
double[] vArray = new double[rhsArray.length];
@@ -345,7 +335,7 @@ public double[] vArray()
vArray[0] = 1.;
int lastIndex = rhsArray.length - 1;
- vArray[lastIndex] = squareMatrix[0][lastIndex] / _gamma;
+ vArray[lastIndex] = r2Array[0][lastIndex] / _gamma;
return vArray;
}
@@ -361,25 +351,33 @@ public double[] qySolver()
double[] rhsArray = rhsArray();
- double[] qSolutionArray = null;
- double[] ySolutionArray = null;
- double vqDotProductScaler = Double.NaN;
-
double[][] batistaKarawiaMatrix = batistaKarawiaMatrix();
- try {
- qSolutionArray = new StrictlyTridiagonalSolver (
- batistaKarawiaMatrix,
- uRHSArray()
- ).forwardSweepBackSubstitution();
-
- ySolutionArray = new StrictlyTridiagonalSolver (
- batistaKarawiaMatrix,
- rhsArray
- ).forwardSweepBackSubstitution();
- } catch (Exception e) {
- e.printStackTrace();
+ NonPeriodicTridiagonalScheme uRHSNonPeriodicTridiagonalScheme =
+ NonPeriodicTridiagonalScheme.Standard (batistaKarawiaMatrix, uRHSArray());
+
+ if (null == uRHSNonPeriodicTridiagonalScheme) {
+ return null;
+ }
+
+ double[] qSolutionArray = null == uRHSNonPeriodicTridiagonalScheme ? null :
+ uRHSNonPeriodicTridiagonalScheme.forwardSweepBackSubstitution();
+
+ if (null == qSolutionArray) {
+ return null;
+ }
+
+ NonPeriodicTridiagonalScheme rhsNonPeriodicTridiagonalScheme =
+ NonPeriodicTridiagonalScheme.Standard (batistaKarawiaMatrix, rhsArray);
+ if (null == rhsNonPeriodicTridiagonalScheme) {
+ return null;
+ }
+
+ double[] ySolutionArray = null == rhsNonPeriodicTridiagonalScheme ? null :
+ rhsNonPeriodicTridiagonalScheme.forwardSweepBackSubstitution();
+
+ if (null == ySolutionArray) {
return null;
}
@@ -392,6 +390,8 @@ public double[] qySolver()
return null;
}
+ double vqDotProductScaler = Double.NaN;
+
try {
vqDotProductScaler = 1. / (1. + MatrixUtil.DotProduct (vArray, qSolutionArray));
} catch (Exception e) {
diff --git a/src/main/java/org/drip/numerical/linearalgebra/TridiagonalSolver.java b/src/main/java/org/drip/numerical/linearsolver/TridiagonalScheme.java
similarity index 88%
rename from src/main/java/org/drip/numerical/linearalgebra/TridiagonalSolver.java
rename to src/main/java/org/drip/numerical/linearsolver/TridiagonalScheme.java
index fd47ed1ed2c4..0bd7b96a07a4 100644
--- a/src/main/java/org/drip/numerical/linearalgebra/TridiagonalSolver.java
+++ b/src/main/java/org/drip/numerical/linearsolver/TridiagonalScheme.java
@@ -1,5 +1,7 @@
-package org.drip.numerical.linearalgebra;
+package org.drip.numerical.linearsolver;
+
+import org.drip.numerical.linearalgebra.TridiagonalMatrix;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -74,8 +76,8 @@
*/
/**
- * TridiagonalSolver exposes the O(n) solver functionality for solving Tridiagonal Matrices. The
- * References are:
+ * TridiagonalScheme exposes the O(n) solver functionality for solving Tridiagonal Matrices. The
+ * References are:
*
*
*
@@ -113,32 +115,33 @@
* @author Lakshmi Krishnamurthy
*/
-public abstract class TridiagonalSolver
+public abstract class TridiagonalScheme
{
private double[] _rhsArray = null;
- private double[][] _squareMatrix = null;
+ private TridiagonalMatrix _tridiagonalMatrix = null;
- protected TridiagonalSolver (
- final double[][] squareMatrix,
+ protected TridiagonalScheme (
+ final TridiagonalMatrix tridiagonalMatrix,
final double[] rhsArray)
throws Exception
{
- if (null == (_squareMatrix = squareMatrix) || null == (_rhsArray = rhsArray) ||
- _squareMatrix.length != _rhsArray.length)
+ if (null == (_tridiagonalMatrix = tridiagonalMatrix) ||
+ null == (_rhsArray = rhsArray) ||
+ _tridiagonalMatrix.size() != _rhsArray.length)
{
- throw new Exception ("TridiagonalSolver Constructor => Matrix not Tridiagonal");
+ throw new Exception ("TridiagonalScheme Constructor => Matrix not Tridiagonal");
}
}
/**
- * Retrieve the Square Matrix
+ * Retrieve the Tridiagonal Matrix
*
- * @return Square Matrix
+ * @return Tridiagonal Matrix
*/
- public double[][] squareMatrix()
+ public TridiagonalMatrix matrix()
{
- return _squareMatrix;
+ return _tridiagonalMatrix;
}
/**
diff --git a/src/main/java/org/drip/numerical/linearsolver/package-info.java b/src/main/java/org/drip/numerical/linearsolver/package-info.java
new file mode 100644
index 000000000000..254f776eae8c
--- /dev/null
+++ b/src/main/java/org/drip/numerical/linearsolver/package-info.java
@@ -0,0 +1,8 @@
+
+/**
+ * Solvers of Linear Systems of Equations
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+package org.drip.numerical.linearsolver;
diff --git a/src/main/java/org/drip/portfolioconstruction/allocator/QuadraticMeanVarianceOptimizer.java b/src/main/java/org/drip/portfolioconstruction/allocator/QuadraticMeanVarianceOptimizer.java
index 74deb265ce43..5ccc255efc71 100644
--- a/src/main/java/org/drip/portfolioconstruction/allocator/QuadraticMeanVarianceOptimizer.java
+++ b/src/main/java/org/drip/portfolioconstruction/allocator/QuadraticMeanVarianceOptimizer.java
@@ -273,7 +273,7 @@ public QuadraticMeanVarianceOptimizer()
}
org.drip.numerical.linearalgebra.LinearizationOutput linearizationOutput =
- org.drip.numerical.linearalgebra.LinearSystemSolver.SolveUsingMatrixInversion (
+ org.drip.numerical.linearsolver.LinearSystem.SolveUsingMatrixInversion (
lagrangianMultivariate.hessian (variateArray),
rhsArray
);
@@ -353,7 +353,7 @@ public QuadraticMeanVarianceOptimizer()
double[] variateArray = new double[lagrangianDimension];
org.drip.numerical.linearalgebra.LinearizationOutput linearizationOutput =
- org.drip.numerical.linearalgebra.LinearSystemSolver.SolveUsingMatrixInversion (
+ org.drip.numerical.linearsolver.LinearSystem.SolveUsingMatrixInversion (
lagrangianMultivariate.hessian (variateArray),
lagrangianMultivariate.jacobian (variateArray)
);
diff --git a/src/main/java/org/drip/sample/matrix/LinearAlgebra.java b/src/main/java/org/drip/sample/matrix/LinearAlgebra.java
index 56d4f1c8d05a..5cb5ed20eb4d 100644
--- a/src/main/java/org/drip/sample/matrix/LinearAlgebra.java
+++ b/src/main/java/org/drip/sample/matrix/LinearAlgebra.java
@@ -3,6 +3,7 @@
import org.drip.numerical.common.*;
import org.drip.numerical.linearalgebra.*;
+import org.drip.numerical.linearsolver.LinearSystem;
import org.drip.service.common.FormatUtil;
import org.drip.service.env.EnvManager;
@@ -229,7 +230,7 @@ private static final void LinearSystemSolver()
* Solve the Linear System using Gaussian Elimination
*/
- LinearizationOutput lssGaussianElimination = LinearSystemSolver.SolveUsingGaussianElimination (
+ LinearizationOutput lssGaussianElimination = LinearSystem.SolveUsingGaussianElimination (
aadblA,
adblB
);
diff --git a/src/main/java/org/drip/sample/triangular/AtomicLowerUnitriangular.java b/src/main/java/org/drip/sample/triangular/AtomicLowerUnitriangular.java
new file mode 100644
index 000000000000..8946cb6c094d
--- /dev/null
+++ b/src/main/java/org/drip/sample/triangular/AtomicLowerUnitriangular.java
@@ -0,0 +1,363 @@
+
+package org.drip.sample.triangular;
+
+import java.util.Date;
+
+import org.drip.measure.crng.RandomMatrixGenerator;
+import org.drip.numerical.common.NumberUtil;
+import org.drip.numerical.linearalgebra.TriangularMatrix;
+import org.drip.service.common.FormatUtil;
+import org.drip.service.common.StringUtil;
+import org.drip.service.env.EnvManager;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AtomicLowerUnitriangular shows the Construction, the Usage, and the Analysis of a Atomic Lower
+ * Unitriangular Matrix. The References are:
+ *
+ *
+ *
+ * -
+ * Axler, S. J. (1997): Linear Algebra Done Right 2nd Edition Springer
+ * New York NY
+ *
+ * -
+ * Bernstein, D. S. (2009): Matrix Mathematics: Theory, Facts, and Formulas 2nd
+ * Edition Princeton University Press Princeton NJ
+ *
+ * -
+ * Herstein, I. N. (1975): Topics in Algebra 2nd Edition Wiley New York NY
+ *
+ * -
+ * Prasolov, V. V. (1994): Topics in Algebra American Mathematical Society Providence
+ * RI
+ *
+ * -
+ * Wikipedia (2024): Triangular Matrix https://en.wikipedia.org/wiki/Triangular_matrix
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public class AtomicLowerUnitriangular
+{
+
+ private static final void Trial (
+ final int elementCount,
+ final double maximumElement)
+ throws Exception
+ {
+ TriangularMatrix atomicLowerTriangular = RandomMatrixGenerator.AtomicLowerTriangular (
+ elementCount,
+ maximumElement,
+ true
+ );
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println ("\t| Trial at " + new Date());
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] strictlyLowerTriangularR2Array = atomicLowerTriangular.r2Array();
+
+ for (int i = 0; i < strictlyLowerTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Atomic Lower Triangular " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ strictlyLowerTriangularR2Array[i],
+ 2,
+ 1,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] strictlyLowerTriangularR2ArrayTranspose = atomicLowerTriangular.transpose().r2Array();
+
+ for (int i = 0; i < strictlyLowerTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Transpose " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ strictlyLowerTriangularR2ArrayTranspose[i],
+ 2,
+ 1,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] baseTransposeProduct =
+ atomicLowerTriangular.product (atomicLowerTriangular.transpose()).r2Array();
+
+ for (int i = 0; i < strictlyLowerTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Base Transpose Product " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ baseTransposeProduct[i],
+ 5,
+ 0,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] transposeBaseProduct =
+ atomicLowerTriangular.transpose().product (atomicLowerTriangular).r2Array();
+
+ for (int i = 0; i < strictlyLowerTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Transpose Base Product " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ transposeBaseProduct[i],
+ 5,
+ 0,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println (
+ "\t| Is Upper Triangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isUpper())
+ );
+
+ System.out.println (
+ "\t| Is Lower Triangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isLower())
+ );
+
+ System.out.println (
+ "\t| Is Diagonal => " +
+ StringUtil.ToString (atomicLowerTriangular.isDiagonal())
+ );
+
+ System.out.println (
+ "\t| Is Triangularizable => " +
+ StringUtil.ToString (atomicLowerTriangular.isTriangularizable())
+ );
+
+ System.out.println (
+ "\t| Is Unitriangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Unit Triangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isUnit())
+ );
+
+ System.out.println (
+ "\t| Is Normed Triangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isNormed())
+ );
+
+ System.out.println (
+ "\t| Is Upper Unitriangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isUpperUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Lower Unitriangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isLowerUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Strictly Upper Triangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isStrictlyUpper())
+ );
+
+ System.out.println (
+ "\t| Is Strictly Lower Triangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isStrictlyLower())
+ );
+
+ System.out.println (
+ "\t| Is Atomic Upper Unitriangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isAtomicUpper())
+ );
+
+ System.out.println (
+ "\t| Is Atomic Lower Unitriangular => " +
+ StringUtil.ToString (atomicLowerTriangular.isAtomicLower())
+ );
+
+ System.out.println (
+ "\t| Is Atomic => " +
+ StringUtil.ToString (atomicLowerTriangular.isAtomic())
+ );
+
+ System.out.println (
+ "\t| Is Frobenius => " +
+ StringUtil.ToString (atomicLowerTriangular.isFrobenius())
+ );
+
+ System.out.println (
+ "\t| Is Gauss => " +
+ StringUtil.ToString (atomicLowerTriangular.isGauss())
+ );
+
+ System.out.println (
+ "\t| Is Gauss Transformation => " +
+ StringUtil.ToString (atomicLowerTriangular.isGaussTransformation())
+ );
+
+ System.out.println (
+ "\t| Determinant => " +
+ FormatUtil.FormatDouble (atomicLowerTriangular.determinant(), 8, 0, 1., false)
+ );
+
+ System.out.println (
+ "\t| Permanent => " +
+ FormatUtil.FormatDouble (atomicLowerTriangular.permanent(), 8, 0, 1., false)
+ );
+
+ System.out.println (
+ "\t| Eigenvalue Multiplicity Map => " + atomicLowerTriangular.eigenValueMultiplicityMap()
+ );
+
+ System.out.println (
+ "\t| Is Normal => " +
+ StringUtil.ToString (atomicLowerTriangular.isNormal())
+ );
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println();
+ }
+
+ /**
+ * Entry Point
+ *
+ * @param argumentArray Command Line Argument Array
+ *
+ * @throws Exception Thrown on Error/Exception Situation
+ */
+
+ public static final void main (
+ final String[] argumentArray)
+ throws Exception
+ {
+ EnvManager.InitEnv (
+ ""
+ );
+
+ int elementCount = 6;
+ double maximumElement = 99.;
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ EnvManager.TerminateEnv();
+ }
+}
diff --git a/src/main/java/org/drip/sample/triangular/AtomicUpperUnitriangular.java b/src/main/java/org/drip/sample/triangular/AtomicUpperUnitriangular.java
new file mode 100644
index 000000000000..9f7528cd6d2c
--- /dev/null
+++ b/src/main/java/org/drip/sample/triangular/AtomicUpperUnitriangular.java
@@ -0,0 +1,363 @@
+
+package org.drip.sample.triangular;
+
+import java.util.Date;
+
+import org.drip.measure.crng.RandomMatrixGenerator;
+import org.drip.numerical.common.NumberUtil;
+import org.drip.numerical.linearalgebra.TriangularMatrix;
+import org.drip.service.common.FormatUtil;
+import org.drip.service.common.StringUtil;
+import org.drip.service.env.EnvManager;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AtomicUpperUnitriangular shows the Construction, the Usage, and the Analysis of a Atomic Upper
+ * Unitriangular Matrix. The References are:
+ *
+ *
+ *
+ * -
+ * Axler, S. J. (1997): Linear Algebra Done Right 2nd Edition Springer
+ * New York NY
+ *
+ * -
+ * Bernstein, D. S. (2009): Matrix Mathematics: Theory, Facts, and Formulas 2nd
+ * Edition Princeton University Press Princeton NJ
+ *
+ * -
+ * Herstein, I. N. (1975): Topics in Algebra 2nd Edition Wiley New York NY
+ *
+ * -
+ * Prasolov, V. V. (1994): Topics in Algebra American Mathematical Society Providence
+ * RI
+ *
+ * -
+ * Wikipedia (2024): Triangular Matrix https://en.wikipedia.org/wiki/Triangular_matrix
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public class AtomicUpperUnitriangular
+{
+
+ private static final void Trial (
+ final int elementCount,
+ final double maximumElement)
+ throws Exception
+ {
+ TriangularMatrix atomicUpperTriangular = RandomMatrixGenerator.AtomicUpperTriangular (
+ elementCount,
+ maximumElement,
+ true
+ );
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println ("\t| Trial at " + new Date());
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] strictlyUpperTriangularR2Array = atomicUpperTriangular.r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Atomic Upper Triangular " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ strictlyUpperTriangularR2Array[i],
+ 2,
+ 1,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] strictlyUpperTriangularR2ArrayTranspose = atomicUpperTriangular.transpose().r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Transpose " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ strictlyUpperTriangularR2ArrayTranspose[i],
+ 2,
+ 1,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] baseTransposeProduct =
+ atomicUpperTriangular.product (atomicUpperTriangular.transpose()).r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Base Transpose Product " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ baseTransposeProduct[i],
+ 5,
+ 0,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] transposeBaseProduct =
+ atomicUpperTriangular.transpose().product (atomicUpperTriangular).r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Transpose Base Product " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ transposeBaseProduct[i],
+ 5,
+ 0,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println (
+ "\t| Is Upper Triangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isUpper())
+ );
+
+ System.out.println (
+ "\t| Is Lower Triangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isLower())
+ );
+
+ System.out.println (
+ "\t| Is Diagonal => " +
+ StringUtil.ToString (atomicUpperTriangular.isDiagonal())
+ );
+
+ System.out.println (
+ "\t| Is Triangularizable => " +
+ StringUtil.ToString (atomicUpperTriangular.isTriangularizable())
+ );
+
+ System.out.println (
+ "\t| Is Unitriangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Unit Triangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isUnit())
+ );
+
+ System.out.println (
+ "\t| Is Normed Triangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isNormed())
+ );
+
+ System.out.println (
+ "\t| Is Upper Unitriangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isUpperUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Lower Unitriangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isLowerUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Strictly Upper Triangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isStrictlyUpper())
+ );
+
+ System.out.println (
+ "\t| Is Strictly Lower Triangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isStrictlyLower())
+ );
+
+ System.out.println (
+ "\t| Is Atomic Upper Unitriangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isAtomicUpper())
+ );
+
+ System.out.println (
+ "\t| Is Atomic Lower Unitriangular => " +
+ StringUtil.ToString (atomicUpperTriangular.isAtomicLower())
+ );
+
+ System.out.println (
+ "\t| Is Atomic => " +
+ StringUtil.ToString (atomicUpperTriangular.isAtomic())
+ );
+
+ System.out.println (
+ "\t| Is Frobenius => " +
+ StringUtil.ToString (atomicUpperTriangular.isFrobenius())
+ );
+
+ System.out.println (
+ "\t| Is Gauss => " +
+ StringUtil.ToString (atomicUpperTriangular.isGauss())
+ );
+
+ System.out.println (
+ "\t| Is Gauss Transformation => " +
+ StringUtil.ToString (atomicUpperTriangular.isGaussTransformation())
+ );
+
+ System.out.println (
+ "\t| Determinant => " +
+ FormatUtil.FormatDouble (atomicUpperTriangular.determinant(), 8, 0, 1., false)
+ );
+
+ System.out.println (
+ "\t| Permanent => " +
+ FormatUtil.FormatDouble (atomicUpperTriangular.permanent(), 8, 0, 1., false)
+ );
+
+ System.out.println (
+ "\t| Eigenvalue Multiplicity Map => " + atomicUpperTriangular.eigenValueMultiplicityMap()
+ );
+
+ System.out.println (
+ "\t| Is Normal => " +
+ StringUtil.ToString (atomicUpperTriangular.isNormal())
+ );
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println();
+ }
+
+ /**
+ * Entry Point
+ *
+ * @param argumentArray Command Line Argument Array
+ *
+ * @throws Exception Thrown on Error/Exception Situation
+ */
+
+ public static final void main (
+ final String[] argumentArray)
+ throws Exception
+ {
+ EnvManager.InitEnv (
+ ""
+ );
+
+ int elementCount = 6;
+ double maximumElement = 99.;
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ EnvManager.TerminateEnv();
+ }
+}
diff --git a/src/main/java/org/drip/sample/triangular/StrictlyUpper.java b/src/main/java/org/drip/sample/triangular/StrictlyUpper.java
new file mode 100644
index 000000000000..4397f317b9a3
--- /dev/null
+++ b/src/main/java/org/drip/sample/triangular/StrictlyUpper.java
@@ -0,0 +1,363 @@
+
+package org.drip.sample.triangular;
+
+import java.util.Date;
+
+import org.drip.measure.crng.RandomMatrixGenerator;
+import org.drip.numerical.common.NumberUtil;
+import org.drip.numerical.linearalgebra.TriangularMatrix;
+import org.drip.service.common.FormatUtil;
+import org.drip.service.common.StringUtil;
+import org.drip.service.env.EnvManager;
+
+/*
+ * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ */
+
+/*!
+ * Copyright (C) 2025 Lakshmi Krishnamurthy
+ *
+ * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
+ * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
+ * analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
+ * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
+ * numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
+ * graph builder/navigator, and computational support.
+ *
+ * https://lakshmidrip.github.io/DROP/
+ *
+ * DROP is composed of three modules:
+ *
+ * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
+ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
+ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
+ *
+ * DROP Product Core implements libraries for the following:
+ * - Fixed Income Analytics
+ * - Loan Analytics
+ * - Transaction Cost Analytics
+ *
+ * DROP Portfolio Core implements libraries for the following:
+ * - Asset Allocation Analytics
+ * - Asset Liability Management Analytics
+ * - Capital Estimation Analytics
+ * - Exposure Analytics
+ * - Margin Analytics
+ * - XVA Analytics
+ *
+ * DROP Computational Core implements libraries for the following:
+ * - Algorithm Support
+ * - Computation Support
+ * - Function Analysis
+ * - Graph Algorithm
+ * - Model Validation
+ * - Numerical Analysis
+ * - Numerical Optimizer
+ * - Spline Builder
+ * - Statistical Learning
+ *
+ * Documentation for DROP is Spread Over:
+ *
+ * - Main => https://lakshmidrip.github.io/DROP/
+ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
+ * - GitHub => https://github.com/lakshmiDRIP/DROP
+ * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
+ * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
+ * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
+ * - Release Versions => https://lakshmidrip.github.io/DROP/version.html
+ * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
+ * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * StrictlyUpper shows the Construction, the Usage, and the Analysis of a Strictly Upper Triangular
+ * Matrix. The References are:
+ *
+ *
+ *
+ * -
+ * Axler, S. J. (1997): Linear Algebra Done Right 2nd Edition Springer
+ * New York NY
+ *
+ * -
+ * Bernstein, D. S. (2009): Matrix Mathematics: Theory, Facts, and Formulas 2nd
+ * Edition Princeton University Press Princeton NJ
+ *
+ * -
+ * Herstein, I. N. (1975): Topics in Algebra 2nd Edition Wiley New York NY
+ *
+ * -
+ * Prasolov, V. V. (1994): Topics in Algebra American Mathematical Society Providence
+ * RI
+ *
+ * -
+ * Wikipedia (2024): Triangular Matrix https://en.wikipedia.org/wiki/Triangular_matrix
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * @author Lakshmi Krishnamurthy
+ */
+
+public class StrictlyUpper
+{
+
+ private static final void Trial (
+ final int elementCount,
+ final double maximumElement)
+ throws Exception
+ {
+ TriangularMatrix strictlyUpperTriangular = RandomMatrixGenerator.StrictlyUpperTriangular (
+ elementCount,
+ maximumElement,
+ true
+ );
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println ("\t| Trial at " + new Date());
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] strictlyUpperTriangularR2Array = strictlyUpperTriangular.r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Strictly Upper Triangular " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ strictlyUpperTriangularR2Array[i],
+ 2,
+ 1,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] strictlyUpperTriangularR2ArrayTranspose = strictlyUpperTriangular.transpose().r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Transpose " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ strictlyUpperTriangularR2ArrayTranspose[i],
+ 2,
+ 1,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] baseTransposeProduct =
+ strictlyUpperTriangular.product (strictlyUpperTriangular.transpose()).r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Base Transpose Product " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ baseTransposeProduct[i],
+ 5,
+ 0,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ double[][] transposeBaseProduct =
+ strictlyUpperTriangular.transpose().product (strictlyUpperTriangular).r2Array();
+
+ for (int i = 0; i < strictlyUpperTriangularR2Array.length; ++i) {
+ System.out.println (
+ "\t| Transpose Base Product " + elementCount + " x " + elementCount + " => [" +
+ NumberUtil.ArrayRow (
+ transposeBaseProduct[i],
+ 5,
+ 0,
+ false
+ ) + " ]||"
+ );
+ }
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println (
+ "\t| Is Upper Triangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isUpper())
+ );
+
+ System.out.println (
+ "\t| Is Lower Triangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isLower())
+ );
+
+ System.out.println (
+ "\t| Is Diagonal => " +
+ StringUtil.ToString (strictlyUpperTriangular.isDiagonal())
+ );
+
+ System.out.println (
+ "\t| Is Triangularizable => " +
+ StringUtil.ToString (strictlyUpperTriangular.isTriangularizable())
+ );
+
+ System.out.println (
+ "\t| Is Unitriangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Unit Triangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isUnit())
+ );
+
+ System.out.println (
+ "\t| Is Normed Triangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isNormed())
+ );
+
+ System.out.println (
+ "\t| Is Upper Unitriangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isUpperUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Lower Unitriangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isLowerUnitriangular())
+ );
+
+ System.out.println (
+ "\t| Is Strictly Upper Triangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isStrictlyUpper())
+ );
+
+ System.out.println (
+ "\t| Is Strictly Lower Triangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isStrictlyLower())
+ );
+
+ System.out.println (
+ "\t| Is Atomic Upper Unitriangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isAtomicUpper())
+ );
+
+ System.out.println (
+ "\t| Is Atomic Lower Unitriangular => " +
+ StringUtil.ToString (strictlyUpperTriangular.isAtomicLower())
+ );
+
+ System.out.println (
+ "\t| Is Atomic => " +
+ StringUtil.ToString (strictlyUpperTriangular.isAtomic())
+ );
+
+ System.out.println (
+ "\t| Is Frobenius => " +
+ StringUtil.ToString (strictlyUpperTriangular.isFrobenius())
+ );
+
+ System.out.println (
+ "\t| Is Gauss => " +
+ StringUtil.ToString (strictlyUpperTriangular.isGauss())
+ );
+
+ System.out.println (
+ "\t| Is Gauss Transformation => " +
+ StringUtil.ToString (strictlyUpperTriangular.isGaussTransformation())
+ );
+
+ System.out.println (
+ "\t| Determinant => " +
+ FormatUtil.FormatDouble (strictlyUpperTriangular.determinant(), 8, 0, 1., false)
+ );
+
+ System.out.println (
+ "\t| Permanent => " +
+ FormatUtil.FormatDouble (strictlyUpperTriangular.permanent(), 8, 0, 1., false)
+ );
+
+ System.out.println (
+ "\t| Eigenvalue Multiplicity Map => " + strictlyUpperTriangular.eigenValueMultiplicityMap()
+ );
+
+ System.out.println (
+ "\t| Is Normal => " +
+ StringUtil.ToString (strictlyUpperTriangular.isNormal())
+ );
+
+ System.out.println (
+ "\t|----------------------------------------------------------------------------------||"
+ );
+
+ System.out.println();
+ }
+
+ /**
+ * Entry Point
+ *
+ * @param argumentArray Command Line Argument Array
+ *
+ * @throws Exception Thrown on Error/Exception Situation
+ */
+
+ public static final void main (
+ final String[] argumentArray)
+ throws Exception
+ {
+ EnvManager.InitEnv (
+ ""
+ );
+
+ int elementCount = 6;
+ double maximumElement = 99.;
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ Trial (elementCount, maximumElement);
+
+ EnvManager.TerminateEnv();
+ }
+}
diff --git a/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolver.java b/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolver.java
index cd1963cb7260..f175c80741d4 100644
--- a/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolver.java
+++ b/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolver.java
@@ -2,7 +2,7 @@
package org.drip.sample.tridiagonal;
import org.drip.numerical.common.NumberUtil;
-import org.drip.numerical.linearalgebra.StrictlyTridiagonalSolver;
+import org.drip.numerical.linearsolver.NonPeriodicTridiagonalScheme;
import org.drip.service.env.EnvManager;
/*
@@ -176,7 +176,7 @@ public static final void main (
System.out.println (
"\t| Output =>" +
NumberUtil.ArrayRow (
- new StrictlyTridiagonalSolver (tridiagonalMatrix, rhsArray).forwardSweepBackSubstitution(),
+ NonPeriodicTridiagonalScheme.Standard (tridiagonalMatrix, rhsArray).forwardSweepBackSubstitution(),
2,
4,
false
diff --git a/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolverSuite.java b/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolverSuite.java
index c7f329cf9b58..f223998fb626 100644
--- a/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolverSuite.java
+++ b/src/main/java/org/drip/sample/tridiagonal/NonPeriodicSolverSuite.java
@@ -6,7 +6,7 @@
import org.drip.measure.crng.RdRandomSequence;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.linearalgebra.MatrixUtil;
-import org.drip.numerical.linearalgebra.StrictlyTridiagonalSolver;
+import org.drip.numerical.linearsolver.NonPeriodicTridiagonalScheme;
import org.drip.service.env.EnvManager;
/*
@@ -167,7 +167,7 @@ private static final void Trial (
System.out.println (
"\t| Expected => " +
NumberUtil.ArrayRow (
- new StrictlyTridiagonalSolver (tridiagonalMatrix, rhsArray).forwardSweepBackSubstitution(),
+ NonPeriodicTridiagonalScheme.Standard (tridiagonalMatrix, rhsArray).forwardSweepBackSubstitution(),
2,
1,
false
diff --git a/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolver.java b/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolver.java
index 37956ce9cc94..12e55ec10cd2 100644
--- a/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolver.java
+++ b/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolver.java
@@ -2,7 +2,7 @@
package org.drip.sample.tridiagonal;
import org.drip.numerical.common.NumberUtil;
-import org.drip.numerical.linearalgebra.RyabenkiiTsynkovSolver;
+import org.drip.numerical.linearsolver.RyabenkiiTsynkovScheme;
import org.drip.service.env.EnvManager;
/*
@@ -153,7 +153,7 @@ public static final void main (
46.
};
- RyabenkiiTsynkovSolver ryabenkiiTsynkovSolver = new RyabenkiiTsynkovSolver (
+ RyabenkiiTsynkovScheme ryabenkiiTsynkovSolver = RyabenkiiTsynkovScheme.Standard (
periodicTridiagonalMatrix,
rhsArray
);
diff --git a/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolverSuite.java b/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolverSuite.java
index 159c6eb0d140..890068d17415 100644
--- a/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolverSuite.java
+++ b/src/main/java/org/drip/sample/tridiagonal/PeriodicRyabenkiiTsynkovSolverSuite.java
@@ -6,7 +6,7 @@
import org.drip.measure.crng.RdRandomSequence;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.linearalgebra.MatrixUtil;
-import org.drip.numerical.linearalgebra.RyabenkiiTsynkovSolver;
+import org.drip.numerical.linearsolver.RyabenkiiTsynkovScheme;
import org.drip.service.env.EnvManager;
/*
@@ -172,7 +172,7 @@ private static final void Trial (
System.out.println (
"\t| Expected => " +
NumberUtil.ArrayRow (
- new RyabenkiiTsynkovSolver (periodicTridiagonalMatrix, rhsArray).uvSolver(),
+ RyabenkiiTsynkovScheme.Standard (periodicTridiagonalMatrix, rhsArray).uvSolver(),
2,
1,
false
diff --git a/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolver.java b/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolver.java
index db45c48c6f27..b840c7660f5d 100644
--- a/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolver.java
+++ b/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolver.java
@@ -2,7 +2,7 @@
package org.drip.sample.tridiagonal;
import org.drip.numerical.common.NumberUtil;
-import org.drip.numerical.linearalgebra.ShermanMorrisonSolver;
+import org.drip.numerical.linearsolver.ShermanMorrison;
import org.drip.service.env.EnvManager;
/*
@@ -181,7 +181,7 @@ public static final void main (
System.out.println();
- ShermanMorrisonSolver shermanMorrisonSolver = ShermanMorrisonSolver.StandardBatistaKarawia (
+ ShermanMorrison shermanMorrisonSolver = ShermanMorrison.StandardBatistaKarawia (
periodicTridiagonalMatrix,
rhsArray
);
diff --git a/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolverSuite.java b/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolverSuite.java
index 8b941a9fd07d..c3b38a31ecef 100644
--- a/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolverSuite.java
+++ b/src/main/java/org/drip/sample/tridiagonal/PeriodicShermanMorrisonSolverSuite.java
@@ -6,7 +6,7 @@
import org.drip.measure.crng.RdRandomSequence;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.linearalgebra.MatrixUtil;
-import org.drip.numerical.linearalgebra.ShermanMorrisonSolver;
+import org.drip.numerical.linearsolver.ShermanMorrison;
import org.drip.service.env.EnvManager;
/*
@@ -172,7 +172,7 @@ private static final void Trial (
System.out.println (
"\t| Expected => " +
NumberUtil.ArrayRow (
- ShermanMorrisonSolver.StandardBatistaKarawia (
+ ShermanMorrison.StandardBatistaKarawia (
periodicTridiagonalMatrix,
rhsArray
).qySolver(),
diff --git a/src/main/java/org/drip/spline/pchip/MinimalQuadraticHaganWest.java b/src/main/java/org/drip/spline/pchip/MinimalQuadraticHaganWest.java
index 4b59322059cf..85eb74c7b076 100644
--- a/src/main/java/org/drip/spline/pchip/MinimalQuadraticHaganWest.java
+++ b/src/main/java/org/drip/spline/pchip/MinimalQuadraticHaganWest.java
@@ -2,8 +2,8 @@
package org.drip.spline.pchip;
import org.drip.numerical.common.NumberUtil;
-import org.drip.numerical.linearalgebra.LinearSystemSolver;
import org.drip.numerical.linearalgebra.LinearizationOutput;
+import org.drip.numerical.linearsolver.LinearSystem;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@@ -268,7 +268,7 @@ private boolean setupCoefficients()
coefficientMatrix[3 * observationCount - 1][3 * observationCount - 2] = 1.;
LinearizationOutput gaussianEliminationLinearizationOutput =
- LinearSystemSolver.SolveUsingGaussianElimination (coefficientMatrix, rhsArray);
+ LinearSystem.SolveUsingGaussianElimination (coefficientMatrix, rhsArray);
if (null == gaussianEliminationLinearizationOutput) {
return false;
diff --git a/src/main/java/org/drip/spline/segment/LatentStateResponseModel.java b/src/main/java/org/drip/spline/segment/LatentStateResponseModel.java
index df1af4f696dc..8d87de6c254e 100644
--- a/src/main/java/org/drip/spline/segment/LatentStateResponseModel.java
+++ b/src/main/java/org/drip/spline/segment/LatentStateResponseModel.java
@@ -10,8 +10,8 @@
import org.drip.numerical.differentiation.Differential;
import org.drip.numerical.differentiation.WengertJacobian;
import org.drip.numerical.integration.R1ToR1Integrator;
-import org.drip.numerical.linearalgebra.LinearSystemSolver;
import org.drip.numerical.linearalgebra.LinearizationOutput;
+import org.drip.numerical.linearsolver.LinearSystem;
import org.drip.service.common.CollectionUtil;
import org.drip.spline.basis.FunctionSet;
import org.drip.spline.params.PreceedingManifestSensitivityControl;
@@ -583,7 +583,7 @@ public boolean calibrateState (
return false;
}
- LinearizationOutput linearizationOutput = LinearSystemSolver.SolveUsingMatrixInversion (
+ LinearizationOutput linearizationOutput = LinearSystem.SolveUsingMatrixInversion (
responseBasisCoefficientConstraintMatrix,
predictorResponseConstraintValueArray
);
@@ -785,7 +785,7 @@ public double[] calibrateManifestJacobian (
return null;
}
- LinearizationOutput linearizationOutput = LinearSystemSolver.SolveUsingMatrixInversion (
+ LinearizationOutput linearizationOutput = LinearSystem.SolveUsingMatrixInversion (
responseCoefficientConstraintManifestSensitivityMatrix,
predictorResponseManifestSensitivityConstraintArray
);