CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
Loading...
Searching...
No Matches
ex02m_dense_matrix_algebra_vmult.cpp
#include <iostream>
#include <cla3p/dense.hpp>
#include <cla3p/algebra.hpp>
int main()
{
A = 3.;
x = 2.;
std::cout << "A:\n" << A;
std::cout << "x:\n" << x << "\n";
/*
* Perform the operation (A * x) using operators and the mult function respectively
*/
std::cout << "y1:\n" << y1;
cla3p::ops::mult(1., cla3p::op_t::N, A, x, 0., y2);
std::cout << "y2:\n" << y2 << "\n";
/*
* Perform the operation (y1 += A * x) using operators and the mult function respectively
*/
y1 += A * x;
std::cout << "y1:\n" << y1;
cla3p::ops::mult(1., cla3p::op_t::N, A, x, 1., y2);
std::cout << "y2:\n" << y2;
return 0;
}
@ N
Definition enums.hpp:74
void mult(T_Scalar alpha, op_t opA, const dns::XxMatrix< T_Scalar > &A, op_t opB, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C)
Updates a general matrix with a matrix-matrix product.
XxMatrix< real_t > RdMatrix
Double precision real matrix.
Definition dense.hpp:55
XxVector< real_t > RdVector
Double precision real vector.
Definition dense.hpp:31