MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _createDepVarIndex

Function _createDepVarIndex

SLiCAP/SLiCAPmatrices.py:85–102  ·  view source on GitHub ↗

Creates an index dict for the dependent variables, this easies the construction of the matrix. :param circuitObject: Circuit object to be updated :type circuitObject: SLiCAPprotos.circuit :return: SLiCAP circuit object :rtype: SLiCAP circuit object

(circuitObject)

Source from the content-addressed store, hash-verified

83
84
85def _createDepVarIndex(circuitObject):
86 """
87 Creates an index dict for the dependent variables, this easies the
88 construction of the matrix.
89
90 :param circuitObject: Circuit object to be updated
91 :type circuitObject: SLiCAPprotos.circuit
92
93 :return: SLiCAP circuit object
94 :rtype: SLiCAP circuit object
95 """
96 varIndex = {}
97 for i in range(len(circuitObject.dep_vars)):
98 if circuitObject.dep_vars[i][0:2] == 'V_':
99 varIndex[circuitObject.dep_vars[i][2:]] = i
100 else:
101 varIndex[circuitObject.dep_vars[i]] = i
102 return varIndex
103
104
105def _makeMatrices(instr):

Callers 2

_makeMatricesFunction · 0.85
_makeSrcVectorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected