标签: arrays fortran slice
我可以在Fortran中将切片应用于向量值函数的结果而不首先将结果赋值给变量吗? E.g:
a = [1._dp, 2._dp, 3._dp] b = [5._dp, 2._dp, 2._dp] c = cross(a,b) ! returns the vector product d = sum(c(1:2)) d = sum(cross(a,b)(1:2))