Referencing elements in a reshape expression

Alberto Luaces aluaces@udc.es
Fri Feb 7 16:50:00 GMT 2014


Hello,

is it possible to access elements of a reshape expression?  Rmat and
rloc are 3×3 matrices:

    pos(1:3) = reshape(matmul(Rmat, rloc), [9])([2, 6, 7])

my compiler —gfortran 4.8— shows an error:

pos(19:21) = reshape(matmul(Rmat, rloc), [9]) ([2, 6, 7])
                                          1
Error: Invalid character in name at (1)

Currently I have to perform this operation through an additional step:

    temp = reshape(matmul(Rmat, rloc), [9])
    pos(1:3) = temp ([2, 6, 7])

Thanks,
-- 
Alberto



More information about the Fortran mailing list