After reading through some example and sources I constructed a guess for the translation from .m to oct suppose I pass into arg the dimensions of the various array (I know it is superflous but anyway..) The problem was how to transalte this:
Imagine I have some n-dime array G1(Chi,Chi,d) G2(Chi,Chi,d)
and I want to create a n-d array given by: theta=zeros(Chi,Chi,d,d);
for i=1:d for j=1:d theta(:,:,i,j)=G1(:,:,i)*G2(:,:,j);
endfor endfor
const int d = args(0).int_value();
const int Chi = args(1).int_value();
error: request for member 'matrix_value' in 'G2.NDArray::<anonymous>.MArrayN<double>::<anonymous>.ArrayN<double>::<anonymous>.Array<T>::operator() [with T = double](((const Array<int>&)(& Array<int>(((const Array<idx_vector>&)((const Array<idx_vector>*)(& idxg2)))))))', which is of non-class type 'double'
any suggestion on how to correct this:
---------- Forwarded message ---------- From: Luca Tagliacozzo <
address@hidden> Date: May 3, 2007 4:48 PM Subject: writing oct files To: address@hidden
I am not sure this is the place to post such a question.
I have a working .m file. I would like to pass it to an oct file. I have some major questions. Imagine I have some n-dime array G1(Chi,Chi,d) G2(Chi,Chi,d)
and I want to create a n-d array given by: theta=zeros(Chi,Chi,d,d);
for i=1:d for j=1:d theta(:,:,i,j)=G1(:,:,i)*G2(:,:,j);
endfor endfor
.
I should be able to address the 2dim subarray of theta to copy inside the values of the product G1,G2...
Have you any clue to what the C++ sintax would be?