how to add matrix3x3 data to OBAtom

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to add matrix3x3 data to OBAtom

ivan.petit
Hi obabel users,

I would like to store a 3x3 matrix data to OBAtom. Could you tell me the right way to do that?
I tried a procedure like that

        OBAtom Atm;
        vector3 vec1(1,2,3), vec2(4,5,6), vec3(7,8,9);
        OBMatrixData Mat;
        Mat.SetData(matrix3x3(vec1, vec2, vec3));
        Mat.SetAttribute("tensor");
        Atm.SetData(&Mat);
        Atm.GetData("tensor");

Atm.GetData("tensor") return an address but I don't know how use its and I don't even if this address is associate to the matrix?

Thank you for your help !

Ivan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to add matrix3x3 data to OBAtom

Noel O'Boyle
Administrator
It doesn't work like that. Just use a map from OBAtom* to your matrix like you would for any associations.

Note that objects allocated on the stack will disappear when you leave the enclosing scope so you might want to use "new".

On 15 Mar 2017 9:33 p.m., "ivan.petit" <[hidden email]> wrote:
Hi obabel users,

I would like to store a 3x3 matrix data to OBAtom. Could you tell me the
right way to do that?
I tried a procedure like that

        OBAtom Atm;
        vector3 vec1(1,2,3), vec2(4,5,6), vec3(7,8,9);
        OBMatrixData Mat;
        Mat.SetData(matrix3x3(vec1, vec2, vec3));
        Mat.SetAttribute("tensor");
        Atm.SetData(&Mat);
        Atm.GetData("tensor");

Atm.GetData("tensor") return an address but I don't know how use its and I
don't even if this address is associate to the matrix?

Thank you for your help !

Ivan



--
View this message in context: http://forums.openbabel.org/how-to-add-matrix3x3-data-to-OBAtom-tp4659826.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to add matrix3x3 data to OBAtom

shabdaclinic
In reply to this post by ivan.petit
In this article include about the matrix based program.it include simple program.everyone easily understand this program.this article is very helpful for the students.i really like to read this article.thanks a lot for sharing this article.
Loading...