Feature Requests item #3076690, was opened at 2010-09-27 13:13
Message generated for change (Tracker Item Submitted) made by dkoes
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=428743&aid=3076690&group_id=40728
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: API
Group: 2.3
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Koes (dkoes)
Assigned to: Nobody/Anonymous (nobody)
Summary: better perl bindings for rmsd calculations
Initial Comment:
I was trying to use the Perl interface to OpenBabel to do some RMSD
calculations and found I couldn't since key functionality seemed to be missing.
Specifically, the ability to manipulate SWIG C arrays in perl and access to a
couple functions. Here are the changes I made to get things to work:
include/openbabel/obutil.h
156,164d155
< #ifndef __KCC
< extern "C" {
< OBAPI void rotate_coords(double*,double m[3][3],unsigned int);
< OBAPI double calc_rms(double*,double*,unsigned int);
< }
< #else
< OBAPI void rotate_coords(double*,double m[3][3],unsigned int);
< OBAPI double calc_rms(double*,double*,unsigned int);
< #endif
165a157,159
> OBAPI void rotate_coords(double*,double m[3][3],int);
> OBAPI double calc_rms(double*,double*,unsigned int);
>
scripts/openbabel-perl.i
163,188d162
< // Add some helper functions for C arrays
< %inline %{
< double *double_array(int size) {
< return (double *) malloc(sizeof(double)*size);
< }
< void double_destroy(int *a) {
< free(a);
< }
< void double_set(double *a, int i, double val) {
< a[i] = val;
< }
< double double_get(double *a, int i) {
< return a[i];
< }
<
< double (*rotation_matrix())[3] {
< return (double (*)[3]) malloc(9*sizeof(double));
< }
<
< void rotation_matrix_free(double (*m)[3])
< {
< free(m);
< }
<
< %}
<
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=428743&aid=3076690&group_id=40728
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel