Skip to content

Commit 84488a4

Browse files
committed
adds constant matrix operator
1 parent 47aa23f commit 84488a4

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

fredipy/operators.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import TYPE_CHECKING, Callable
33
if TYPE_CHECKING:
44
from .integrators import Integrator
5+
import numpy as np
56

67

78
class Operator:
@@ -20,12 +21,22 @@ class Identity(Operator):
2021
pass
2122

2223

24+
class ConstMatrix(Operator):
25+
def __init__(
26+
self,
27+
mat: np.ndarray):
28+
self.mat = mat
29+
30+
def make(self, *args):
31+
return self.mat
32+
33+
2334
class Integral(Operator):
2435
'''Wrapper for integration constraints.
2536
2637
Parameters
2738
----------
28-
func : kernel function of the integrations.
39+
func : kernel function of the integrations
2940
integrator : defines the integration routine, see Integrator class.
3041
'''
3142
def __init__(

0 commit comments

Comments
 (0)