()
| 16 | * Negates the multiplicities in the input stream |
| 17 | */ |
| 18 | export function negate<T>(): PipedOperator<T, T> { |
| 19 | return (stream: IStreamBuilder<T>): IStreamBuilder<T> => { |
| 20 | const output = new StreamBuilder<T>( |
| 21 | stream.graph, |
| 22 | new DifferenceStreamWriter<T>(), |
| 23 | ) |
| 24 | const operator = new NegateOperator<T>( |
| 25 | stream.graph.getNextOperatorId(), |
| 26 | stream.connectReader(), |
| 27 | output.writer, |
| 28 | ) |
| 29 | stream.graph.addOperator(operator) |
| 30 | return output |
| 31 | } |
| 32 | } |
no test coverage detected