Skip to content

Commit 876d6fb

Browse files
author
niharika2999
committed
Adding the Trace(R) calculation
1 parent 7d75143 commit 876d6fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pysensors/optimizers/_gqr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(self,idx_constrained,n_sensors,const_sensors,all_sensors):
4141
Total number of sensors required by the user in the constrained region.
4242
"""
4343
self.pivots_ = None
44+
self.optimality = None
4445
self.constrainedIndices = idx_constrained
4546
self.nSensors = n_sensors
4647
self.nConstrainedSensors = const_sensors
@@ -112,7 +113,8 @@ def fit(
112113
R[j + 1 :, j] = 0
113114

114115
self.pivots_ = p
115-
116+
self.optimality = np.trace(np.real(R))
117+
print("The trace(R) = {}".format(self.optimality))
116118

117119
return self
118120

0 commit comments

Comments
 (0)