Redian新闻
>
interview question: make all class member functions virtual (转载)
avatar
interview question: make all class member functions virtual (转载)# Programming - 葵花宝典
s*y
1
【 以下文字转载自 LES 讨论区 】
发信人: litecoffee (咖啡), 信区: LES
标 题: 京剧
发信站: BBS 未名空间站 (Tue Dec 2 10:59:55 2008)
我是从来都听不懂,过耳之际觉得既不好听也不难听,只是童年昏黄夜晚的一小段
背景音。
高中转学,班上有一个与众不同的男生,据说他小时候上过一年半载戏校,从此说
话举止都跟“角儿”似的,说话比比划划,伸出来的必是兰花指,嗓音还吊起一个八度
。我们语文老师是个慈眉善目斯文儒雅的老太太,曾经看着他,用好听的京片子怜爱又
无奈地说,这孩子啊,练岔了。
他特爱拉着人说戏,说起来如数家珍滔滔不绝,不管别人懂不懂,把全班同学烦了
个遍,然后抓住我这新来乍到的下嘴,我没见过这个,面对他那巨大的热诚只有勉为其
难地听,最可怖的场面出现了,他说着说着突然来了个身段示范,口中有板有眼地念念
有词,下腰、回眸,兰花指支在腮旁嫣然一笑,嘴里还念了一声“台” ,挺高一男生
就这么矮在我身边并保持5秒才挪动,在众同学的大笑鼓掌中我无比尴尬和恼火,连带
着对京剧起了抵触,坚决不能跟他喜欢一样的东西。。。曾怀疑他是GAY,
avatar
c*h
2
manifold learning的方法一堆堆,怎样衡量哪个方法好哪个方法坏?
avatar
f*y
3
【 以下文字转载自 JobHunting 讨论区 】
发信人: hours16 (你好), 信区: JobHunting
标 题: interview question: make all class member functions virtual
发信站: BBS 未名空间站 (Mon Aug 25 21:52:32 2008)
the drawbacks of making all class member functions are virtual,
1. virtual table is bigger and lower the efficiency.
2. any more?
it seems the interviewer expect for more drawback, Thanks
avatar
x*k
4
张火丁怎么会淹没,那是当今最有观众缘的青衣了。
avatar
d*e
5
看你用来干什么了?
不同的目的有不同的衡量方法。

【在 c*******h 的大作中提到】
: manifold learning的方法一堆堆,怎样衡量哪个方法好哪个方法坏?
avatar
f*y
6
Do we need to redefine the virtual functions, even if they are the same for
both base class and derived class?

【在 f******y 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: hours16 (你好), 信区: JobHunting
: 标 题: interview question: make all class member functions virtual
: 发信站: BBS 未名空间站 (Mon Aug 25 21:52:32 2008)
: the drawbacks of making all class member functions are virtual,
: 1. virtual table is bigger and lower the efficiency.
: 2. any more?
: it seems the interviewer expect for more drawback, Thanks

avatar
c*h
7
用来发paper呢?。。

【在 d******e 的大作中提到】
: 看你用来干什么了?
: 不同的目的有不同的衡量方法。

avatar
i*r
8
I don't think you need to redefine functions for derived class.

for

【在 f******y 的大作中提到】
: Do we need to redefine the virtual functions, even if they are the same for
: both base class and derived class?

avatar
h*e
9
Whichever makes your method look better than others...

【在 c*******h 的大作中提到】
: 用来发paper呢?。。
avatar
r*y
10
you only make those functions virtual when they are truely needed to be
otherwise it's a mis-design, not a drawback

【在 f******y 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: hours16 (你好), 信区: JobHunting
: 标 题: interview question: make all class member functions virtual
: 发信站: BBS 未名空间站 (Mon Aug 25 21:52:32 2008)
: the drawbacks of making all class member functions are virtual,
: 1. virtual table is bigger and lower the efficiency.
: 2. any more?
: it seems the interviewer expect for more drawback, Thanks

avatar
d*e
11
... ...
我是问具体的功用啊。
比如Discrimination就是识别率啦,FAR,EER等等。画ROC Curve比较。
Clustering就是Perplexity之类的啦。
等等... ...

【在 c*******h 的大作中提到】
: 用来发paper呢?。。
avatar
b*y
12
For base classes, it is ok to have more virtual functions because derived
classes may need to customize these functions. For concrete classes, they
may have their own nonvirtual functions that are not supposed to be
overrided.
Also, if you declare a function as virtual, it can't be a inline function.

【在 f******y 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: hours16 (你好), 信区: JobHunting
: 标 题: interview question: make all class member functions virtual
: 发信站: BBS 未名空间站 (Mon Aug 25 21:52:32 2008)
: the drawbacks of making all class member functions are virtual,
: 1. virtual table is bigger and lower the efficiency.
: 2. any more?
: it seems the interviewer expect for more drawback, Thanks

avatar
c*h
13
其实我知道啦。。。
真要是具体有用途的,用什么衡量是很明显的
但LLE,eigenmaps,MVU,isomaps一堆流行的方法,哪个曾经提到过有一个
quatitative的衡量指标的。。。就知道画画图了事。。。

【在 d******e 的大作中提到】
: ... ...
: 我是问具体的功用啊。
: 比如Discrimination就是识别率啦,FAR,EER等等。画ROC Curve比较。
: Clustering就是Perplexity之类的啦。
: 等等... ...

avatar
d*n
14
it can be inline function but the complier will probably not treat it as
inline function:)
avatar
R*n
15
如果是做问题的paper,自然看具体效果,当然,如果只是效果好,而不solid的话,会
让人觉得只是参数调得好,或者其他步骤做得好而已
如果是做方法的paper,就看出发点,需要的假设是否make sense,推导,可推广性,
不同类型的数据集上的performance,等等。LLE,ISOMAP,Laplace Eigenmaps,LTSA等,
应该有paper对这些进行分析和比较
manifold learning,或者non-linear dimension reduction,如果可以简单
quatitative指标就好了,还有什么可以值得研究的呢。learning中太多问题,目前都
没有办法定量分析

【在 c*******h 的大作中提到】
: 其实我知道啦。。。
: 真要是具体有用途的,用什么衡量是很明显的
: 但LLE,eigenmaps,MVU,isomaps一堆流行的方法,哪个曾经提到过有一个
: quatitative的衡量指标的。。。就知道画画图了事。。。

avatar
s*d
16
不知道Java的designer会怎么回答这个问题。
avatar
g*g
17
Efficiency is the only benefit of non-virtual function.
By making all non-static functions virtual, Java simplifies
its syntax a lot.

【在 s*******d 的大作中提到】
: 不知道Java的designer会怎么回答这个问题。
avatar
F*r
18
The more virtual functions you declare, more places you need to worry about
for complicated overriden behavior...You probably should only declare
virtual when it's really necessary
avatar
g*g
19
On the contrary, it's more complicated in C++ way.
Let's say Child inherits from Parent, both have a do function.
Parent a = new Child();
Child b = new Child();
In C++, a.do() will call Parent.do(), b.do() will call Child.do() if
do() is not virtual.
but both a and b are an instance of Child in runtime. This can
be confusing, you have to check declaration of Parent before you know
whether it's virtual and which function is called.
In java, it's always calling Child.do().

about

【在 F**********r 的大作中提到】
: The more virtual functions you declare, more places you need to worry about
: for complicated overriden behavior...You probably should only declare
: virtual when it's really necessary

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。