Comments (17)
@marcsous, I can't reproduce this bug... Can you try with the most recent commit in my fork?
from mappedtensor.
>> b = MappedTensor(1, 3, 'Class', 'char')
b =
MappedTensor object, containing: char [1 3].
Methods
>> b(:) = 't'
b =
MappedTensor object, containing: char [1 3].
Methods
from mappedtensor.
I am seeing something very strange. When I put a keyboard command on line 432:
% my_subsref - Standard array referencing
function [tfData] = my_subsref(mtVar, S)
keyboard
% - Test for valid subscripts
cellfun(@isvalidsubscript, S.subs);
then I see this mess:
>> clear all
>> a=MappedTensor(1,3,'class','char');
K>> dbstack
> In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
In MappedTensor.MappedTensor>MappedTensor.my_subsref at 432
In MappedTensor.MappedTensor>MappedTensor.subsref at 420
In MappedTensor.MappedTensor>MappedTensor.cast at 1465
In MappedTensor.MappedTensor>MappedTensor.double at 1446
In workspacefunc>getShortValueObjectJ at 618
In workspacefunc>getShortValueObjectsJ at 791
In workspacefunc at 98
from mappedtensor.
I can't reproduce this either. Have you tried with a cleanly checked-out version?
from mappedtensor.
Yes this is with the latest. It only happens with char:
>> clear
>> a=MappedTensor(1,3,'class','single');
>> a=MappedTensor(1,3,'class','double');
>> a=MappedTensor(1,3,'class','int8');
>> a=MappedTensor(1,3,'class','uint8');
>> a=MappedTensor(1,3,'class','logical');
>> a=MappedTensor(1,3,'class','char');
K>>
Makes no sense at all! This is on R2013a, I'll check on R2014b on Monday.
from mappedtensor.
I ran exactly that line of code with no problems. I have R2014b; maybe it’s something weird about 2013…?
from mappedtensor.
I think what is happening is the GUI is trying to display values in the Workspace / Values column but encountering the /0 character. It shows "Error displaying value" on my version. They must have added some handling for that versions >R2013a.
Not sure there is an easy cure. Presently char MappedTensor does not work on my version. I can live with that :)
>> clear all
>> a=MappedTensor(1,3,'class','char');
>> details(a)
1x3 MappedTensor handle array with properties:
strRealFilename: '/tmp/tp6a1213cd_81e6_446f_8639_325618e84897'
strCmplxFilename: []
bReadOnly: 0
hRealContent: [240 77 123 214 75 127 0 0]
hCmplxContent: []
bTemporary: 1
strClass: 'double'
strStorageClass: 'uint16'
nClassSize: 2
vnDimensionOrder: [1 2]
nNumElements: 3
vnOriginalSize: [1 3]
bMustCast: 1
bIsComplex: 0
fComplexFactor: 1
fRealFactor: 1
nHeaderBytes: 0
strMachineFormat: 'ieee-le'
bBigEndian: 0
hShimFunc: @mapped_tensor_shim
hRepSumFunc: @mapped_tensor_repsum
hChunkLengthFunc: @mapped_tensor_chunklength
from mappedtensor.
Ok, this issue may be resolved in the latest commit. Please give it a go.
from mappedtensor.
Sorry to report, still not working, It only happens with this particular size of array [1 n], not with [n 1] or multi-dimensional, perhaps because Matlab tries to display it as a string in the Workspace -> Value column and somehow gets in a mess. It's got to be a bug in Matlab since you see it working in R2014b.
>> a=MappedTensor(1,3,'class','char');
>> details(a)
1x3 MappedTensor handle array with properties:
strRealFilename: '/tmp/tpf2717960_650a_412c_a60d_160574a7960d'
strCmplxFilename: []
bReadOnly: 0
hRealContent: [208 89 163 198 25 127 0 0]
hCmplxContent: []
bTemporary: 1
strClass: 'double'
strStorageClass: 'uint16'
nClassSize: 2
vnDimensionOrder: [1 2]
nNumElements: 3
vnOriginalSize: [1 3]
bMustCast: 1
bIsComplex: 0
fComplexFactor: 1
fRealFactor: 1
nHeaderBytes: 0
strMachineFormat: 'ieee-le'
bBigEndian: 0
hShimFunc: @mapped_tensor_shim
hRepSumFunc: @mapped_tensor_repsum
hChunkLengthFunc: @mapped_tensor_chunklength
from mappedtensor.
But if you switch off the workspace display, does the bug still occur? Could be matlab is casting to double for display or something.
On 1 May 2016, at 2:23 PM, marcsous [email protected] wrote:
Sorry to report, still not working, It only happens with this particular size of array [1 n], not with [n 1] or multi-dimensional, perhaps because Matlab tries to display it as a string in the Workspace -> Value column and somehow gets in a mess. It's got to be a bug in Matlab since you see it working in R2014b.
a=MappedTensor(1,3,'class','char');
details(a)1x3 MappedTensor handle array with properties:
strRealFilename: '/tmp/tpf2717960_650a_412c_a60d_160574a7960d' strCmplxFilename: [] bReadOnly: 0 hRealContent: [208 89 163 198 25 127 0 0] hCmplxContent: [] bTemporary: 1 strClass: 'double' strStorageClass: 'uint16' nClassSize: 2 vnDimensionOrder: [1 2] nNumElements: 3 vnOriginalSize: [1 3] bMustCast: 1 bIsComplex: 0 fComplexFactor: 1 fRealFactor: 1 nHeaderBytes: 0 strMachineFormat: 'ieee-le' bBigEndian: 0 hShimFunc: @mapped_tensor_shim hRepSumFunc: @mapped_tensor_repsum hChunkLengthFunc: @mapped_tensor_chunklength
—
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub
from mappedtensor.
BINGO! That solved it.
Edit: Well, not solved it - but that was it :)
from mappedtensor.
It’s caused by the transparent casting, then. But why only for char? And how can we possibly fix this?
On 1 May 2016, at 2:39 pm, marcsous [email protected] wrote:
BINGO! That solved it.
—
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub
from mappedtensor.
Just a thought - it may not matter in real use because the bug only happens when Matlab tries to display it in the Workspace.
from mappedtensor.
But people often have the workspace view switched on...
On 1 May 2016, at 2:47 PM, marcsous [email protected] wrote:
Just a thought - it may not matter it real use because the bug only happens when Matlab tries to display it in the Workspace.
—
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub
from mappedtensor.
Found another little bug. MappedTensor was reporting true for isnumeric of a char.
% isnumeric - METHOD Overloaded isnumeric function
function [bIsNumeric] = isnumeric(mtVar)
bIsNumeric = ~islogical(mtVar) && ~ischar(mtVar);
end
Then a little sleuthing in workspacefunc suggests there is a failure of strfind on the MappedTensor, since MappedTensor is reporting ischar() as true.
if (ischar(var) && (ndims(var) == 2) && (size(var, 1) == 1))
% Show "single-line" char arrays, while establishing a reasonable
% truncation point.
if isempty(strfind(var, char(10))) && ...
isempty(strfind(var, char(13))) && ...
isempty(strfind(var, char(0)))
...
but
a=MappedTensor(1,3,'class','char');
>> strfind(a, char(10))
Error using strfind
Conversion to double from MappedTensor is not possible.
Looks like we need to overload strfind for MappedTensor. Sorry I gotta go now. Bon courage!
If I could suggest, we overload it to return [] always. Otherwise it would be an expensive operation and kind of preempts the reason for having a MappedTensor char in the first place.
from mappedtensor.
OK - I just overloaded strfind to return [] and it now works. The Workspace/Value box still says "Error displaying value" but the MappedTensor behaves correctly. The error must come from the failure of java.lang.String(['''' var '''']) with a MappedTensor instead of a char array.
Maybe ischar() should return false and chars should be stored as an uint8 to avoid some of these difficulties. It'd be annoying to overload all the string functions for MappedTensor char.
from mappedtensor.
I kept the overloaded strfind
, with a warning. Many other string functions seemed to work ok — if you find one that fails nastily, please let me know.
from mappedtensor.
Related Issues (15)
- Allow integer types for index variables HOT 21
- Shortcut casting causes errors HOT 1
- Shortcut casting still causes errors HOT 1
- Constructor fails with complex input HOT 2
- Does it have to inherit from a handle object? HOT 6
- Data is corrupted when subsampling a large file (8Gb) on windows HOT 13
- 340 Gigabyte data and error while creating .mex from mapped_tensor_shim.c HOT 4
- Error with uint indexes HOT 1
- Indexing a mapped tensor after permutation
- Add overloaded `prod` method HOT 3
- Direct conversion of a tensor to a `MappedTensor` in the constructor HOT 3
- Overloaded `plus` method bug HOT 3
- a=cast(a) could be implemented with strClass HOT 1
- Empty index causes error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mappedtensor.