MTL vector

xiaoxiao2021-03-06  14

// Solving Bu Robinkin

#include "mtrox.h" #include "mtl / dense1d.h" #include "mtl / mtl.h"

/ * Sample Output

A: 4X3 [[100, 100], [100, 100, 100], [100, 100, 100]] x: [1, 2, 3, 4,] Y: [1, 2, 3,] A XY ': 4X3 [[[ 101, 102, 103], [102, 104, 106], [103, 106, 109], [104, 108, 112] * /

INTMAIN () {Using Namespace MTL; // Begin Typedef Matrix , DENSE <>, Column_major> :: Type Matrix

Typedef Matrix :: size_type size;

Const Sizet M = 4, N = 3; Matrix A (M, N); Dense1d x (m), y (n); double alpha = 1.0; // Fill A, X, AND Y ... / / END MTL :: SET_VALUE (A, 100); Sizet I; for (i = 0; i

Std :: cout << "A: << std :: endl; print_all_matrix (a); std :: cout <<" x: << std :: end1; print_vector (x); std :: cout << "Y:" << std :: endl; print_vector (y);

// The a must be Rectangle and Dense // Begin Rank_one_Update (A, Scaled (X, Alpha), Y); // end std :: cout << "a xy ': << std :: endl PRINT_ALL_MATRIX (A);

Return 0;}

转载请注明原文地址:https://www.9cbs.com/read-49362.html

New Post(0)