[eigen] Not able to solve the system of equation having vector as coefficient of the matrix |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: [eigen] Not able to solve the system of equation having vector as coefficient of the matrix*From*: Rohit Aggarwal <cs18mtech11030@xxxxxxxxxx>*Date*: Wed, 5 Jun 2019 00:36:40 +0530*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iith.ac.in; s=google; h=mime-version:from:date:message-id:subject:to; bh=CXCjCkII5wKosM+8JkwQ8oOmCsTpJs8Sd94DoIxnJKM=; b=xizJ6UkcyQWHjvi5OOM1GI0jE7R3xrWor/A9vjHpc7O/P00Hcp9MvoinyaPZVIU4Xy Yqx6XO1Tp00pfLnlTzeDdZ49t2h5O+YVnyUcA4Loow2jKGxY9o889TNYIvMxLO5NDJYJ 17uecqmgsF9ynYQ4RWaWZko8dlqoiLSDTnP6w=

Hi All,

We are trying to use eigen solver api to solve the problem in which we have a matrix containing vector as the coefficient of it.

Form Ax=B

Able to create a matrix for A(2,2) having a vector like

[ [1,2],[3,4]

[5,6],[7,8] ]

Matrix B(2,1)

[ [1,2]

[1,1] ]

But when I am trying to pass the value to the solver, it is giving fatal error (*Eigen/src/SVD/JacobiSVD.h:714:15: error: no matching function for call to ‘abs(const Scalar&)’ if(abs(m_workMatrix.coeff(p,q))>threshold || abs(m_workMatrix.coeff(q,p)) > threshold).*)

Please look into it and suggest what I m missing.

#include <iostream>

#include "Eigen/Dense"

using namespace std;

using namespace Eigen;

int main()

{

Eigen::Matrix< Eigen::RowVector2d, 2, 2> A;

Eigen::Matrix< Eigen::RowVector2d, 2, 1> B;

RowVector2d rv1;

RowVector2d rv2;

RowVector2d rv3;

RowVector2d rv4;

rv1 << 1,2;

rv2 << 3,4;

rv3 << 5,6;

rv4 << 7,8;

cout << "Here is the matrix rv1:\n" << rv1 << endl;

cout << "Here is the matrix rv2:\n" << rv2 << endl;

cout << "Here is the matrix rv3:\n" << rv3 << endl;

cout << "Here is the matrix rv4:\n" << rv4 << endl;

A << rv1,rv2, rv3, rv4;

RowVector2d b1;

RowVector2d b2;

b1 << 1,2;

b2 << 2,1;

B << b1, b2;

cout << "Here is the matrix B(0,0):\n" << B(0,0) << endl;

cout << "Here is the matrix B(0,1):\n" << B(1,0) << endl;

JacobiSVD<Eigen::Matrix<Eigen::RowVector2d, 2, 2>> dec(A);

*}*

*-Rohit Aggarwal*

We are trying to use eigen solver api to solve the problem in which we have a matrix containing vector as the coefficient of it.

Form Ax=B

Able to create a matrix for A(2,2) having a vector like

[ [1,2],[3,4]

[5,6],[7,8] ]

Matrix B(2,1)

[ [1,2]

[1,1] ]

But when I am trying to pass the value to the solver, it is giving fatal error (

Please look into it and suggest what I m missing.

#include <iostream>

#include "Eigen/Dense"

using namespace std;

using namespace Eigen;

int main()

{

Eigen::Matrix< Eigen::RowVector2d, 2, 2> A;

Eigen::Matrix< Eigen::RowVector2d, 2, 1> B;

RowVector2d rv1;

RowVector2d rv2;

RowVector2d rv3;

RowVector2d rv4;

rv1 << 1,2;

rv2 << 3,4;

rv3 << 5,6;

rv4 << 7,8;

cout << "Here is the matrix rv1:\n" << rv1 << endl;

cout << "Here is the matrix rv2:\n" << rv2 << endl;

cout << "Here is the matrix rv3:\n" << rv3 << endl;

cout << "Here is the matrix rv4:\n" << rv4 << endl;

A << rv1,rv2, rv3, rv4;

RowVector2d b1;

RowVector2d b2;

b1 << 1,2;

b2 << 2,1;

B << b1, b2;

cout << "Here is the matrix B(0,0):\n" << B(0,0) << endl;

cout << "Here is the matrix B(0,1):\n" << B(1,0) << endl;

JacobiSVD<Eigen::Matrix<Eigen::RowVector2d, 2, 2>> dec(A);

**Follow-Ups**:

**Messages sorted by:**[ date | thread ]- Next by Date:
**Re: [eigen] Not able to solve the system of equation having vector as coefficient of the matrix** - Next by thread:
**Re: [eigen] Not able to solve the system of equation having vector as coefficient of the matrix**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |