How to use the diffcp.cones.psd_dim function in diffcp

To help you get started, we’ve selected a few diffcp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cvxgrp / diffcp / tests.py View on Github external
def test_psd_dim(self):
        n = 4096
        self.assertEqual(cone_lib.psd_dim(cone_lib.vec_psd_dim(n)), n)
github cvxgrp / diffcp / tests.py View on Github external
def test_dproj_psd(self):
        np.random.seed(0)
        for _ in range(10):
            # n=55 equals k * (k + 1) / 2
            self._test_dproj(
                Cone(ConeType.PSD, [cone_lib.psd_dim(55)]), True, 55)
            self._test_dproj(
                Cone(ConeType.PSD, [cone_lib.psd_dim(55)]), False, 55)