Skip to content

Commit 07797aa

Browse files
authored
Merge pull request #215 from cvxgrp/refactor
cached property
2 parents d072154 + 8b96752 commit 07797aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cvx/cla/cla.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import logging
2424
from dataclasses import dataclass, field
25+
from functools import cached_property
2526
from typing import List, Optional
2627

2728
import numpy as np
@@ -66,7 +67,7 @@ class CLA:
6667
tol: float = 1e-5
6768
logger: logging.Logger = logging.getLogger(__name__)
6869

69-
@property
70+
@cached_property
7071
def P(self):
7172
"""
7273
Construct the projection matrix used in computing Lagrange multipliers.
@@ -80,7 +81,7 @@ def P(self):
8081
"""
8182
return np.block([self.covariance, self.A.T])
8283

83-
@property
84+
@cached_property
8485
def M(self):
8586
"""
8687
Construct the Karush-Kuhn-Tucker (KKT) system matrix.

0 commit comments

Comments
 (0)