Skip to content

Commit 76d7eff

Browse files
committed
Features:
- C1 Square PhiAB A (1, 2) - C1 Square PhiAB B (3, 4) - C1 Square PhiAB Phi (5, 6) - C1 Square PhiAB Standard #1 (7, 8, 9) - C1 Square PhiAB Standard #2 (10, 11, 12) - C1 Cartesian Unit Real Standard (13, 14, 15) - C1 Cartesian Unit Imaginary Standard (16, 17, 18) - C1 Numerical Complex Cartesian Conjugate (19, 20, 21) - C1 Numerical Complex Cartesian Determinant (22, 23, 24) - Indicate if C1Square is Unitary (25, 26) - C1 Cartesian Phi Alpha Beta Theta Shell (27, 28, 29) - C1 Cartesian Phi Alpha Beta Theta #1 (30, 31) - C1 Cartesian Phi Alpha Beta Theta #2 (32, 33) - C1 Cartesian Phi Alpha Beta Theta #3 (34, 35) - C1 Cartesian Phi Alpha Beta Theta #4 (36, 37) - C1 Cartesian Phi Alpha Beta Theta Constructor (38, 39, 40) - C1 Cartesian Phi Alpha Beta Theta Standard #1 (41, 42, 43) - C1 Cartesian Phi Alpha Beta Theta Standard #2 (44, 45, 46) - C1 Cartesian Phi Alpha Beta Theta A (47, 48, 49) - C1 Cartesian Phi Alpha Beta Theta B (50, 51, 52) - C1 Cartesian Phi Alpha Beta Theta #5 (53, 54) - C1 Cartesian Phi Psi Theta Delta Shell (55, 56, 57) - C1 Cartesian Phi Psi Theta Delta Jordan Normal Left (58, 59) - C1 Cartesian Phi Psi Theta Delta Jordan Normal Right (60, 61) - C1 Cartesian Phi Psi Theta Delta Jordan Normal Center (62, 63) - C1 Cartesian Phi Psi Theta Delta #1 (64, 65) - C1 Cartesian Phi Psi Theta Delta #2 (66, 67) - C1 Cartesian Phi Psi Theta Delta #3 (68, 69) - C1 Cartesian Phi Psi Theta Delta #4 (70, 71) - C1 Cartesian Phi Psi Theta Delta Constructor #1 (72, 73) - C1 Cartesian Phi Psi Theta Delta Constructor #2 (74, 75) - C1 Cartesian Phi Psi Theta Delta #5 (76, 77, 78) - R1 Rotation 2x2 Shell Annotation (79, 80, 81) - R1 Square Rotation 2x2 Theta (82, 83, 84) - R1 Square Rotation 2x2 Constructor (85, 86, 87) - R1 Square Rotation 2x2 Standard #1 (88, 89) - R1 Square Rotation 2x2 Standard #2 (90, 91) - R1 Square Rotation 2x2 Standard #3 (92, 93) - C1 Square Rotation 2x2 #1 (94, 95, 96) - C1 Square Rotation 2x2 #2 (97, 98) - C1 R1 Matrix Product #1 (99, 100, 101) - C1 R1 Matrix Product #2 (102, 103, 104) - C1 R1 Matrix Product #3 (105, 106, 107) - C1 Grid of Complex Numbers (108, 109) - C1 Util Is Grid Valid (110, 111, 112) - C1 Util Is Vector Valid (113, 114, 115) - C1 Util/Vector/Grid Validity (116, 117) - Number Util Is Grid Valid (118, 119, 120) Bug Fixes/Re-organization: Samples: IdeaDRIP:
1 parent 137ad62 commit 76d7eff

10 files changed

+1057
-13
lines changed

ReleaseNotes/03_17_2024.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
Features:
3+
4+
- C1 Square PhiAB A (1, 2)
5+
- C1 Square PhiAB B (3, 4)
6+
- C1 Square PhiAB Phi (5, 6)
7+
- C1 Square PhiAB Standard #1 (7, 8, 9)
8+
- C1 Square PhiAB Standard #2 (10, 11, 12)
9+
- C1 Cartesian Unit Real Standard (13, 14, 15)
10+
- C1 Cartesian Unit Imaginary Standard (16, 17, 18)
11+
- C1 Numerical Complex Cartesian Conjugate (19, 20, 21)
12+
- C1 Numerical Complex Cartesian Determinant (22, 23, 24)
13+
- Indicate if C1Square is Unitary (25, 26)
14+
- C1 Cartesian Phi Alpha Beta Theta Shell (27, 28, 29)
15+
- C1 Cartesian Phi Alpha Beta Theta #1 (30, 31)
16+
- C1 Cartesian Phi Alpha Beta Theta #2 (32, 33)
17+
- C1 Cartesian Phi Alpha Beta Theta #3 (34, 35)
18+
- C1 Cartesian Phi Alpha Beta Theta #4 (36, 37)
19+
- C1 Cartesian Phi Alpha Beta Theta Constructor (38, 39, 40)
20+
- C1 Cartesian Phi Alpha Beta Theta Standard #1 (41, 42, 43)
21+
- C1 Cartesian Phi Alpha Beta Theta Standard #2 (44, 45, 46)
22+
- C1 Cartesian Phi Alpha Beta Theta A (47, 48, 49)
23+
- C1 Cartesian Phi Alpha Beta Theta B (50, 51, 52)
24+
- C1 Cartesian Phi Alpha Beta Theta #5 (53, 54)
25+
- C1 Cartesian Phi Psi Theta Delta Shell (55, 56, 57)
26+
- C1 Cartesian Phi Psi Theta Delta Jordan Normal Left (58, 59)
27+
- C1 Cartesian Phi Psi Theta Delta Jordan Normal Right (60, 61)
28+
- C1 Cartesian Phi Psi Theta Delta Jordan Normal Center (62, 63)
29+
- C1 Cartesian Phi Psi Theta Delta #1 (64, 65)
30+
- C1 Cartesian Phi Psi Theta Delta #2 (66, 67)
31+
- C1 Cartesian Phi Psi Theta Delta #3 (68, 69)
32+
- C1 Cartesian Phi Psi Theta Delta #4 (70, 71)
33+
- C1 Cartesian Phi Psi Theta Delta Constructor #1 (72, 73)
34+
- C1 Cartesian Phi Psi Theta Delta Constructor #2 (74, 75)
35+
- C1 Cartesian Phi Psi Theta Delta #5 (76, 77, 78)
36+
- R1 Rotation 2x2 Shell Annotation (79, 80, 81)
37+
- R1 Square Rotation 2x2 Theta (82, 83, 84)
38+
- R1 Square Rotation 2x2 Constructor (85, 86, 87)
39+
- R1 Square Rotation 2x2 Standard #1 (88, 89)
40+
- R1 Square Rotation 2x2 Standard #2 (90, 91)
41+
- R1 Square Rotation 2x2 Standard #3 (92, 93)
42+
- C1 Square Rotation 2x2 #1 (94, 95, 96)
43+
- C1 Square Rotation 2x2 #2 (97, 98)
44+
- C1 R1 Matrix Product #1 (99, 100, 101)
45+
- C1 R1 Matrix Product #2 (102, 103, 104)
46+
- C1 R1 Matrix Product #3 (105, 106, 107)
47+
- C1 Grid of Complex Numbers (108, 109)
48+
- C1 Util Is Grid Valid (110, 111, 112)
49+
- C1 Util Is Vector Valid (113, 114, 115)
50+
- C1 Util/Vector/Grid Validity (116, 117)
51+
- Number Util Is Grid Valid (118, 119, 120)
52+
53+
54+
Bug Fixes/Re-organization:
55+
56+
Samples:
57+
58+
IdeaDRIP:

src/main/java/org/drip/numerical/common/NumberUtil.java

+22
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,28 @@ public static final boolean IsValid (
549549
return true;
550550
}
551551

552+
/**
553+
* Checks if the Input Matrix contains an Infinite or an NaN
554+
*
555+
* @param r1Grid Input Matrix
556+
*
557+
* @return TRUE - Input Matrix contains an Infinite or an NaN
558+
*/
559+
560+
public static final boolean IsValid (
561+
final double[][] r1Grid)
562+
{
563+
if (null == r1Grid) {
564+
return true;
565+
}
566+
567+
for (int i = 0; i < r1Grid.length; ++i) {
568+
if (!IsValid (r1Grid[i])) return false;
569+
}
570+
571+
return true;
572+
}
573+
552574
/**
553575
* Compare and checks if the two input numbers fall within a specified tolerance
554576
*

src/main/java/org/drip/numerical/complex/C1Cartesian.java

+51
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,40 @@ public static final C1Cartesian Zero()
145145
return null;
146146
}
147147

148+
/**
149+
* Construct a Unit Real Complex Number
150+
*
151+
* @return Unit Real Complex Number
152+
*/
153+
154+
public static final C1Cartesian UnitReal()
155+
{
156+
try {
157+
new C1Cartesian (1., 0.);
158+
} catch (Exception e) {
159+
e.printStackTrace();
160+
}
161+
162+
return null;
163+
}
164+
165+
/**
166+
* Construct a Unit Imaginary Complex Number
167+
*
168+
* @return Unit Imaginary Complex Number
169+
*/
170+
171+
public static final C1Cartesian UnitImaginary()
172+
{
173+
try {
174+
new C1Cartesian (0., 1.);
175+
} catch (Exception e) {
176+
e.printStackTrace();
177+
}
178+
179+
return null;
180+
}
181+
148182
/**
149183
* CartesianComplexNumber constructor
150184
*
@@ -379,6 +413,23 @@ public double dotProduct (
379413
return C1Util.UnsafeDotProduct (this, other);
380414
}
381415

416+
/**
417+
* Compute Conjugate of the Complex Number
418+
*
419+
* @return The Complex Number Conjugate Instance
420+
*/
421+
422+
public C1Cartesian conjugate()
423+
{
424+
try {
425+
return new C1Cartesian (_real, -1. * _imaginary);
426+
} catch (Exception e) {
427+
e.printStackTrace();
428+
}
429+
430+
return null;
431+
}
432+
382433
/**
383434
* Display the Real/Imaginary Contents
384435
*

src/main/java/org/drip/numerical/complex/C1CartesianPhiAB.java

+49-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
package org.drip.numerical.complex;
33

4+
import org.drip.numerical.common.NumberUtil;
5+
46
/*
57
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
68
*/
@@ -74,8 +76,8 @@
7476
*/
7577

7678
/**
77-
* <i>C1CartesianPhiAB</i> implements the type and Functionality associated with a C<sup>1</sup>Square Matrix
78-
* parameterized by <code>a</code>, <code>b</code>, and <code>phi</code> Fields. The References are:
79+
* <i>C1CartesianPhiAB</i> implements the type and Functionality associated with a C<sup>1</sup> Square
80+
* Matrix parameterized by <code>a</code>, <code>b</code>, and <code>phi</code> Fields. The References are:
7981
*
8082
* <br><br>
8183
* <ul>
@@ -118,6 +120,40 @@ public class C1CartesianPhiAB extends C1Square
118120
private C1Cartesian _b = null;
119121
private double _phi = Double.NaN;
120122

123+
/**
124+
* Construct a Standard Instance of <i>C1CartesianPhiAB</i>
125+
*
126+
* @param a "A"
127+
* @param b "B"
128+
* @param phi "Phi"
129+
*
130+
* @return <i>C1CartesianPhiAB</i> Instance
131+
*/
132+
133+
public static C1CartesianPhiAB Standard (
134+
final C1Cartesian a,
135+
final C1Cartesian b,
136+
final double phi)
137+
{
138+
if (null == a || null == b || !NumberUtil.IsValid (phi) ||
139+
NumberUtil.WithinTolerance (a.square().modulus() + b.square().modulus(), 1.))
140+
{
141+
return null;
142+
}
143+
144+
C1Cartesian ePowerIPhi = C1Cartesian.UnitImaginary().scale (phi).exponentiate();
145+
146+
C1Cartesian[][] c1Grid = new C1Cartesian[2][2];
147+
c1Grid[0][1] = b;
148+
c1Grid[0][0] = a;
149+
150+
c1Grid[1][1] = ePowerIPhi.product (a.conjugate());
151+
152+
c1Grid[1][0] = ePowerIPhi.product (b.conjugate()).scale (-1.);
153+
154+
return new C1CartesianPhiAB (c1Grid, a, b, phi);
155+
}
156+
121157
private C1CartesianPhiAB (
122158
final C1Cartesian[][] c1Grid,
123159
final C1Cartesian a,
@@ -163,4 +199,15 @@ public double phi()
163199
{
164200
return _phi;
165201
}
202+
203+
/**
204+
* Retrieve the Determinant
205+
*
206+
* @return The Determinant
207+
*/
208+
209+
@Override public double determinant()
210+
{
211+
return C1Cartesian.UnitImaginary().scale (_phi).l2Norm();
212+
}
166213
}

0 commit comments

Comments
 (0)