Hi Damian --
Is this just a case of getting a boolean backwards (something I'm guilty
of all the time)? I.e., don't you want to assert that the bounds are
equal to one another?
assert(lwbRaw == lwbScaled);
assert(upbRaw == upbScaled);
Also, note that if you aren't actually using the individual bounds later
in your "..." code, you can also just assert that the domains are equal
(i.e., that they describe the same indices):
assert(xcolj.domain == xcolScaled.domain);
And, printing out a domain can be another way to quickly take stock of
a situation:
writeln((xcolj.domain, xcoljScaled.domain));
-Brad
On Tue, 18 Dec 2018, Damian McGuckin wrote:
Given
x : [1..n, 1..n] real
and some real number scale then if we have
for i in 1 ..n do
{
var xcolj = x[i..n, i];
var xcoljScaled = xcolj / scale;
var lwbRaw = xcolj.domain.dim(1).low;
var upbRaw = xcolj.domain.dim(1).high;
var lwbScaled = xcoljScaled.domain.dim(1).low;
var upbScaled = xcoljScaled.domain.dim(1).high;
// Sadly
assert(lwbRaw != lwbScaled);
assert(upbRaw != upbScaled);
....
}
I would have thought that the domain of xcolj and xcoljScaled was the same?
But this is not the case.
Just curious why not?
Regards - Damian
Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers