-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Square Matrix is Triangularizable (1, 2) - Numerical R^1 -> R^1 Eigenvalue Characteristic Polynomial (3, 4, 5) - Square Matrix Eigenvalue Characteristic Polynomial (6, 7, 8) - Triangular Matrix Remove R2 Array (9, 10) - Triangular Matrix Zero Diagonal Entries (13, 14) - Triangular Matrix Is Uni Check (15, 16) - Triangular Matrix Is Triangularizable Check (19, 20) - Triangular Matrix Determinant and Permanent (21, 22) - Square Matrix Triangular Entries #1 (23, 24) - Square Matrix Triangular Entries #2 (25, 26) - Triangular Matrix Eigenvalue Multiplicity Map (27, 28, 29) - Triangular Matrix Eigenvalue Characteristic Polynomial (30, 31, 32) - Triangular Matrix Is Unit Check (33, 34) - Triangular Matrix Is Normed Check (35, 36) - Triangular Matrix Is Upper Unitriangular (37, 38) - Triangular Matrix Is Lower Unitriangular (39, 40) - Triangular Matrix Atomic Lower #1 (41, 42) - Triangular Matrix Atomic Lower #2 (43, 44) - Triangular Matrix Atomic Lower #3 (45, 46) - Triangular Matrix Atomic Upper #1 (47, 48) - Triangular Matrix Atomic Upper #2 (49, 50) - Triangular Matrix Is Atomic Unitriangular (51, 52) - Triangular Matrix Is Frobenius Unitriangular (53, 54) - Triangular Matrix Is Gauss Unitriangular (55, 56) - Triangular Matrix Gauss Transformation Unitriangular (57, 58) - Linear Algebra Triangular Matrix Constructor (59, 60) - Linear Algebra Triangular Matrix Standard (61, 62, 63) - Linear Algebra Triangular Matrix Type (64) - CRNG Random Matrix Generator Shell (65, 66) - Random Matrix Generator Upper Triangular (67, 68, 69) - Random Matrix Generator Lower Triangular (70, 71, 72) Bug Fixes/Re-organization: - Linear Algebra Triangular Matrix Revamp (11, 12) - Triangular Matrix Determinant/Permanent Revamp (17, 18) - Triangular Matrix Variants and Solutions (73, 74) Samples: - Lower Triangular Matrix Shell #1 (75, 76) - Lower Triangular Matrix Shell #2 (77, 78) - Lower Triangular Matrix Shell #3 (79, 80, 81) - Lower Triangular Matrix Shell #4 (82, 83, 84) - Lower Triangular Matrix Shell #5 (85, 86, 87) - Lower Triangular Matrix Shell #6 (88, 89, 90) - Lower Triangular Matrix Shell #7 (91, 92, 93) - Lower Triangular Matrix Shell #8 (94, 95, 96) - Lower Triangular Matrix Shell #9 (97, 98, 99) - Lower Triangular Matrix Shell #10 (100, 101, 102) - Lower Triangular Matrix Shell #11 (103, 104, 105) - Lower Triangular Matrix Shell #12 (106, 107, 108) - Lower Triangular Matrix Shell #13 (109, 110, 111) - Lower Triangular Matrix Shell #14 (112, 113, 114) - Lower Triangular Matrix Shell #15 (115, 116, 117) - Lower Triangular Matrix Shell #16 (118, 119, 120) IdeaDRIP:
- Loading branch information
Showing
8 changed files
with
852 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
Features: | ||
|
||
- Square Matrix is Triangularizable (1, 2) | ||
- Numerical R^1 -> R^1 Eigenvalue Characteristic Polynomial (3, 4, 5) | ||
- Square Matrix Eigenvalue Characteristic Polynomial (6, 7, 8) | ||
- Triangular Matrix Remove R2 Array (9, 10) | ||
- Triangular Matrix Zero Diagonal Entries (13, 14) | ||
- Triangular Matrix Is Uni Check (15, 16) | ||
- Triangular Matrix Is Triangularizable Check (19, 20) | ||
- Triangular Matrix Determinant and Permanent (21, 22) | ||
- Square Matrix Triangular Entries #1 (23, 24) | ||
- Square Matrix Triangular Entries #2 (25, 26) | ||
- Triangular Matrix Eigenvalue Multiplicity Map (27, 28, 29) | ||
- Triangular Matrix Eigenvalue Characteristic Polynomial (30, 31, 32) | ||
- Triangular Matrix Is Unit Check (33, 34) | ||
- Triangular Matrix Is Normed Check (35, 36) | ||
- Triangular Matrix Is Upper Unitriangular (37, 38) | ||
- Triangular Matrix Is Lower Unitriangular (39, 40) | ||
- Triangular Matrix Atomic Lower #1 (41, 42) | ||
- Triangular Matrix Atomic Lower #2 (43, 44) | ||
- Triangular Matrix Atomic Lower #3 (45, 46) | ||
- Triangular Matrix Atomic Upper #1 (47, 48) | ||
- Triangular Matrix Atomic Upper #2 (49, 50) | ||
- Triangular Matrix Is Atomic Unitriangular (51, 52) | ||
- Triangular Matrix Is Frobenius Unitriangular (53, 54) | ||
- Triangular Matrix Is Gauss Unitriangular (55, 56) | ||
- Triangular Matrix Gauss Transformation Unitriangular (57, 58) | ||
- Linear Algebra Triangular Matrix Constructor (59, 60) | ||
- Linear Algebra Triangular Matrix Standard (61, 62, 63) | ||
- Linear Algebra Triangular Matrix Type (64) | ||
- CRNG Random Matrix Generator Shell (65, 66) | ||
- Random Matrix Generator Upper Triangular (67, 68, 69) | ||
- Random Matrix Generator Lower Triangular (70, 71, 72) | ||
|
||
|
||
Bug Fixes/Re-organization: | ||
|
||
- Linear Algebra Triangular Matrix Revamp (11, 12) | ||
- Triangular Matrix Determinant/Permanent Revamp (17, 18) | ||
- Triangular Matrix Variants and Solutions (73, 74) | ||
|
||
|
||
Samples: | ||
|
||
- Lower Triangular Matrix Shell #1 (75, 76) | ||
- Lower Triangular Matrix Shell #2 (77, 78) | ||
- Lower Triangular Matrix Shell #3 (79, 80, 81) | ||
- Lower Triangular Matrix Shell #4 (82, 83, 84) | ||
- Lower Triangular Matrix Shell #5 (85, 86, 87) | ||
- Lower Triangular Matrix Shell #6 (88, 89, 90) | ||
- Lower Triangular Matrix Shell #7 (91, 92, 93) | ||
- Lower Triangular Matrix Shell #8 (94, 95, 96) | ||
- Lower Triangular Matrix Shell #9 (97, 98, 99) | ||
- Lower Triangular Matrix Shell #10 (100, 101, 102) | ||
- Lower Triangular Matrix Shell #11 (103, 104, 105) | ||
- Lower Triangular Matrix Shell #12 (106, 107, 108) | ||
- Lower Triangular Matrix Shell #13 (109, 110, 111) | ||
- Lower Triangular Matrix Shell #14 (112, 113, 114) | ||
- Lower Triangular Matrix Shell #15 (115, 116, 117) | ||
- Lower Triangular Matrix Shell #16 (118, 119, 120) | ||
|
||
|
||
IdeaDRIP: |
170 changes: 170 additions & 0 deletions
170
src/main/java/org/drip/measure/crng/RandomMatrixGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
|
||
package org.drip.measure.crng; | ||
|
||
import org.drip.numerical.linearalgebra.TriangularMatrix; | ||
|
||
/* | ||
* -*- 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. | ||
*/ | ||
|
||
/** | ||
* <i>RandomMatrixGenerator</i> provides Functionality for generating different Kinds of Random Matrices. The | ||
* References are: | ||
* | ||
* <br><br> | ||
* <ul> | ||
* <li> | ||
* Axler, S. J. (1997): <i>Linear Algebra Done Right 2<sup>nd</sup> Edition</i> <b>Springer</b> | ||
* New York NY | ||
* </li> | ||
* <li> | ||
* Bernstein, D. S. (2009): <i>Matrix Mathematics: Theory, Facts, and Formulas 2<sup>nd</sup> | ||
* Edition</i> <b>Princeton University Press</b> Princeton NJ | ||
* </li> | ||
* <li> | ||
* Herstein, I. N. (1975): <i>Topics in Algebra 2<sup>nd</sup> Edition</i> <b>Wiley</b> New York NY | ||
* </li> | ||
* <li> | ||
* Prasolov, V. V. (1994): <i>Topics in Algebra</i> <b>American Mathematical Society</b> Providence | ||
* RI | ||
* </li> | ||
* <li> | ||
* Wikipedia (2024): Triangular Matrix https://en.wikipedia.org/wiki/Triangular_matrix | ||
* </li> | ||
* </ul> | ||
* | ||
* <br><br> | ||
* <ul> | ||
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li> | ||
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/NumericalAnalysisLibrary.md">Numerical Analysis Library</a></li> | ||
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/numerical/README.md">Numerical Quadrature, Differentiation, Eigenization, Linear Algebra, and Utilities</a></li> | ||
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/numerical/linearalgebra/README.md">Linear Algebra Matrix Transform Library</a></li> | ||
* </ul> | ||
* <br><br> | ||
* | ||
* @author Lakshmi Krishnamurthy | ||
*/ | ||
|
||
public class RandomMatrixGenerator | ||
{ | ||
|
||
/** | ||
* Construct a 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 Lower Triangular Matrix of Random Elements up to the Maximum Value | ||
*/ | ||
|
||
public static final TriangularMatrix LowerTriangular ( | ||
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 = i + 1; j < r2Array.length; ++j) { | ||
r2Array[i][j] = 0.; | ||
} | ||
} | ||
|
||
return TriangularMatrix.Standard (r2Array); | ||
} | ||
|
||
/** | ||
* Construct an 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 Upper Triangular Matrix of Random Elements up to the Maximum Value | ||
*/ | ||
|
||
public static final TriangularMatrix UpperTriangular ( | ||
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 < i; ++j) { | ||
r2Array[i][j] = 0.; | ||
} | ||
} | ||
|
||
return TriangularMatrix.Standard (r2Array); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.