Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by Transfert2 ( 13 years ago )
Eigen::VectorXd transfertTo2(Eigen::Vector3d point1, Eigen::Vector3d point3, Tensor T){

    /* Objective : solve Ax = b */

    Eigen::MatrixXd A = MatrixXd::Zero(4, 2);
    Eigen::VectorXd b = VectorXd::Zero(4);

    /* Filling Matrix A and Vector b */

    for(int i=0; i<2; ++i){
        for(int l=0; l<2 ; ++l){
            for(int k=0; k<3; ++k){
                A(2*i+l, l) += point1(k)*T(2,l,k) - point1(k)*point3(l)*T(2,2,k);
                b(2*i+l) += point1(k)*T(i,l,k) - point1(k)*point3(l)*T(i,2,k);
            }
        }
    }

    /* Using SVD method */

    Eigen::JacobiSVD<MatrixXd> svd(A, ComputeThinU | ComputeThinV);
    Eigen::VectorXd newPoint = svd.solve(b);
    std::cout << svd.solve(b) << std::endl;

    return newPoint;
}

 

Revise this Paste

Your Name: Code Language: