Hi Rodrique,
this warning occurs because the compiler cannot statically guarantee
that the type of "m" satisfies the guard for the method call, which in
this case is the array set operator:
operator this(i0:int,i1:int)=(v:T){rank==2}:T{self==v}
This is because earlier you declared the type of the variable "m"
without a rank constraint:
var m:Array[ArrayList[Point]] = ...
There are a couple of ways to remove this dynamic check. One is to
include the rank constraint in the declaration e.g.
var m:Array[ArrayList[Point]](2) = ...
Another, more commonly used approach is to avoid declaring the type and
let the compiler infer it from context. This is mentioned in
http://x10-lang.org/documentation/practical-x10-programming/performance-tuning.html
- "Avoid specifying explicit types for local val variable". For example
val m = new Array[ArrayList[Point]]((1..P)*(1..P));
If you ever need to discover exactly what dynamic checks were generated
by the compiler, you can inspect the generated code. (It includes the
X10 line numbers above for each generated line of Java or C++.)
Cheers,
Josh
On 04/06/12 11:52, Rodrique Djonkou wrote:
Dear,
First, thanks very much for the support you provide.
I have a preocupation. I compile my code with option -VERBOSE_CHECK and I
had this error: "Generated a dynamic check for the method call"
I read the language specification, but I didn't understand the error and
how to fix it.
Here below the code. the errors appears for the line with a (*) and
Bold/Underlined.
Basically, because It's not possible to merge two region or to remove a
region from another,
I put all the point in a ArrayList of Point. and I want to create a array
of dim 2 of my point and store them inside.
Thanks for your support
Ps. It's hard to read all post, does'it exist a way to seach in the
users-archive by using a keyword ?
Thanks
var m:Array[ArrayList[Point]] = new Array[ArrayList[Point]]((1..P)*(1..P));
for(i in 1..P){
val ki = i;
set(ki);
for(j in ki..P){
val kj = j;
*(*) m(kj,ki) = buildDistriMap(kj);*
if(ki != kj){
* (*) m(ki,kj) = myPoint;*
}
}
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users