Class LagrangeMultipliersNaiveKraus
java.lang.Object
com.polytechnik.kgo.LagrangeMultipliersNaiveKraus
A class to handle Lagrange multipliers for Kraus operators,
a direct sum of an arbitray
nS
vectors \( b_{s,jk} \).
Does not converge well.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Store linear system coefficeints. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double[]
private final LagrangeMultipliersNaiveKraus.LinearSystemCoefficients
For unit test.final double[]
private final double[]
Linear system solution for unit test. -
Constructor Summary
ConstructorsConstructorDescriptionLagrangeMultipliersNaiveKraus
(double[] nu, double[] lambda, LagrangeMultipliersNaiveKraus.LinearSystemCoefficients ls, double[] sol) -
Method Summary
Modifier and TypeMethodDescriptionprivate static double[]
getBBmatrCalculatedDirectly
(double[] b, int nS, int nC, int nX) For unit test.getLagrangeMultipliers
(int nS, int nC, int nX, double[] SK, double[] b) (package private) static double[]
getLambdaAsMatrix
(int nC, double[] vecLambda) Unvectorize lambda.private static double[]
getNuAsMatrix
(int nS, double[] vecNu) Unvectorize nu.private static double[]
getVecFromLM
(double[] b, int nS, int nC, int nX, double[] nu, double[] lambda) For unit test.static void
A unit test.(package private) static void
runMultiTest
(String name, int nTest, Random r, double eps) (package private) static void
One solution test.
-
Field Details
-
nu
public final double[] nu -
lambda
public final double[] lambda -
ls
For unit test. -
sol
private final double[] solLinear system solution for unit test.
-
-
Constructor Details
-
LagrangeMultipliersNaiveKraus
LagrangeMultipliersNaiveKraus(double[] nu, double[] lambda, LagrangeMultipliersNaiveKraus.LinearSystemCoefficients ls, double[] sol)
-
-
Method Details
-
getLagrangeMultipliers
public static LagrangeMultipliersNaiveKraus getLagrangeMultipliers(int nS, int nC, int nX, double[] SK, double[] b) -
getLambdaAsMatrix
static double[] getLambdaAsMatrix(int nC, double[] vecLambda) Unvectorize lambda. -
getNuAsMatrix
private static double[] getNuAsMatrix(int nS, double[] vecNu) Unvectorize nu. -
getVecFromLM
private static double[] getVecFromLM(double[] b, int nS, int nC, int nX, double[] nu, double[] lambda) For unit test. -
getBBmatrCalculatedDirectly
private static double[] getBBmatrCalculatedDirectly(double[] b, int nS, int nC, int nX) For unit test. -
testBasic
One solution test. -
runMultiTest
-
main
A unit test.
-