JITCMatrix#
- class brainevent.JITCMatrix(*args, shape, buffers=None)#
Just-in-time Connectivity (JITC) matrix.
A base class for just-in-time connectivity matrices that inherits from the SparseMatrix class in the
brainunitlibrary. This class serves as an abstraction for sparse matrices that are generated or computed on demand rather than stored in full.JITC matrices are particularly useful in neural network simulations where connectivity patterns might be large but follow specific patterns that can be efficiently computed rather than explicitly stored in memory.
Notes
This is a base class and should be subclassed for specific implementations of JITC matrices. All attributes from
brainunit.sparse.SparseMatrixare inherited.- apply(fn)[source]#
Apply a function to matrix value parameters while keeping structure.
- Parameters:
fn (callable) – Unary callable applied by subclasses to their value parameters.
- Returns:
A new matrix-like object with transformed values.
- Return type:
- apply2(other, fn, *, reverse=False)[source]#
Apply a binary function with consistent sparse-matrix semantics.
- Parameters:
other (Any) – Right-hand operand for normal operations, or left-hand operand when
reverse=True.fn (callable) – Binary function from
operatoror a compatible callable.reverse (
bool) – If False, computefn(self, other)via_binary_op. If True, computefn(other, self)via_binary_rop. Defaults to False.
- Returns:
Result of the operation.
- Return type:
JITCMatrix or Any