This is almost a duplicate of my previous question,
I'm stuck and I'll ask you a question again.
3x3 matrix R
And
3 × 1 matrix x, t
When there is
Rxt
I want to calculate
I wrote a little bit of it, so here's what it looks like:
I'd like you to see if it's right (if you're not, please give me the correct answer).
I'm creating a program that does some calculations and puts the results into a file, but I'm looking for the cause because an impossible value comes out.
Codefloat [] [] A = new float [3] [1];// array to put the calculation result
for (int i = 0;i<3;i ++) {
for (int j = 0;j<1;j ++) {
for (int k = 0;k<3;k ++) {
A [i] [j] + = (R [i] [k] * x [k] [j])t [k] [j];
↑/↑ Is this right?
}
}
}

Answer # 1

Answer # 2
t is subtracted by the number of loops.
In the loop, first focus on finding the matrix product, and then subtract after exiting the loop. 
Answer # 3
I haven't looked at the code carefully, but t [k] [j] is subtracted from A [i] [j] inside the threestage loop, so t is Is it drawn three times?
It is better to subtract t after calculating Rx. 
Answer # 4
If x, t is a 3 × 1 matrix, you can think of it as an array.
Related articles
 [java] i want to prohibit input of only blanks using regular expressions
 java  i want to sort using sort
 java  objectoriented and twodimensional array
 i want to find the average value of a twodimensional array in java
 java  i want to get data from mysql using spring jdbc
 java  about the case of using return when the return value is void
 java  using escape characters oracle
 java  i want to know the frequency of occurrence of numbers in an int type twodimensional array
 java  how to write test code using scannernextint () in junit
 java  i want to pass or fail using bufferedreader, but nothing is displayed
 java  calculate the shortest path using dp
 java  i want to read csv from s3 using spring boot and insert it into aurora
 java  tutorial implementation using external library in android studio
 java  a program for calculating the area of a figure using the if statement
 java  how to connect to db using bind variables create table
 about calculation using java
 java  display downloaded images using picasso
 java  processing i can't get the values out of a twodimensional variable length array what does it mean to have different ty
 java  calculation of combinations using dp
 java  please tell me how to test multiple @postmapping to the same url using mockmvc
 python 3x  typeerror: 'method' object is not subscriptable
 python  you may need to restart the kernel to use updated packages error
 javascript  how to check if an element exists in puppeteer
 xcode  pod install [!] no `podfile 'found in the project directory
 vuejs  [vuetify] unable to locate target [dataapp] i want to unit test to avoid warning
 android studio  emulator: dsound: could not initialize about the error message directsoundcapture
 android studio  unresolved reference comes out in kotlin
 mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
 django  oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
 python  importerror: cannot import name md5 error cannot be resolved
Multiple and subtract at the same time in the
for
statement that loops over the variablek
.Only multiplicationis calculated in the
for
statement that loops with the variablek
.In the first place, matrix addition and subtraction can be done by adding and subtracting components at the same place in the matrix.
Multiplication is different. The components are multiplied, but the location is different.
Therefore, when multiplying, it is a triple for statement.
(M * n matrix with double + multiplication and one more
for
statement added>total triplefor
statement)Therefore, when multiplying, it is a triple
for
statement.Let's calculate the subtraction part in the outer
for
statement (in this case, variablej
).(Duplicate
for
statement)<Calculation result>
3
2
2 The element of