Hi Olga,
this would work, although ArrayLisy.removeLast will not actually shrink the
backing storage. I agree with you that the std::vector::resize way is much
neater! I have just added this as a new feature:
https://jira.codehaus.org/browse/XTENLANG-3443
If you are able to either build against X10 SVN HEAD, or just pull in the
changes from r28431, could you please see whether the new method
ArrayList.resize() suits your purposes?
Cheers,
Josh
Hello Josh,
Thank you for reply.
I rewrote ratio_.resize( dim_, 1.0 ) in x10 like this:
if (ratio_.size() >= dim_){
val dif = ratio_.size() - dim_;
for (var i:Int = 0; i < dif; i++){
ratio_.removeLast();
}
} else {
val dif = dim_ - ratio_.size();
for (var i:Int = 0; i < dif; i++){
ratio_.add(1.0);
}
}
I guess this should work?
Best regards,
Olga
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users