In #43 equality was changed to be elementwise. This currently causes matrix validation to break in some cases. For example:
val x = zeros(3,2)
val y = zeros(3,2)
validate {
x("x"){'N' x 1}
y("y"){'N' x 'M'}
}
This should fail (because x must have 1 column) but doesn't.
The issue is that DimensionValidator constructs a dimensions hashmap from matrices to possible dimensions. Because y and x are equal under elementwise equality they hash to the same bin in DimensionValidator.dimensions. Thus x's dimension list is clobbered by y's and x survives the dimension check.
Its probably enough to change the validator hashes to use a referential equality wrapper.
In #43 equality was changed to be elementwise. This currently causes matrix validation to break in some cases. For example:
This should fail (because
x
must have 1 column) but doesn't.The issue is that
DimensionValidator
constructs adimensions
hashmap from matrices to possible dimensions. Becausey
andx
are equal under elementwise equality they hash to the same bin inDimensionValidator.dimensions
. Thusx
's dimension list is clobbered byy
's andx
survives the dimension check.Its probably enough to change the validator hashes to use a referential equality wrapper.