Sep
22
awarded Editor
Sep
22
revised C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
added 499 characters in body
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
I got my code working using this solution, in the end I used template classes mentioned in this solution and I also had to template the functions.I suppose this is the solution to the question I asked about the right design pattern. I'm surprised though that there isn't a way to do this using polymorphism.
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
this is nice, but I really need the different bar child classes, they have other methods with different implementations which distinguishes them, not just through drilldown. Thanks anyway.
Sep
22
awarded Scholar
Sep
22
accepted C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
@n.m sorry bad wording. I don't want it to automatically select anything. I want bar.drilldown(f), to return a random sample from the distribution, bar, using the uniform random variable f. I have a particular distribution, call this normal, that I always only want to use a particular uniform random number generator, urng. So when I make the concrete class, normal, I want the drilldown method to go to the concrete urng class. Yes, maybe this is a different question, but I thought the problem I have reduces to solving the question I have asked.
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
@n.m, For what it's worth, foo is a uniform random number generator, and bar is a distribution. I want bar.drilldown(f), to select the appropriate/best generator for the particular distribution, bar, and return a random sample from that distribution. I want to be able to use the same source code, but have freedom to change rng's and distributions by instantiating the objects in the code accordingly.
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
@Deduplicator, could you give more info on CRTP? can I use it to keep the barBase class general and still refer to the child classes as I've written for example in the comment above?
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
@JoachimPileborg, I want barBase to refer to child classes. For example, if I have a function int f(barBase & b, fooBase & f){return b.drilldown(f);}, I want the behaviour f(bar1 b,f)=1 and f(bar2 b,f)=2.
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
@OliverCharlesworth, can u give me a little more information?
Sep
22
comment C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
@Sambuca, yes I realise that.
Sep
22
asked C++: How to obtain different behaviour for methods of abstract-derived classes from the derived classes of another abstract class?
Aug
29
comment Is there a way to calculate the photoelectric effect in QED via a Feynman diagram?
@CuriousOne, BTW- I didn't say that the photoelectric effect violates conservation of energy or anything stupid like that. The free process written above doesn't occur because it violates conservation of energy. Its a simple SR kinematic calculation, just set total ingoing four momentum to total outgoing 4 momentum, square, and work in ingoing electrons frame and you will see.
Aug
29
comment Is there a way to calculate the photoelectric effect in QED via a Feynman diagram?
@akrasia, this is exactly the kind of thing that I was thinking. And I agree the model would need to be something simple like an atom. Actually, I was thinking of something like Mott scattering where the $otimes$ is inserted to handle elastic scattering. But in the photoelectric effect, is is inelastic, so not sure how to proceed.
Aug
29
comment Is there a way to calculate the photoelectric effect in QED via a Feynman diagram?
@CuriousOne, the second paper you mention is off topic. I'm not asking how to solve the problem, I'm asking how to solve the problem in QED.
Aug
29
comment Is there a way to calculate the photoelectric effect in QED via a Feynman diagram?
@CuriousOne, before asking I did find 0910.1809. As the authors state, "the photo electric effect in the early experiments is produced by weak, non-coherent radiation of high frequency... whereas [the subject of the present paper] the radiation is weak, of high frequency, and coherent." Firstly, I'm interested in the photon description (not coherent radiation). Secondly, they use non-relativisitc QED, not fully covariant QED. And lastly, what they do looks highly rigorous and mathematical, whereas you can see from the title I'm looking for a Feynman diagram type explanation.
Aug
28
comment Is there a way to calculate the photoelectric effect in QED via a Feynman diagram?
@Carl, I don't mind if metal or semiconductor. If the calculation is easier with a semiconductor because of the problems with the metal mentioned by John, then please provide that calculation as an answer. I'm still not sure how to "use QED" in this case.
Aug
28
asked Is there a way to calculate the photoelectric effect in QED via a Feynman diagram?
Aug
5
comment How does the value of an asset (valued in two different currencies) change when the exchange rate changes?
OK, so I'm in the wrong place. Thanks, good to know. Is there another stack exchange more suitable to theoretical questions like this?
1 2 3