src/linops.rs

branch
dev
changeset 101
997961aa6eee
parent 99
9e5b9fc81c52
child 104
e7f1cb4bec78
equal deleted inserted replaced
100:411c6be29fe5 101:997961aa6eee
355 self.outer.opnorm_bound(zexp, yexp) * self.inner.opnorm_bound(xexp, zexp) 355 self.outer.opnorm_bound(zexp, yexp) * self.inner.opnorm_bound(xexp, zexp)
356 } 356 }
357 } 357 }
358 358
359 /// “Row operator” $(S, T)$; $(S, T)(x, y)=Sx + Ty$. 359 /// “Row operator” $(S, T)$; $(S, T)(x, y)=Sx + Ty$.
360 #[derive(Clone, Copy, Debug, Serialize, Eq, PartialEq)]
360 pub struct RowOp<S, T>(pub S, pub T); 361 pub struct RowOp<S, T>(pub S, pub T);
361 362
362 use std::ops::Add; 363 use std::ops::Add;
363 364
364 impl<A, B, S, T> Mapping<Pair<A, B>> for RowOp<S, T> 365 impl<A, B, S, T> Mapping<Pair<A, B>> for RowOp<S, T>
417 self.1.apply_add(y, v); 418 self.1.apply_add(y, v);
418 } 419 }
419 } 420 }
420 421
421 /// “Column operator” $(S; T)$; $(S; T)x=(Sx, Tx)$. 422 /// “Column operator” $(S; T)$; $(S; T)x=(Sx, Tx)$.
423 #[derive(Clone, Copy, Debug, Serialize, Eq, PartialEq)]
422 pub struct ColOp<S, T>(pub S, pub T); 424 pub struct ColOp<S, T>(pub S, pub T);
423 425
424 impl<A, S, T> Mapping<A> for ColOp<S, T> 426 impl<A, S, T> Mapping<A> for ColOp<S, T>
425 where 427 where
426 A: Space, 428 A: Space,
559 RowOp(self.0.preadjoint(), self.1.preadjoint()) 561 RowOp(self.0.preadjoint(), self.1.preadjoint())
560 } 562 }
561 } 563 }
562 564
563 /// Diagonal operator 565 /// Diagonal operator
566 #[derive(Clone, Copy, Debug, Serialize, Eq, PartialEq)]
564 pub struct DiagOp<S, T>(pub S, pub T); 567 pub struct DiagOp<S, T>(pub S, pub T);
565 568
566 impl<A, B, S, T> Mapping<Pair<A, B>> for DiagOp<S, T> 569 impl<A, B, S, T> Mapping<Pair<A, B>> for DiagOp<S, T>
567 where 570 where
568 A: Space, 571 A: Space,

mercurial