Class SOCPPortfolioProblem
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.SOCPDualProblem
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.SOCPGeneralProblem
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioProblem
-
- All Implemented Interfaces:
ConstrainedOptimProblem
,OptimProblem
public class SOCPPortfolioProblem extends SOCPGeneralProblem
Constructs an SOCP problem for portfolio optimization.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.SOCPDualProblem
SOCPDualProblem.EqualityConstraints
-
-
Constructor Summary
Constructors Constructor Description SOCPPortfolioProblem(SOCPPortfolioObjectiveFunction f, SOCPPortfolioConstraint[] constraints)
Constructs an SOCP problem for portfolio optimization.SOCPPortfolioProblem(SOCPPortfolioObjectiveFunction f, Collection<SOCPPortfolioConstraint> constraints)
Constructs an SOCP problem for portfolio optimization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areAllConstraintsSatisfied(Vector x)
Checks whether the constraints are satisfied with a solution vector x.int
dimensionOfDomain()
Gets the dimension of the original (unstacked) problem.List<SOCPPortfolioConstraint>
getPortfolioConstraints()
Gets the portfolio constraints.Map<SOCPPortfolioConstraint.Variable,Integer>
getVariables()
Get the list of all variables and their beginning indices starting from 0.-
Methods inherited from class dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.SOCPDualProblem
A, A, b, c, c, dimension, f, getEqualityConstraints, getLessThanConstraints, m, n, q
-
-
-
-
Constructor Detail
-
SOCPPortfolioProblem
public SOCPPortfolioProblem(SOCPPortfolioObjectiveFunction f, SOCPPortfolioConstraint[] constraints)
Constructs an SOCP problem for portfolio optimization.- Parameters:
f
- the objective functionconstraints
- the portfolio constraints
-
SOCPPortfolioProblem
public SOCPPortfolioProblem(SOCPPortfolioObjectiveFunction f, Collection<SOCPPortfolioConstraint> constraints)
Constructs an SOCP problem for portfolio optimization.- Parameters:
f
- the objective functionconstraints
- the portfolio constraints
-
-
Method Detail
-
getPortfolioConstraints
public List<SOCPPortfolioConstraint> getPortfolioConstraints()
Gets the portfolio constraints.- Returns:
- the portfolio constraints
-
dimensionOfDomain
public int dimensionOfDomain()
Gets the dimension of the original (unstacked) problem.- Returns:
- the dimension of the original (unstacked) problem
-
getVariables
public Map<SOCPPortfolioConstraint.Variable,Integer> getVariables()
Get the list of all variables and their beginning indices starting from 0.- Returns:
- the list of all variables and their beginning indices
-
areAllConstraintsSatisfied
public boolean areAllConstraintsSatisfied(Vector x) throws SOCPPortfolioConstraint.ConstraintViolationException
Checks whether the constraints are satisfied with a solution vector x.- Parameters:
x
- a solution vector; the optimal portfolio weights- Returns:
true
if and only if all constraints are satisfied- Throws:
dev.nm.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint.ConstraintViolationException
SOCPPortfolioConstraint.ConstraintViolationException
-
-