paddax Posted January 27, 2015 Share Posted January 27, 2015 Is there a method of block allocating P variables via the IDE, the global keyword seems to allocate a single P variable above the range 8192 but my application needs to allocate blocks of P variables for use with the matrix library. Link to comment Share on other sites More sharing options...
paddax Posted January 27, 2015 Author Share Posted January 27, 2015 Just found the syntax global MY_MATRIX(16) allocates 16 P variables Unfortunately the matrix functions msolve etc. require P variable indexes not the actual P variable expansion, is there a way of getting the starting index of MY_MATRIX The manual states the following global SurfaceNormal(3); global ToolNormal(3); the following command could be used: AngleCosine = sumprod(&SurfaceNormal, &ToolNormal, 3, 1, 1) This syntax doesn't seem to work. Link to comment Share on other sites More sharing options...
steve.milici Posted January 27, 2015 Share Posted January 27, 2015 Put an ‘&’ in front of your array and PPMAC will handle it by skipping the ‘P’ and just using the number of the P variable or expression. Example: global matrix1(9), matrix2(9); result = msolve(&matrix1(0), &matrix2(0), 3, 3) See the IDE “Program Development” Example project. Link to comment Share on other sites More sharing options...
Richard Naddaf Posted January 27, 2015 Share Posted January 27, 2015 Here is an example I used in a training class recently // Array to hold result: global MxResult(3); MxResult(0)=0; MxResult(1)=0; MxResult(2)=0; MxResult(3)=0; // Matrix 1 global Mat1x11=1, Mat1x12=2, Mat1x13=3; global Mat1x21=4, Mat1x22=5, Mat1x23=6; // Matrix 2 global Mat2x11=7, Mat2x12=8; global Mat2x21=9, Mat2x22=10; global Mat2x31=11, Mat2x32=12; // Matrix Multiplication global MxMult; MxMult=MMUL(&MxResult(0),&Mat1x11,&Mat2x11,2,3,2); // MxMult=1 operation success Link to comment Share on other sites More sharing options...
paddax Posted January 28, 2015 Author Share Posted January 28, 2015 Could you update the "Power PMAC User Manual" to reflect this? Link to comment Share on other sites More sharing options...
Recommended Posts