I find that boost :: ublas does not support stepwise operations and operations in the sequence are very good (but the efficiency is pretty high :)) I'm trying
D = A ^ 2. * B ^ 3. * C
where A, B, C are all square matrices of the same size, the operator ". *" denotes the operation "element by element", and ^ is the degree of the matrix. With boost: ublas, I wrote
for (int n=0; n<300; n++)
{
for (int k=0; k<300; k++)
{
D(n, k) = pow(abs(A(n, k)), 2)*pow(abs(B(n, k)), 3)*C(n, k);
}
}
In my program, I have many sequence operations, as shown above, anyway, can I get the same result, but using one line of code instead of a loop?
In addition, I notice that it seems impractical to assign a constant to all elements of a matrix or vector, for example
boost :: numeric :: ublas :: vector v (100); v = 0.2;
, , , ? , , . Armadillo, , ( 10 ).